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/karmic ubuntu/lucid ubuntu/maverick \
19 ubuntu/natty ubuntu/oneiric ubuntu/precise \
20 debian/wheezy debian/squeeze debian/lenny \
22 dist=`basename $vdist`
23 vendor=`dirname $vdist`
24 ftpdir=/home/ftp/pub/$vendor
25 if test ! -d $ftpdir; then
26 echo "$ftpdir does not exist"
30 test -d tmp || mkdir tmp
31 # Uncomment to clean the .db (cache)
35 for section in main restricted; do
37 d=pool/dists/$dist/$section
38 if test ! -d $d; then mkdir -p $d; fi
40 # Remove invalid symlinks (source, i386, amd64,..)
43 if test ! -f "$l"; then
48 # Make symlinks from the regular FTP archive
50 for pdir in /home/ftp/pub/*; do
52 if test -f $pdir/.htaccess -a $section != "main"; then
55 if test ! -f $pdir/.htaccess -a $section = "main"; then
59 distdir=$pdir/$vendor/$dist
60 if test -d $distdir; then
61 for f in $distdir/*.dsc $distdir/*.gz; do
62 test -f $f && ln -sf $f $d/source
64 for arch in $architectures; do
66 for f in $pdir/.htaccess \
67 $distdir/*_${arch}.* \
78 # ${confdir}/symclean.sh $d
81 if $has_packages; then
82 if test -z "$sections"; then
85 sections="$sections $section"
87 for arch in $architectures; do
88 d=dists/$dist/$section/binary-$arch
89 if test ! -d $d; then mkdir -p $d; fi
90 echo "Archive: $dist" >$d/Release
91 echo "Component: $section" >>$d/Release
92 echo 'Origin: Indexdata' >>$d/Release
93 echo "Architecture: $arch" >>$d/Release
95 d=dists/$dist/$section/source
96 if test ! -d $d; then mkdir -p $d; fi
97 echo "Archive: $dist" >$d/Release
98 echo "Component: $section" >>$d/Release
99 echo 'Origin: Indexdata' >>$d/Release
100 echo 'Architecture: source' >>$d/Release
104 echo "Begin Generate $dist: $sections"
105 F=apt-ftparchive.conf
106 sed "s/@dist@/$dist/g" <${confdir}/${F}.in | \
107 sed "s/@architectures@/${architectures}/g" | \
108 sed "s/@sections@/${sections}/g" > $F
109 # Don't know if clean is needed!
110 # apt-ftparchive clean apt-ftparchive.conf
111 apt-ftparchive generate apt-ftparchive.conf
112 echo "Done generate $dist: $sections"
115 r=dists/$dist/Release
117 sed "s/@dist@/$dist/g" <${confdir}/${F}.in | \
118 sed "s/@architectures@/${architectures}/g" | \
119 sed "s/@sections@/${sections}/g" > $F
120 # Move Release file away while calling using release
122 apt-ftparchive -c $F release dists/$dist >tmp_Release
127 r=dists/$dist/Release
129 gpg --sign -u "Index Data" -ba -o ${r}.gpg dists/$dist/Release