summaryrefslogtreecommitdiff
path: root/deb-update.sh
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2002-02-28 14:09:04 +0000
committerJonas Smedegaard <dr@jones.dk>2002-02-28 14:09:04 +0000
commitcafcd5d4368e57f162a641ed3f4835ecb5a6d391 (patch)
tree56166fbf16289d8b388cf0f1f9b51e28c3c4bdf9 /deb-update.sh
Initial revision
Diffstat (limited to 'deb-update.sh')
-rwxr-xr-xdeb-update.sh104
1 files changed, 104 insertions, 0 deletions
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