aboutsummaryrefslogtreecommitdiffstats
path: root/appimage/entrypoint
blob: b1ee7eb00c9775189913a00777ec0a1791ad2498 (plain) (blame)
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
#!/bin/bash
set -e
if [ "$SKIP_TESTS" = "1" ]; then
    touch /tmp/skip-tests
fi
if [ $(id -u) = 0 ]; then
    if [ ! -d /tmp/build ]; then
        echo "/tmp/build must exist"
        exit 2
    fi
    id=$(stat -c %u /tmp/build)
    adduser --home /tmp/build --no-create-home --uid $id --disabled-password --gecos build build
    exec sudo -iu build $0 "$@"
fi

cd /tmp/build
if [ ! -d qpdf ]; then
    if [ "$1" == "" ]; then
        echo "A repository and optional git clone arguments must be given"
        exit 2
    fi
    git clone "$@" qpdf
fi
cd qpdf
if [ -f /tmp/skip-tests ]; then
    export SKIP_TESTS=1
fi
./appimage/build-appimage