-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
make-index.sh
executable file
·50 lines (42 loc) · 1.3 KB
/
make-index.sh
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
#!/bin/bash
#
# Verify package signatures and generate index.
#
# VERSION :0.3.0
# DATE :2017-10-15
# AUTHOR :Viktor Szépe <viktor@szepe.net>
# LICENSE :The MIT License (MIT)
# URL :https://github.com/szepeviktor/debian-server-tools
# BASH-VERSION :4.2+
# DEPENDS :apt-get install dpkg-sig reprepro
# DEPENDS :/usr/local/bin/index_gen.py
set -e
# Before this script
cat <<"EOF"
# Sign it with the packaging GPG key
GPG_TTY="$(tty)" dpkg-sig --sign "builder" -k "451A4FBA" /opt/results/*.deb
cd debian/
# REMOVE: reprepro remove bullseye PACKAGE
reprepro includedeb bullseye /opt/results/*.deb
EOF
(
cd debian/
# Verify packages updated in the last month
DEBS="$(find . -type f -mtime -30 -name "*.deb")"
while read -r PKG; do
echo -n "${PKG} ... "
dpkg-sig --verify "$PKG" | grep --color "^GOODSIG"
done <<<"$DEBS"
# Generate index
../../package/index_gen.py >index.html
sed -e 's|<body>|<head><title>Modern webserver solutions</title></head><body><h1>Modern webserver solutions</h1><h2>Freshly packaged and backported Debian Linux packages</h2>|' \
-i index.html
echo "Index generated."
)
git status -s
# Commit to git and parent repo
cat <<"EOF"
git add --all; git commit
git push
cd ../; git add repo
EOF