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 ! -x /usr/bin/apt-ftparchive; then
60 echo "$0: /usr/bin/apt-ftparchive missing. Install apt-utils"
64 # gpg -a -d -o Release.gpg Release
66 architectures="i386 amd64"
68 if test "$DEBIAN_DIST"; then
69 for d in $DEBIAN_DIST; do
70 DISTRIBUTIONS="$DISTRIBUTIONS debian/$d"
73 if test "$UBUNTU_DIST"; then
74 for d in $UBUNTU_DIST; do
75 DISTRIBUTIONS="$DISTRIBUTIONS ubuntu/$d"
79 # All distributions we know of
80 ALLD="ubuntu/lucid ubuntu/natty ubuntu/oneiric ubuntu/precise ubuntu/quantal ubuntu/raring ubuntu/saucy ubuntu/trusty ubuntu/utopic ubuntu/vivid ubuntu/wily ubuntu/xenial ubuntu/yakkety debian/jessie debian/wheezy debian/squeeze debian/lenny"
82 if test -z "$DISTRIBUTIONS"; then
85 for d in $DISTRIBUTIONS; do
88 if test "$d" = "$y"; then
93 echo "No such distro $d"
99 echo "DISTRIBUTIONS=$DISTRIBUTIONS"
100 for vdist in $DISTRIBUTIONS ; do
101 dist=`basename $vdist`
103 if test -n "${suffix}"; then
104 fdist="${fdist}-${suffix}"
106 vendor=`dirname $vdist`
107 ftpdir=/home/ftp/pub/$vendor
108 if test ! -d $ftpdir; then
109 echo "$ftpdir does not exist"
114 # Uncomment to clean the .db (cache)
120 for section in main restricted; do
122 d=pool/dists/$fdist/$section
125 # Remove invalid symlinks (source, i386, amd64,..)
127 if test -L "$l"; then
128 if test ! -f "$l"; then
133 # Make symlinks from the regular FTP archive
135 for pdir in /home/ftp/pub/*; do
137 if test -f $pdir/.htaccess -a $section != "main"; then
140 if test ! -f $pdir/.htaccess -a $section = "main"; then
144 distdir=$pdir/$vendor/$dist
145 if test -d $distdir; then
146 for f in $distdir/*.dsc $distdir/*.gz; do
147 test -f $f && ln -sf $f $d/source
149 for arch in $architectures; do
151 for f in $pdir/.htaccess \
152 $distdir/*_${arch}.* \
165 if $has_packages; then
166 if test -z "$sections"; then
169 sections="$sections $section"
171 for arch in $architectures; do
172 d=dists/$fdist/$section/binary-$arch
174 echo "Archive: $fdist" >$d/Release
175 echo "Component: $section" >>$d/Release
176 echo 'Origin: Index Data' >>$d/Release
177 echo "Architecture: $arch" >>$d/Release
179 d=dists/$fdist/$section/source
181 echo "Archive: $fdist" >$d/Release
182 echo "Component: $section" >>$d/Release
183 echo 'Origin: Index Data' >>$d/Release
184 echo 'Architecture: source' >>$d/Release
187 if test -n "$sections"; then
188 F=apt-ftparchive.conf
189 sed "s/@dist@/$fdist/g" <${confdir}/${F}.in | \
190 sed "s/@architectures@/${architectures}/g" | \
191 sed "s/@sections@/${sections}/g" > $F
192 apt-ftparchive generate apt-ftparchive.conf 2>&1
193 r=dists/$fdist/Release
194 rm -f $r # Move Release file away while calling using release
195 apt-ftparchive -c $F release dists/$fdist >tmp_Release
197 sed -e 's/^Suite:/NotAutomatic: yes\nButAutomaticUpgrades: yes\nSuite:/g' <tmp_Release >$r
202 gpg --sign -u "Index Data" -ba -o ${r}.gpg $r