8 Usage: update-archive.sh [OPTIONS]
12 [--suffix=dist-suffix]
23 while test $# -gt 0; do
25 -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
55 if test ! -f ${confdir}/apt-ftparchive.conf.in; then
56 echo "$0: ${condir}/apt-ftparchive.conf.in not found"
59 if test ! -f ${confdir}/apt-release.conf.in; then
60 echo "$0: ${condir}/apt-release.conf.in not found"
64 if test ! -x /usr/bin/apt-ftparchive; then
65 echo "$0: /usr/bin/apt-ftparchive missing. Install apt-utils"
69 # gpg -a -d -o Release.gpg Release
71 architectures="i386 amd64"
73 if test "$DEBIAN_DIST"; then
74 for d in $DEBIAN_DIST; do
75 DISTRIBUTIONS="$DISTRIBUTIONS debian/$d"
78 if test "$UBUNTU_DIST"; then
79 for d in $UBUNTU_DIST; do
80 DISTRIBUTIONS="$DISTRIBUTIONS ubuntu/$d"
84 # All distributions we know of
85 ALLD="ubuntu/lucid ubuntu/natty ubuntu/oneiric ubuntu/precise ubuntu/quantal ubuntu/raring ubuntu/saucy ubuntu/trusty ubuntu/utopic debian/jessie debian/wheezy debian/squeeze debian/lenny"
87 if test -z "$DISTRIBUTIONS"; then
90 for d in $DISTRIBUTIONS; do
93 if test "$d" = "$y"; then
98 echo "No such distro $d"
104 echo "DISTRIBUTIONS=$DISTRIBUTIONS"
105 for vdist in $DISTRIBUTIONS ; do
106 dist=`basename $vdist`
108 if test -n "${suffix}"; then
109 fdist="${fdist}-${suffix}"
111 vendor=`dirname $vdist`
112 ftpdir=/home/ftp/pub/$vendor
113 if test ! -d $ftpdir; then
114 echo "$ftpdir does not exist"
118 test -d tmp || mkdir tmp
119 # Uncomment to clean the .db (cache)
125 for section in main restricted; do
127 d=pool/dists/$fdist/$section
128 if test ! -d $d; then mkdir -p $d; fi
130 # Remove invalid symlinks (source, i386, amd64,..)
132 if test -L "$l"; then
133 if test ! -f "$l"; then
138 # Make symlinks from the regular FTP archive
140 for pdir in /home/ftp/pub/*; do
142 if test -f $pdir/.htaccess -a $section != "main"; then
145 if test ! -f $pdir/.htaccess -a $section = "main"; then
149 distdir=$pdir/$vendor/$dist
150 if test -d $distdir; then
151 for f in $distdir/*.dsc $distdir/*.gz; do
152 test -f $f && ln -sf $f $d/source
154 for arch in $architectures; do
156 for f in $pdir/.htaccess \
157 $distdir/*_${arch}.* \
170 if $has_packages; then
171 if test -z "$sections"; then
174 sections="$sections $section"
176 for arch in $architectures; do
177 d=dists/$fdist/$section/binary-$arch
178 if test ! -d $d; then mkdir -p $d; fi
179 echo "Archive: $fdist" >$d/Release
180 echo "Component: $section" >>$d/Release
181 echo 'Origin: Indexdata' >>$d/Release
182 echo "Architecture: $arch" >>$d/Release
184 d=dists/$fdist/$section/source
185 if test ! -d $d; then mkdir -p $d; fi
186 echo "Archive: $fdist" >$d/Release
187 echo "Component: $section" >>$d/Release
188 echo 'Origin: Indexdata' >>$d/Release
189 echo 'Architecture: source' >>$d/Release
193 echo "Begin Generate $fdist: $sections"
194 F=apt-ftparchive.conf
195 sed "s/@dist@/$fdist/g" <${confdir}/${F}.in | \
196 sed "s/@architectures@/${architectures}/g" | \
197 sed "s/@sections@/${sections}/g" > $F
198 # Don't know if clean is needed!
199 # apt-ftparchive clean apt-ftparchive.conf
200 apt-ftparchive generate apt-ftparchive.conf 2>&1
201 echo "Done generate $fdist: $sections"
204 r=dists/$fdist/Release
206 sed "s/@dist@/$fdist/g" <${confdir}/${F}.in | \
207 sed "s/@architectures@/${architectures}/g" | \
208 sed "s/@sections@/${sections}/g" > $F
209 # Move Release file away while calling using release
211 apt-ftparchive -c $F release dists/$fdist >tmp_Release
213 sed -e 's/^Suite:/NotAutomatic: yes\nButAutomaticUpgrades: yes\nSuite:/g' <tmp_Release >$r
221 gpg --sign -u "Index Data" -ba -o ${r}.gpg $r