tzwrapper.cc: fixed use of iterator after erase
[barry.git] / maintainer / make-apt.sh
blob139423c41e5e0a5b3a22747a2fe2864b11da28a7
1 #!/bin/bash
3 set -e
5 if [ -z "$1" ] ; then
6 echo "Usage: make-apt.sh builddir"
7 exit 1
8 fi
10 BUILDDIR="$1"
12 if [ -z "$GPG_AGENT_INFO" ] ; then
13 echo "Press enter to continue if gpg-agent is running,"
14 echo "Otherwise, run:"
15 echo
16 echo " eval \$(gpg-agent --daemon --default-cache-ttl n)"
17 echo
18 echo "to preserve your sanity. n is in seconds, and default"
19 echo "from gpg-agent is 600 seconds."
20 read
23 # Work inside the build directory, so it doesn't show up in Packages pathnames
24 cd $BUILDDIR
26 # Build Packages and Contents, for all distros, per arch
27 for arch in i386 amd64 ; do
28 for dir in $(find dists -name "binary-$arch" -type d -print) ; do
29 apt-ftparchive packages $dir | tee $dir/Packages | gzip -9c > $dir/Packages.gz
30 apt-ftparchive contents $dir | gzip -9c > $dir/../../Contents-$arch.gz
31 done
32 done
34 # Build signed Release files for all debian distros
35 # Make sure you have gpg-agent running, or this will be a pain...
36 cd dists
37 for dir in * ; do
38 if [ -f ../../apt/$dir.conf ] ; then
39 (cd $dir && apt-ftparchive -c ../../../apt/$dir.conf release . > Release)
40 gpg --use-agent --default-key B6C2250E --armor \
41 --output $dir/Release.gpg \
42 --detach-sign $dir/Release
43 else
44 echo "WARNING: conf file for $dir not found under apt/"
46 done