-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall-chjize
executable file
·64 lines (50 loc) · 2.35 KB
/
install-chjize
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
# *** This has been auto-generated from README.md by /opt/chj/chjize/actions/install-chjize ***
set -eu
apt-get update
apt-get install -y git make gnupg
mkdir -p /opt/chj
cd /opt/chj
git clone https://github.com/pflanze/chjize.git
cd chjize/
gpg --import cj-key.asc
gpg --import cj-key-2.asc
version=r$(git tag -l | grep ^r | sed s/^r// | LANG=C sort -rn | head -1)
git checkout -b local "$version"
tmpout=$(mktemp)
tmperr=$(mktemp)
git tag -v "$version" > "$tmpout" 2> "$tmperr" || { cat "$tmpout" "$tmperr"; false; }
cat "$tmpout" "$tmperr"
# Check that the above command gives "Good signature", and (if warning) shows
# my fingerprint 7312F47D9436FBF8C3F80CF2748247966F366AE9 if you don't have
# a trust path to the key (which is signed by my older key A54A1D7CA1F94C866AC81A1F0FA5B21104EDB072
# (A54A 1D7C A1F9 4C86 6AC8.*1A1F 0FA5 B211 04ED B072), which you can google)
if grep -q WARNING "$tmperr"; then grep "7312 F47D 9436 FBF8 C3F8 0CF2 7482 4796 6F36 6AE9" "$tmperr"; fi
# You can also do the more paranoid verification of running the
# script lines shown in the tag (the lines starting with a `$`),
# and verifying that you get the same output as shown:
sumsSig=$(perl -we 'local $/; $a=<STDIN>; $a=~ s{.*\n\$[^\n]*sha256sum\n}{}s; print $a' < "$tmpout")
sumsLocal=$(git ls-files -z | xargs -0 --no-run-if-empty -s 129023 -n 129023 sha256sum)
if ! diff <(echo "$sumsSig") <(echo "$sumsLocal"); then echo "check failure"; false; fi
make -f targets.mk
set +x
echo -n 'Ready. '
cat <<'END'
Run:
PATH=/opt/chj/chjize/bin:$PATH
chjize -h
for the list of available targets (the same as shown
[below](#current-list-of-targets)). To e.g. only install my software
into `/opt/chj` (and dependences, see `targets.mk` or the
[graph](#graph-of-target-dependencies) below), run:
chjize chj
Unlike Ansible, this caches which actions were already done, and is
thus more efficient when asking the same target repeatedly (even
across runs). If an action for some reason really should be re-run,
unlink the file with the same name as the target.
The `moduser` target, or `mod-user` script, sets up bash startup files
so that `PATH` is set so that `chjize` is found automatically.
Chjize may work with parallel builds (`chjize -j2` and higher
numbers), since we're now using wrappers around `apt-get` and `apt`
(in [bin/](bin/)) that use waiting locks.
END