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)
33 for section in main restricted; do
35 d=pool/dists/$dist/$section
36 if test ! -d $d; then mkdir -p $d; fi
38 # Remove invalid symlinks (source, i386, amd64,..)
41 if test ! -f "$l"; then
46 # Make symlinks from the regular FTP archive
48 for pdir in /home/ftp/pub/*; do
50 if test -f $pdir/.htaccess -a $section != "main"; then
53 if test ! -f $pdir/.htaccess -a $section = "main"; then
57 distdir=$pdir/$vendor/$dist
58 if test -d $distdir; then
59 ln -sf $distdir/*.dsc $d/source
60 ln -sf $distdir/*.gz $d/source
61 for arch in $architectures; do
63 for f in $pdir/.htaccess \
64 $distdir/*_${arch}.* \
75 # ${confdir}/symclean.sh $d
78 if $has_packages; then
79 if test -z "$sections"; then
82 sections="$sections $section"
84 for arch in $architectures; do
85 d=dists/$dist/$section/binary-$arch
86 if test ! -d $d; then mkdir -p $d; fi
87 echo "Archive: $dist" >$d/Release
88 echo "Component: $section" >>$d/Release
89 echo 'Origin: Indexdata' >>$d/Release
90 echo "Architecture: $arch" >>$d/Release
92 d=dists/$dist/$section/source
93 if test ! -d $d; then mkdir -p $d; fi
94 echo "Archive: $dist" >$d/Release
95 echo "Component: $section" >>$d/Release
96 echo 'Origin: Indexdata' >>$d/Release
97 echo 'Architecture: source' >>$d/Release
101 echo "Begin Generate $dist: $sections"
102 F=apt-ftparchive.conf
103 sed "s/@dist@/$dist/g" <${confdir}/${F}.in | \
104 sed "s/@architectures@/${architectures}/g" | \
105 sed "s/@sections@/${sections}/g" > $F
106 # Don't know if clean is needed!
107 # apt-ftparchive clean apt-ftparchive.conf
108 apt-ftparchive generate apt-ftparchive.conf
109 echo "Done generate $dist: $sections"
112 r=dists/$dist/Release
114 sed "s/@dist@/$dist/g" <${confdir}/${F}.in | \
115 sed "s/@architectures@/${architectures}/g" | \
116 sed "s/@sections@/${sections}/g" > $F
117 # Move Release file away while calling using release
119 apt-ftparchive -c $F release dists/$dist >tmp_Release
124 r=dists/$dist/Release
126 gpg --sign -u "Index Data" -ba -o ${r}.gpg dists/$dist/Release