X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=update-archive%2Fupdate-archive.sh;h=24e6ce61d1d3514055aa87ac9149ea19cf3cde1b;hb=44d624c773f6268b4e4f3a21ea5da5a4654a22f0;hp=1cec276ec6d663c579790284cac71f7051f6454c;hpb=45708c48adcb3e2b9b9f74732b166d05b440b6b8;p=git-tools-moved-to-github.git diff --git a/update-archive/update-archive.sh b/update-archive/update-archive.sh index 1cec276..24e6ce6 100755 --- a/update-archive/update-archive.sh +++ b/update-archive/update-archive.sh @@ -1,6 +1,53 @@ #!/bin/sh -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 @@ -10,17 +57,41 @@ if test ! -x /usr/bin/apt-ftparchive; then fi # gpg -a -d -o Release.gpg Release + +architectures="i386 amd64" -confdir=`pwd` +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 -architectures="i386 amd64" +# All distributions we know of +ALLD="ubuntu/lucid ubuntu/natty ubuntu/oneiric ubuntu/precise ubuntu/quantal ubuntu/raring ubuntu/saucy debian/jessie debian/wheezy debian/squeeze debian/lenny" -if [ "$1" == "" ]; then - DISTRIBUTIONS="ubuntu/lucid ubuntu/natty ubuntu/oneiric ubuntu/precise ubuntu/quantal debian/wheezy debian/squeeze debian/lenny" +if test -z "$DISTRIBUTIONS"; then + DISTRIBUTIONS=$ALLD else - DISTRIBUTIONS=$1 + 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 +echo "DISTRIBUTIONS=$DISTRIBUTIONS" for vdist in $DISTRIBUTIONS ; do dist=`basename $vdist` vendor=`dirname $vdist` @@ -32,7 +103,9 @@ for vdist in $DISTRIBUTIONS ; do 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 @@ -78,7 +151,9 @@ for vdist in $DISTRIBUTIONS ; do fi fi done - # ${confdir}/symclean.sh $d + for arch in $architectures; do + ${confdir}/symclean.sh $d/${arch} + done rm -f $d/Release if $has_packages; then @@ -111,7 +186,7 @@ for vdist in $DISTRIBUTIONS ; do 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