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 architectures="i386 amd64"
19 if [ "$1" == "" ]; then
20 DISTRIBUTIONS="ubuntu/lucid ubuntu/natty ubuntu/oneiric ubuntu/precise ubuntu/quantal debian/wheezy debian/squeeze debian/lenny"
25 for vdist in $DISTRIBUTIONS ; do
26 dist=`basename $vdist`
27 vendor=`dirname $vdist`
28 ftpdir=/home/ftp/pub/$vendor
29 if test ! -d $ftpdir; then
30 echo "$ftpdir does not exist"
34 test -d tmp || mkdir tmp
35 # Uncomment to clean the .db (cache)
39 for section in main restricted; do
41 d=pool/dists/$dist/$section
42 if test ! -d $d; then mkdir -p $d; fi
44 # Remove invalid symlinks (source, i386, amd64,..)
47 if test ! -f "$l"; then
52 # Make symlinks from the regular FTP archive
54 for pdir in /home/ftp/pub/*; do
56 if test -f $pdir/.htaccess -a $section != "main"; then
59 if test ! -f $pdir/.htaccess -a $section = "main"; then
63 distdir=$pdir/$vendor/$dist
64 if test -d $distdir; then
65 for f in $distdir/*.dsc $distdir/*.gz; do
66 test -f $f && ln -sf $f $d/source
68 for arch in $architectures; do
70 for f in $pdir/.htaccess \
71 $distdir/*_${arch}.* \
82 # ${confdir}/symclean.sh $d
85 if $has_packages; then
86 if test -z "$sections"; then
89 sections="$sections $section"
91 for arch in $architectures; do
92 d=dists/$dist/$section/binary-$arch
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: $arch" >>$d/Release
99 d=dists/$dist/$section/source
100 if test ! -d $d; then mkdir -p $d; fi
101 echo "Archive: $dist" >$d/Release
102 echo "Component: $section" >>$d/Release
103 echo 'Origin: Indexdata' >>$d/Release
104 echo 'Architecture: source' >>$d/Release
108 echo "Begin Generate $dist: $sections"
109 F=apt-ftparchive.conf
110 sed "s/@dist@/$dist/g" <${confdir}/${F}.in | \
111 sed "s/@architectures@/${architectures}/g" | \
112 sed "s/@sections@/${sections}/g" > $F
113 # Don't know if clean is needed!
114 # apt-ftparchive clean apt-ftparchive.conf
115 apt-ftparchive generate apt-ftparchive.conf
116 echo "Done generate $dist: $sections"
119 r=dists/$dist/Release
121 sed "s/@dist@/$dist/g" <${confdir}/${F}.in | \
122 sed "s/@architectures@/${architectures}/g" | \
123 sed "s/@sections@/${sections}/g" > $F
124 # Move Release file away while calling using release
126 apt-ftparchive -c $F release dists/$dist >tmp_Release
131 r=dists/$dist/Release
133 gpg --sign -u "Index Data" -ba -o ${r}.gpg dists/$dist/Release