forked from miselin/pedigree
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun_pup.sh
More file actions
executable file
·36 lines (26 loc) · 855 Bytes
/
run_pup.sh
File metadata and controls
executable file
·36 lines (26 loc) · 855 Bytes
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
#!/bin/bash
# Run pup, and install pup if it is not present.
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
PUP_TMP="$DIR/scripts/pup.whl.tmp"
PUP="$DIR/scripts/pup.whl"
set +e
try_update_pup()
{
curl -o ".pup-version-new" https://pup.pedigree-project.org/pup-version
if cmp --silent ".pup-version-new" ".pup-version"; then
rm -f ".pup-version-new"
else
curl -o "$PUP_TMP" https://pup.pedigree-project.org/pup.whl && \
mv "$PUP_TMP" "$PUP" && mv ".pup-version-new" ".pup-version"
fi
}
# Download pup for the first time if we don't know what version we have.
if [ ! -e .pup-version ]; then
try_update_pup
fi
# Update pup if needed.
if test $(find .pup-version -maxdepth 1 -mmin +120); then
try_update_pup
fi
set -e
python3 "$PUP/pedigree_updater" --config="$DIR/scripts/pup/pup.conf" $*