r2519 - trunk/scripts

Joshua Kwan joshk@costa.debian.org
Fri, 18 Feb 2005 07:45:01 +0100


Author: joshk
Date: 2005-02-18 07:45:00 +0100 (Fri, 18 Feb 2005)
New Revision: 2519

Added:
   trunk/scripts/key2patch.sh
Log:
a Useful Script


Added: trunk/scripts/key2patch.sh
===================================================================
--- trunk/scripts/key2patch.sh	2005-02-17 23:22:05 UTC (rev 2518)
+++ trunk/scripts/key2patch.sh	2005-02-18 06:45:00 UTC (rev 2519)
@@ -0,0 +1,42 @@
+#!/bin/sh -e
+# Takes a BK diff key in $1, for the kernel series in $2, creates a patch
+# annotation for it, and saves it in the file pointed to by $3.
+
+if [ $# -lt 3 ]; then
+	echo "Passed $# arguments, need 3:"
+	echo "$0 [KEY] [SERIES] [TARGET]"
+	exit 1
+fi
+
+KEY=$1
+MAJOR=$2
+TARGET=$3
+TEMP="$(tempfile)"
+DATE="$(date +%Y-%m-%d)"
+
+case "$MAJOR" in
+	2.5 | 2.6 | 2.4) ;;
+	*) echo "Invalid major $MAJOR. Valid entries are 2.4, 2.5, and 2.6."
+	   echo "If I'm wildly out of date, update me."
+	   exit 1
+	;;
+esac
+
+if ! wget -q -O "$TEMP" http://linux.bkbits.net:8080/linux-$MAJOR/gnupatch@$KEY; then
+	echo "Could not retrieve key $KEY." >&2
+	rm -f $TEMP
+	exit 1
+fi
+
+cat >$TARGET <<EOF
+# origin: bk
+# key: $KEY (linux-$MAJOR)
+# description:
+# inclusion:
+# revision date: $DATE
+
+EOF
+
+cat >>$TARGET < $TEMP
+
+rm -f $TEMP


Property changes on: trunk/scripts/key2patch.sh
___________________________________________________________________
Name: svn:executable
   + *