5 if test ! -f ${confdir}/apt-ftparchive.conf.in; then
6 echo "$0: ${condir}/apt-ftparchive.conf.in not found"
9 if test ! -f ${confdir}/apt-release.conf.in; then
10 echo "$0: ${condir}/apt-release.conf.in not found"
14 if test ! -x /usr/bin/apt-ftparchive; then
15 echo "$0: /usr/bin/apt-ftparchive missing. Install apt-utils"
19 # gpg -a -d -o Release.gpg Release
22 architectures="i386 amd64"
24 if [ "$1" == "" ]; then
25 DISTRIBUTIONS="ubuntu/lucid ubuntu/natty ubuntu/oneiric ubuntu/precise ubuntu/quantal debian/wheezy debian/squeeze debian/lenny"
30 for vdist in $DISTRIBUTIONS ; do
31 dist=`basename $vdist`
32 vendor=`dirname $vdist`
33 ftpdir=/home/ftp/pub/$vendor
34 if test ! -d $ftpdir; then
35 echo "$ftpdir does not exist"
39 test -d tmp || mkdir tmp
40 # Uncomment to clean the .db (cache)
44 for section in main restricted; do
46 d=pool/dists/$dist/$section
47 if test ! -d $d; then mkdir -p $d; fi
49 # Remove invalid symlinks (source, i386, amd64,..)
52 if test ! -f "$l"; then
57 # Make symlinks from the regular FTP archive
59 for pdir in /home/ftp/pub/*; do
61 if test -f $pdir/.htaccess -a $section != "main"; then
64 if test ! -f $pdir/.htaccess -a $section = "main"; then
68 distdir=$pdir/$vendor/$dist
69 if test -d $distdir; then
70 for f in $distdir/*.dsc $distdir/*.gz; do
71 test -f $f && ln -sf $f $d/source
73 for arch in $architectures; do
75 for f in $pdir/.htaccess \
76 $distdir/*_${arch}.* \
87 # ${confdir}/symclean.sh $d
90 if $has_packages; then
91 if test -z "$sections"; then
94 sections="$sections $section"
96 for arch in $architectures; do
97 d=dists/$dist/$section/binary-$arch
98 if test ! -d $d; then mkdir -p $d; fi
99 echo "Archive: $dist" >$d/Release
100 echo "Component: $section" >>$d/Release
101 echo 'Origin: Indexdata' >>$d/Release
102 echo "Architecture: $arch" >>$d/Release
104 d=dists/$dist/$section/source
105 if test ! -d $d; then mkdir -p $d; fi
106 echo "Archive: $dist" >$d/Release
107 echo "Component: $section" >>$d/Release
108 echo 'Origin: Indexdata' >>$d/Release
109 echo 'Architecture: source' >>$d/Release
113 echo "Begin Generate $dist: $sections"
114 F=apt-ftparchive.conf
115 sed "s/@dist@/$dist/g" <${confdir}/${F}.in | \
116 sed "s/@architectures@/${architectures}/g" | \
117 sed "s/@sections@/${sections}/g" > $F
118 # Don't know if clean is needed!
119 # apt-ftparchive clean apt-ftparchive.conf
120 apt-ftparchive generate apt-ftparchive.conf 2>&1
121 echo "Done generate $dist: $sections"
124 r=dists/$dist/Release
126 sed "s/@dist@/$dist/g" <${confdir}/${F}.in | \
127 sed "s/@architectures@/${architectures}/g" | \
128 sed "s/@sections@/${sections}/g" > $F
129 # Move Release file away while calling using release
131 apt-ftparchive -c $F release dists/$dist >tmp_Release
136 r=dists/$dist/Release
138 gpg --sign -u "Index Data" -ba -o ${r}.gpg dists/$dist/Release