Look for .in files in same directory as update-archive.sh
[git-tools-moved-to-github.git] / update-archive / update-archive.sh
index 7b74e8f..5705cdd 100755 (executable)
@@ -1,6 +1,13 @@
 #!/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`
+
+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,11 +18,16 @@ fi
 
 # gpg -a -d -o Release.gpg Release
 
-confdir=`pwd`
 
 architectures="i386 amd64"
 
-for vdist in ubuntu/karmic ubuntu/lucid ubuntu/maverick ubuntu/natty ubuntu/oneiric debian/wheezy debian/squeeze debian/lenny debian/etch; do
+if [ "$1" == "" ]; then 
+       DISTRIBUTIONS="ubuntu/lucid ubuntu/natty ubuntu/oneiric ubuntu/precise ubuntu/quantal debian/wheezy debian/squeeze debian/lenny"
+else
+       DISTRIBUTIONS=$1
+fi
+
+for vdist in $DISTRIBUTIONS ; do
        dist=`basename $vdist`
        vendor=`dirname $vdist`
        ftpdir=/home/ftp/pub/$vendor