2 if test ! -f apt-ftparchive.conf.in; then
3 echo "$0: apt-ftparchive.conf.in must be located in current directory"
7 if test ! -x /usr/bin/apt-ftparchive; then
8 echo "$0: /usr/bin/apt-ftparchive missing. Install apt-utils"
12 # gpg -a -d -o Release.gpg Release
16 architectures="i386 amd64"
18 for vdist in ubuntu/gutsy ubuntu/hardy ubuntu/intrepid ubuntu/jaunty ubuntu/karmic debian/squeeze debian/lenny debian/etch; do
19 dist=`basename $vdist`
20 vendor=`dirname $vdist`
21 ftpdir=/home/ftp/pub/$vendor
22 if test ! -d $ftpdir; then
23 echo "$ftpdir does not exist"
27 test -d tmp || mkdir tmp
28 # Uncomment to clean the .db (cache)
32 for section in main restricted; do
34 d=pool/dists/$dist/$section
35 if test ! -d $d; then mkdir -p $d; fi
37 # Remove invalid symlinks (source, i386, amd64,..)
40 if test ! -f "$l"; then
45 # Make symlinks from the regular FTP archive
47 for pdir in /home/ftp/pub/*; do
49 if test -f $pdir/.htaccess -a $section != "main"; then
52 if test ! -f $pdir/.htaccess -a $section = "main"; then
56 distdir=$pdir/$vendor/$dist
57 if test -d $distdir; then
58 ln -sf $distdir/*.dsc $d/source
59 ln -sf $distdir/*.gz $d/source
60 for arch in $architectures; do
62 for f in $pdir/.htaccess \
63 $distdir/*_${arch}.* \
74 # ${confdir}/symclean.sh $d
77 if $has_packages; then
78 if test -z "$sections"; then
81 sections="$sections $section"
83 for arch in $architectures; do
84 d=dists/$dist/$section/binary-$arch
85 if test ! -d $d; then mkdir -p $d; fi
86 echo "Archive: $dist" >$d/Release
87 echo "Component: $section" >>$d/Release
88 echo 'Origin: Indexdata' >>$d/Release
89 echo "Architecture: $arch" >>$d/Release
91 d=dists/$dist/$section/source
92 if test ! -d $d; then mkdir -p $d; fi
93 echo "Archive: $dist" >$d/Release
94 echo "Component: $section" >>$d/Release
95 echo 'Origin: Indexdata' >>$d/Release
96 echo 'Architecture: source' >>$d/Release
100 echo "Begin Generate $dist: $sections"
101 F=apt-ftparchive.conf
102 sed "s/@dist@/$dist/g" <${confdir}/${F}.in | \
103 sed "s/@architectures@/${architectures}/g" | \
104 sed "s/@sections@/${sections}/g" > $F
105 # Don't know if clean is needed!
106 # apt-ftparchive clean apt-ftparchive.conf
107 apt-ftparchive generate apt-ftparchive.conf
108 echo "Done generate $dist: $sections"
111 r=dists/$dist/Release
113 sed "s/@dist@/$dist/g" <${confdir}/${F}.in | \
114 sed "s/@architectures@/${architectures}/g" | \
115 sed "s/@sections@/${sections}/g" > $F
116 # Move Release file away while calling using release
118 apt-ftparchive -c $F release dists/$dist >tmp_Release
123 r=dists/$dist/Release
125 gpg --sign -u "Index Data" -ba -o ${r}.gpg dists/$dist/Release