aboutsummaryrefslogtreecommitdiff
path: root/bin/check
blob: cf80b24333e4d11a507b9a1ccc7b23c2e7b9b2d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh
# SPDX-License-Identifier: 0BSD

set -eu

version=${1?"usage: $0 <version>"}

tgz=builds/git-annex-$version-linux-amd64.tar.gz
test -f "$tgz" || {
    printf >&2 'file does not exist: %s\n' "$tgz"
    exit 2
}

pwd_orig=$(pwd)

tdir=$(mktemp -d "${TMPDIR:-/tmp}"/static-annex-XXXXXXX)
tar xzf "$tgz"  -C "$tdir"
cd "$tdir/git-annex-$version"

if ldd bin/git-annex 2>/dev/null
then
    printf >&2 'ldd unexpectedly had 0 exit status on bin/git-annex\n'
    ldd bin/git-annex
    exit 1
fi

PATH=$(pwd)/bin:$PATH
export PATH

base=${tdir##*/}
command -v git-annex | grep -qF "$base"
command -v git-annex-shell | grep -qF "$base"
command -v git-remote-annex | grep -qF "$base"
command -v git-remote-tor-annex | grep -qF "$base"

git annex test

cd "$pwd_orig"
chmod -R 777 "$tdir"
rm -r "$tdir"