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 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}.* \
154 # ${confdir}/symclean.sh $d
157 if $has_packages; then
158 if test -z "$sections"; then
161 sections="$sections $section"
163 for arch in $architectures; do
164 d=dists/$dist/$section/binary-$arch
165 if test ! -d $d; then mkdir -p $d; fi
166 echo "Archive: $dist" >$d/Release
167 echo "Component: $section" >>$d/Release
168 echo 'Origin: Indexdata' >>$d/Release
169 echo "Architecture: $arch" >>$d/Release
171 d=dists/$dist/$section/source
172 if test ! -d $d; then mkdir -p $d; fi
173 echo "Archive: $dist" >$d/Release
174 echo "Component: $section" >>$d/Release
175 echo 'Origin: Indexdata' >>$d/Release
176 echo 'Architecture: source' >>$d/Release
180 echo "Begin Generate $dist: $sections"
181 F=apt-ftparchive.conf
182 sed "s/@dist@/$dist/g" <${confdir}/${F}.in | \
183 sed "s/@architectures@/${architectures}/g" | \
184 sed "s/@sections@/${sections}/g" > $F
185 # Don't know if clean is needed!
186 # apt-ftparchive clean apt-ftparchive.conf
187 apt-ftparchive generate apt-ftparchive.conf 2>&1
188 echo "Done generate $dist: $sections"
191 r=dists/$dist/Release
193 sed "s/@dist@/$dist/g" <${confdir}/${F}.in | \
194 sed "s/@architectures@/${architectures}/g" | \
195 sed "s/@sections@/${sections}/g" > $F
196 # Move Release file away while calling using release
198 apt-ftparchive -c $F release dists/$dist >tmp_Release
203 r=dists/$dist/Release
205 gpg --sign -u "Index Data" -ba -o ${r}.gpg dists/$dist/Release