-
Notifications
You must be signed in to change notification settings - Fork 1
/
rebuild-ppa.sh
executable file
·40 lines (39 loc) · 1.28 KB
/
rebuild-ppa.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
#°/bin/sh
BN="$(basename "$0")"
D="$(dirname "$0")"
D="$(cd "${D}" && pwd)"
"${D}/init-gpg.sh"
for ppa in "${D}/debs/"*/*; do
ARCHITECTTURE="$(basename "${ppa}")"
OS="$(basename "$(dirname "${ppa}")")"
UPDATE_THIS_PPA=
if [ ! -e "${ppa}/lxc.public.gpg" ]; then
UPDATE_THIS_PPA=y
elif [ -n "$(find "${ppa}" -newer "${ppa}/lxc.public.gpg")" ]; then
UPDATE_THIS_PPA=y
fi
test -n "${UPDATE_THIS_PPA}" && {
(
cd "${ppa}"
dpkg-scanpackages . >Packages
{
AFR="APT::FTPArchive::Release::"
echo "${AFR}Origin \"lxc-ubuntu\";"
echo "${AFR}Label \"lxc-ubuntu\";"
echo "${AFR}Suite \"${OS}\";"
echo "${AFR}Codename \"${OS}\";"
echo "${AFR}Architectures \"${ARCHITECTURE}\";"
#echo "${AFR}Components \".\";"
echo "${AFR}Description \"Precompiled packages for our LXC containers\";"
} >"Release.tmp"
apt-ftparchive -c "Release.tmp" release "." >"./Release"
rm -f "Release.tmp"
rm -f "Release.gpg"
gpg --homedir "${D}/gpg" -abs --digest-algo SHA256 -u "$(cat "${D}/gpg/keyid")" -o "Release.gpg" "Release"
rm -f "InRelease"
gpg --homedir "${D}/gpg" -abs --digest-algo SHA256 -u "$(cat "${D}/gpg/keyid")" --clearsign -o "InRelease" "Release"
cp "${D}/gpg/lxc.public.asc" .
cp "${D}/gpg/lxc.public.gpg" .
)
}
done