X-Git-Url: http://git.indexdata.com/?p=git-tools-moved-to-github.git;a=blobdiff_plain;f=update-archive%2Fupdate-archive.sh;h=ba479ff0f8789fc93144e9cc662594aa09917c22;hp=6e678e6bcd6dfb4bd5c512dcf6391d8a4bd534bd;hb=ea81219434763b72d3f80541ea081c47de6ff429;hpb=b28f8a1b012580d47066cdb304c3ac708d947c8e diff --git a/update-archive/update-archive.sh b/update-archive/update-archive.sh index 6e678e6..ba479ff 100755 --- a/update-archive/update-archive.sh +++ b/update-archive/update-archive.sh @@ -1,7 +1,53 @@ #!/bin/sh -# $Id: update-archive.sh,v 1.13 2008-10-20 10:24:15 adam Exp $ -if test ! -f apt-ftparchive.conf.in; then - echo "$0: apt-ftparchive.conf.in must be located in current directory" +D0=`dirname $0` +confdir=`cd $D0; pwd` + +usage() +{ + cat <&1 +fi + +if test ! -f ${confdir}/apt-ftparchive.conf.in; then + echo "$0: ${condir}/apt-ftparchive.conf.in not found" + exit 1 +fi +if test ! -f ${confdir}/apt-release.conf.in; then + echo "$0: ${condir}/apt-release.conf.in not found" exit 1 fi @@ -11,12 +57,42 @@ if test ! -x /usr/bin/apt-ftparchive; then fi # gpg -a -d -o Release.gpg Release + +architectures="i386 amd64" + +if test "$DEBIAN_DIST"; then + for d in $DEBIAN_DIST; do + DISTRIBUTIONS="$DISTRIBUTIONS debian/$d" + done +fi +if test "$UBUNTU_DIST"; then + for d in $UBUNTU_DIST; do + DISTRIBUTIONS="$DISTRIBUTIONS ubuntu/$d" + done +fi -confdir=`pwd` +# All distributions we know of +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" -architectures="i386 amd64" +if test -z "$DISTRIBUTIONS"; then + DISTRIBUTIONS=$ALLD +else + for d in $DISTRIBUTIONS; do + bad=true + for y in $ALLD; do + if test "$d" = "$y"; then + bad=false + fi + done + if $bad; then + echo "No such distro $d" + exit 1 + fi + done +fi -for vdist in ubuntu/gutsy ubuntu/hardy ubuntu/intrepid ubuntu/jaunty ubuntu/karmic debian/squeeze debian/lenny debian/etch; do +echo "DISTRIBUTIONS=$DISTRIBUTIONS" +for vdist in $DISTRIBUTIONS ; do dist=`basename $vdist` vendor=`dirname $vdist` ftpdir=/home/ftp/pub/$vendor @@ -27,7 +103,9 @@ for vdist in ubuntu/gutsy ubuntu/hardy ubuntu/intrepid ubuntu/jaunty ubuntu/karm cd $ftpdir test -d tmp || mkdir tmp # Uncomment to clean the .db (cache) - # rm tmp/* + if $clear; then + rm tmp/* + fi sections="" for section in main restricted; do @@ -56,8 +134,9 @@ for vdist in ubuntu/gutsy ubuntu/hardy ubuntu/intrepid ubuntu/jaunty ubuntu/karm if $use; then distdir=$pdir/$vendor/$dist if test -d $distdir; then - ln -sf $distdir/*.dsc $d/source - ln -sf $distdir/*.gz $d/source + for f in $distdir/*.dsc $distdir/*.gz; do + test -f $f && ln -sf $f $d/source + done for arch in $architectures; do mkdir -p $d/${arch} for f in $pdir/.htaccess \ @@ -72,7 +151,6 @@ for vdist in ubuntu/gutsy ubuntu/hardy ubuntu/intrepid ubuntu/jaunty ubuntu/karm fi fi done - # ${confdir}/symclean.sh $d rm -f $d/Release if $has_packages; then @@ -105,7 +183,7 @@ for vdist in ubuntu/gutsy ubuntu/hardy ubuntu/intrepid ubuntu/jaunty ubuntu/karm sed "s/@sections@/${sections}/g" > $F # Don't know if clean is needed! # apt-ftparchive clean apt-ftparchive.conf - apt-ftparchive generate apt-ftparchive.conf + apt-ftparchive generate apt-ftparchive.conf 2>&1 echo "Done generate $dist: $sections" # release