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 if [ "$1" == "" ]; then
19 DISTRIBUTIONS="ubuntu/lucid ubuntu/natty ubuntu/oneiric ubuntu/precise ubuntu/quantal debian/wheezy debian/squeeze debian/lenny"
24 for vdist in $DISTRIBUTIONS ; do
25 dist=`basename $vdist`
26 vendor=`dirname $vdist`
27 ftpdir=/home/ftp/pub/$vendor
28 if test ! -d $ftpdir; then
29 echo "$ftpdir does not exist"
33 test -d tmp || mkdir tmp
34 # Uncomment to clean the .db (cache)
38 for section in main restricted; do
40 d=pool/dists/$dist/$section
41 if test ! -d $d; then mkdir -p $d; fi
43 # Remove invalid symlinks (source, i386, amd64,..)
46 if test ! -f "$l"; then
51 # Make symlinks from the regular FTP archive
53 for pdir in /home/ftp/pub/*; do
55 if test -f $pdir/.htaccess -a $section != "main"; then
58 if test ! -f $pdir/.htaccess -a $section = "main"; then
62 distdir=$pdir/$vendor/$dist
63 if test -d $distdir; then
64 for f in $distdir/*.dsc $distdir/*.gz; do
65 test -f $f && ln -sf $f $d/source
67 for arch in $architectures; do
69 for f in $pdir/.htaccess \
70 $distdir/*_${arch}.* \
81 # ${confdir}/symclean.sh $d
84 if $has_packages; then
85 if test -z "$sections"; then
88 sections="$sections $section"
90 for arch in $architectures; do
91 d=dists/$dist/$section/binary-$arch
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: $arch" >>$d/Release
98 d=dists/$dist/$section/source
99 if test ! -d $d; then mkdir -p $d; fi
100 echo "Archive: $dist" >$d/Release
101 echo "Component: $section" >>$d/Release
102 echo 'Origin: Indexdata' >>$d/Release
103 echo 'Architecture: source' >>$d/Release
107 echo "Begin Generate $dist: $sections"
108 F=apt-ftparchive.conf
109 sed "s/@dist@/$dist/g" <${confdir}/${F}.in | \
110 sed "s/@architectures@/${architectures}/g" | \
111 sed "s/@sections@/${sections}/g" > $F
112 # Don't know if clean is needed!
113 # apt-ftparchive clean apt-ftparchive.conf
114 apt-ftparchive generate apt-ftparchive.conf
115 echo "Done generate $dist: $sections"
118 r=dists/$dist/Release
120 sed "s/@dist@/$dist/g" <${confdir}/${F}.in | \
121 sed "s/@architectures@/${architectures}/g" | \
122 sed "s/@sections@/${sections}/g" > $F
123 # Move Release file away while calling using release
125 apt-ftparchive -c $F release dists/$dist >tmp_Release
130 r=dists/$dist/Release
132 gpg --sign -u "Index Data" -ba -o ${r}.gpg dists/$dist/Release