8 Usage: update-archive.sh [OPTIONS]
19 while test $# -gt 0; do
21 -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
45 if test ! -f ${confdir}/apt-ftparchive.conf.in; then
46 echo "$0: ${condir}/apt-ftparchive.conf.in not found"
49 if test ! -f ${confdir}/apt-release.conf.in; then
50 echo "$0: ${condir}/apt-release.conf.in not found"
54 if test ! -x /usr/bin/apt-ftparchive; then
55 echo "$0: /usr/bin/apt-ftparchive missing. Install apt-utils"
59 # gpg -a -d -o Release.gpg Release
61 architectures="i386 amd64"
63 if test "$DEBIAN_DIST"; then
64 for d in $DEBIAN_DIST; do
65 DISTRIBUTIONS="$DISTRIBUTIONS debian/$d"
68 if test "$UBUNTU_DIST"; then
69 for d in $UBUNTU_DIST; do
70 DISTRIBUTIONS="$DISTRIBUTIONS ubuntu/$d"
74 # All distributions we know of
75 ALLD="ubuntu/lucid ubuntu/natty ubuntu/oneiric ubuntu/precise ubuntu/quantal ubuntu/raring ubuntu/saucy ubuntu/trusty debian/jessie debian/wheezy debian/squeeze debian/lenny"
77 if test -z "$DISTRIBUTIONS"; then
80 for d in $DISTRIBUTIONS; do
83 if test "$d" = "$y"; then
88 echo "No such distro $d"
94 echo "DISTRIBUTIONS=$DISTRIBUTIONS"
95 for vdist in $DISTRIBUTIONS ; do
96 dist=`basename $vdist`
97 vendor=`dirname $vdist`
98 ftpdir=/home/ftp/pub/$vendor
99 if test ! -d $ftpdir; then
100 echo "$ftpdir does not exist"
104 test -d tmp || mkdir tmp
105 # Uncomment to clean the .db (cache)
111 for section in main restricted; do
113 d=pool/dists/$dist/$section
114 if test ! -d $d; then mkdir -p $d; fi
116 # Remove invalid symlinks (source, i386, amd64,..)
118 if test -L "$l"; then
119 if test ! -f "$l"; then
124 # Make symlinks from the regular FTP archive
126 for pdir in /home/ftp/pub/*; do
128 if test -f $pdir/.htaccess -a $section != "main"; then
131 if test ! -f $pdir/.htaccess -a $section = "main"; then
135 distdir=$pdir/$vendor/$dist
136 if test -d $distdir; then
137 for f in $distdir/*.dsc $distdir/*.gz; do
138 test -f $f && ln -sf $f $d/source
140 for arch in $architectures; do
142 for f in $pdir/.htaccess \
143 $distdir/*_${arch}.* \
156 if $has_packages; then
157 if test -z "$sections"; then
160 sections="$sections $section"
162 for arch in $architectures; do
163 d=dists/$dist/$section/binary-$arch
164 if test ! -d $d; then mkdir -p $d; fi
165 echo "Archive: $dist" >$d/Release
166 echo "Component: $section" >>$d/Release
167 echo 'Origin: Indexdata' >>$d/Release
168 echo "Architecture: $arch" >>$d/Release
170 d=dists/$dist/$section/source
171 if test ! -d $d; then mkdir -p $d; fi
172 echo "Archive: $dist" >$d/Release
173 echo "Component: $section" >>$d/Release
174 echo 'Origin: Indexdata' >>$d/Release
175 echo 'Architecture: source' >>$d/Release
179 echo "Begin Generate $dist: $sections"
180 F=apt-ftparchive.conf
181 sed "s/@dist@/$dist/g" <${confdir}/${F}.in | \
182 sed "s/@architectures@/${architectures}/g" | \
183 sed "s/@sections@/${sections}/g" > $F
184 # Don't know if clean is needed!
185 # apt-ftparchive clean apt-ftparchive.conf
186 apt-ftparchive generate apt-ftparchive.conf 2>&1
187 echo "Done generate $dist: $sections"
190 r=dists/$dist/Release
192 sed "s/@dist@/$dist/g" <${confdir}/${F}.in | \
193 sed "s/@architectures@/${architectures}/g" | \
194 sed "s/@sections@/${sections}/g" > $F
195 # Move Release file away while calling using release
197 apt-ftparchive -c $F release dists/$dist >tmp_Release
202 r=dists/$dist/Release
204 gpg --sign -u "Index Data" -ba -o ${r}.gpg dists/$dist/Release