2 # $Id: update-archive.sh,v 1.13 2008-10-20 10:24:15 adam Exp $
3 if test ! -f apt-ftparchive.conf.in; then
4 echo "$0: apt-ftparchive.conf.in must be located in current directory"
8 if test ! -x /usr/bin/apt-ftparchive; then
9 echo "$0: /usr/bin/apt-ftparchive missing. Install apt-utils"
13 # gpg -a -d -o Release.gpg Release
17 architectures="i386 amd64"
19 for vdist in ubuntu/gutsy ubuntu/hardy ubuntu/intrepid ubuntu/jaunty ubuntu/karmic debian/squeeze debian/lenny debian/etch; do
20 dist=`basename $vdist`
21 vendor=`dirname $vdist`
22 ftpdir=/home/ftp/pub/$vendor
23 if test ! -d $ftpdir; then
24 echo "$ftpdir does not exist"
28 test -d tmp || mkdir tmp
29 # Uncomment to clean the .db (cache)
34 if test ! -d $d; then mkdir -p $d; fi
36 # Remove invalid symlinks (source, i386, amd64,..)
44 # Make symlinks from the regular FTP archive
45 ln -sf /home/ftp/pub/*/$vendor/$dist/*.dsc $d/source
46 ln -sf /home/ftp/pub/*/$vendor/$dist/*.gz $d/source
47 for arch in $architectures; do
49 for f in /home/ftp/pub/*/$vendor/$dist/*_${arch}.* \
50 /home/ftp/pub/*/$vendor/$dist/*_all.*; do
55 #ln -sf /home/ftp/pub/*/$vendor/$dist/*_${arch}.* $d/${arch}
56 #ln -sf /home/ftp/pub/*/$vendor/$dist/*_all.* $d/${arch}
59 # ${confdir}/symclean.sh $d
61 for arch in $architectures; do
62 d=dists/$dist/main/binary-$arch
63 if test ! -d $d; then mkdir -p $d; fi
64 echo "Archive: $dist" >$d/Release
65 echo 'Component: main' >>$d/Release
66 echo 'Origin: Indexdata' >>$d/Release
67 echo "Architecture: $arch" >>$d/Release
70 d=dists/$dist/main/source
71 if test ! -d $d; then mkdir -p $d; fi
72 echo "Archive: $dist" >$d/Release
73 echo 'Component: main' >>$d/Release
74 echo 'Origin: Indexdata' >>$d/Release
75 echo 'Architecture: source' >>$d/Release
78 echo "Begin Generate $dist"
80 sed "s/@dist@/$dist/g" <${confdir}/${F}.in |sed "s/@architectures@/${architectures}/g" > $F
81 # Don't know if clean is needed!
82 # apt-ftparchive clean apt-ftparchive.conf
83 apt-ftparchive generate apt-ftparchive.conf
84 echo "Done generate $dist"
89 sed "s/@dist@/$dist/g" <${confdir}/${F}.in | sed "s/@architectures@/${architectures}/g" >$F
90 # Move Release file away while calling using release
92 apt-ftparchive -c $F release dists/$dist >tmp_Release
99 gpg --sign -u "Index Data" -ba -o ${r}.gpg dists/$dist/Release