From cafcd5d4368e57f162a641ed3f4835ecb5a6d391 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Thu, 28 Feb 2002 14:09:04 +0000 Subject: Initial revision --- deb-update.sh | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100755 deb-update.sh (limited to 'deb-update.sh') diff --git a/deb-update.sh b/deb-update.sh new file mode 100755 index 0000000..55c5d44 --- /dev/null +++ b/deb-update.sh @@ -0,0 +1,104 @@ +#! /bin/sh + +if [ $# -eq 0 ]; then + echo "Usage: $(basename $0) AREAS BRANCHES DISTS ARCHS" + echo " (multiple values must \"be quoted\" to look as one on the commandline)" + echo "Example: $(basename $0) misc \"default unstable source\" 'potato sid' i386" + exit 1 +fi + +BASE="/debian/local" + +AREAS=$1 + +BRANCHES="$2" + +DISTS="$3" + +ARCHS="$4" + +for ARCH in $ARCHS; do + for DIST in $DISTS; do + for BRANCH in $BRANCHES; do + for AREA in $AREAS; do + case $BRANCH in + default) + DIR="dists/$DIST/$AREA/binary-$ARCH" + ECHODIR="dists/DIST/AREA/binary-ARCH" + ;; + source) + DIR="dists/$DIST/$AREA/source" + ECHODIR="dists/DIST/AREA/source" + ;; + *-source) + DIR="dists/$DIST/$BRANCH/$AREA/source" + ECHODIR="dists/DIST/BRANCH/AREA/source" + ;; + *) + DIR="dists/$DIST/$BRANCH/$AREA/binary-$ARCH" + ECHODIR="dists/DIST/BRANCH/AREA/binary-ARCH" + ;; + esac + echo "Checking directories..." + if [ -d $BASE/$DIR ]; then + echo " $ECHODIR looks fine." + else + echo "$0: $BASE/$DIR is not a directory" + echo + echo "AREA must exist." + echo + echo "BRANCH can be either default or source, special ones like unstable or private," + echo "or space-delimited combinations. Default is \"default\"." + echo + echo "DIST can be \"potato\", \"potato woody\" or similar. Default is \"stable\"" + echo + echo "ARCH is \"i386\" or whatever you have. Default is \"i386\"." + echo + echo "The corresponding directory must exist: $BASE/$ECHODIR." + exit 1 + fi + done + done + done +done +for ARCH in $ARCHS; do + for DIST in $DISTS; do + for BRANCH in $BRANCHES; do + for AREA in $AREAS; do + SRC="" + case $BRANCH in + default) + DIR="dists/$DIST/$AREA/binary-$ARCH" + ;; + source) + DIR="dists/$DIST/$AREA/source" + SRC="1" + ;; + *-source) + DIR="dists/$DIST/$AREA/$BRANCH/source" + SRC="1" + ;; + *) + DIR="dists/$DIST/$BRANCH/$AREA/binary-$ARCH" + ;; + esac + echo "Scanning $DIR..." + if [ $SRC ]; then + (cd $BASE; \ + dpkg-scansources $DIR /dev/null > $DIR/Sources; \ + touch $DIR/Sources; \ + rm -f $DIR/Sources.gz; \ + gzip -c $DIR/Sources > $DIR/Sources.gz; \ + ) + else + (cd $BASE; \ + dpkg-scanpackages $DIR /dev/null > $DIR/Packages; \ + touch $DIR/Packages; \ + rm -f $DIR/Packages.gz; \ + gzip -c $DIR/Packages > $DIR/Packages.gz; \ + ) + fi + done + done + done +done -- cgit v1.2.3