-
Notifications
You must be signed in to change notification settings - Fork 3
/
update-deb-archive
executable file
·48 lines (36 loc) · 1.2 KB
/
update-deb-archive
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
#!/bin/bash
#
# Update the `Contents`, `Release`, and `Release.gpg` files for one or
# more distros. Used to maintain the deb archive at www.linuxcnc.org.
#
set -e
set -x
INFRASTRUCTURE=$HOME/infrastructure
function update_distribution() {
DIST=$1
RELEASE=dists/$DIST/Release
RELEASE_GPG=${RELEASE}.gpg
INRELEASE=dists/$DIST/InRelease
for D in dists/$DIST/*/binary-{i386,amd64,armhf,arm64}; do
pushd $D
for i in $(find ../binary-all -name '*.deb') ; do
ln -svf $i .
done
popd
done
rm -f $(find dists/$DIST/ -name 'Contents*')
apt-ftparchive -o APT::FTPArchive::AlwaysStat=True generate $INFRASTRUCTURE/repositories/generate-$DIST.conf
rm -f $RELEASE
apt-ftparchive -o APT::FTPArchive::AlwaysStat=True -c $INFRASTRUCTURE/repositories/release-$DIST.conf release dists/$DIST/ > $RELEASE
rm -f $RELEASE_GPG
gpg --default-key=EMC --detach-sign --armor -o ${RELEASE_GPG} ${RELEASE}
rm -f $INRELEASE
gpg --default-key=EMC --clear-sign --digest-algo SHA256 --armor -o ${INRELEASE} ${RELEASE}
}
if [ -z "$*" ]; then
echo "usage: update DIST [DIST...]"
exit 1
fi
for D in "$@"; do
update_distribution $D
done