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; do
21 dist=`basename $vdist`
22 vendor=`dirname $vdist`
23 ftpdir=/home/ftp/pub/$vendor
24 if test ! -d $ftpdir; then
25 echo "$ftpdir does not exist"
29 test -d tmp || mkdir tmp
30 # Uncomment to clean the .db (cache)
34 for section in main restricted; do
36 d=pool/dists/$dist/$section
37 if test ! -d $d; then mkdir -p $d; fi
39 # Remove invalid symlinks (source, i386, amd64,..)
42 if test ! -f "$l"; then
47 # Make symlinks from the regular FTP archive
49 for pdir in /home/ftp/pub/*; do
51 if test -f $pdir/.htaccess -a $section != "main"; then
54 if test ! -f $pdir/.htaccess -a $section = "main"; then
58 distdir=$pdir/$vendor/$dist
59 if test -d $distdir; then
60 for f in $distdir/*.dsc $distdir/*.gz; do
61 test -f $f && ln -sf $f $d/source
63 for arch in $architectures; do
65 for f in $pdir/.htaccess \
66 $distdir/*_${arch}.* \
77 # ${confdir}/symclean.sh $d
80 if $has_packages; then
81 if test -z "$sections"; then
84 sections="$sections $section"
86 for arch in $architectures; do
87 d=dists/$dist/$section/binary-$arch
88 if test ! -d $d; then mkdir -p $d; fi
89 echo "Archive: $dist" >$d/Release
90 echo "Component: $section" >>$d/Release
91 echo 'Origin: Indexdata' >>$d/Release
92 echo "Architecture: $arch" >>$d/Release
94 d=dists/$dist/$section/source
95 if test ! -d $d; then mkdir -p $d; fi
96 echo "Archive: $dist" >$d/Release
97 echo "Component: $section" >>$d/Release
98 echo 'Origin: Indexdata' >>$d/Release
99 echo 'Architecture: source' >>$d/Release
103 echo "Begin Generate $dist: $sections"
104 F=apt-ftparchive.conf
105 sed "s/@dist@/$dist/g" <${confdir}/${F}.in | \
106 sed "s/@architectures@/${architectures}/g" | \
107 sed "s/@sections@/${sections}/g" > $F
108 # Don't know if clean is needed!
109 # apt-ftparchive clean apt-ftparchive.conf
110 apt-ftparchive generate apt-ftparchive.conf
111 echo "Done generate $dist: $sections"
114 r=dists/$dist/Release
116 sed "s/@dist@/$dist/g" <${confdir}/${F}.in | \
117 sed "s/@architectures@/${architectures}/g" | \
118 sed "s/@sections@/${sections}/g" > $F
119 # Move Release file away while calling using release
121 apt-ftparchive -c $F release dists/$dist >tmp_Release
126 r=dists/$dist/Release
128 gpg --sign -u "Index Data" -ba -o ${r}.gpg dists/$dist/Release