r2550 - trunk/kernel-2.4/powerpc/branch/kernel-patch-powerpc-2.4.27/debian

Sven Luther luther@costa.debian.org
Thu, 24 Feb 2005 14:43:28 +0100


Author: luther
Date: 2005-02-24 14:43:28 +0100 (Thu, 24 Feb 2005)
New Revision: 2550

Added:
   trunk/kernel-2.4/powerpc/branch/kernel-patch-powerpc-2.4.27/debian/apply.m4
   trunk/kernel-2.4/powerpc/branch/kernel-patch-powerpc-2.4.27/debian/unpatch.m4
Log:
Readded apply and unpatch scripts.


Copied: trunk/kernel-2.4/powerpc/branch/kernel-patch-powerpc-2.4.27/debian/apply.m4 (from rev 2523, trunk/kernel-2.4/powerpc/kernel-patch-powerpc-2.4.27-2.4.27/powerpc/apply/0powerpc)
===================================================================
--- trunk/kernel-2.4/powerpc/kernel-patch-powerpc-2.4.27-2.4.27/powerpc/apply/0powerpc	2005-02-19 02:22:51 UTC (rev 2523)
+++ trunk/kernel-2.4/powerpc/branch/kernel-patch-powerpc-2.4.27/debian/apply.m4	2005-02-24 13:43:28 UTC (rev 2550)
@@ -0,0 +1,42 @@
+#! /bin/sh
+#
+# (C) 1998 Manoj Srivastava & Eric Delaunay.
+
+set -e
+
+ARCHITECTURE=`dpkg --print-installation-architecture`
+PATCHNAME=M4SUBARCH
+PATCHFILE=debian-M4SUBARCH.diff.gz
+if [ -n "$PATCH_DIR" -a -f "$PATCH_DIR/$PATCHFILE" ]; then
+  PATCHDIR="$PATCH_DIR"
+else
+  PATCHDIR=/usr/src/kernel-patches/$ARCHITECTURE
+fi
+
+if ! test -d kernel -a -d Documentation ; then
+    echo "Not in kernel top level directory. Exiting" >&2
+    exit 1
+fi
+
+if test -f debian/APPLIED_${ARCHITECTURE}_$PATCHNAME ; then
+   exit 0		# patch already applied
+fi
+
+VERSION=$(grep ^VERSION Makefile 2>/dev/null | \
+                 sed -e 's/[^0-9]*\([0-9]*\)/\1/')
+PATCHLEVEL=$(grep ^PATCHLEVEL Makefile 2>/dev/null | \
+                    sed -e 's/[^0-9]*\([0-9]*\)/\1/')
+SUBLEVEL=$(grep ^SUBLEVEL Makefile 2>/dev/null | \
+                  sed -e 's/[^0-9]*\([0-9B]*\)/\1/')
+
+PATCH_VERSION=$(patch -v | head -1 | sed -e 's/[^0-9\.]//g')
+PATCH_OPTIONS="-l -s -p1"
+
+rm -f include/asm
+zcat $PATCHDIR/$PATCHFILE | patch $PATCH_OPTIONS
+
+# Work around bug in kernel-package
+echo stamp > stamp-patch
+
+mkdir -p debian && echo stamp >> debian/APPLIED_${ARCHITECTURE}_$PATCHNAME
+exit 0

Copied: trunk/kernel-2.4/powerpc/branch/kernel-patch-powerpc-2.4.27/debian/unpatch.m4 (from rev 2523, trunk/kernel-2.4/powerpc/kernel-patch-powerpc-2.4.27-2.4.27/powerpc/unpatch/0powerpc)
===================================================================
--- trunk/kernel-2.4/powerpc/kernel-patch-powerpc-2.4.27-2.4.27/powerpc/unpatch/0powerpc	2005-02-19 02:22:51 UTC (rev 2523)
+++ trunk/kernel-2.4/powerpc/branch/kernel-patch-powerpc-2.4.27/debian/unpatch.m4	2005-02-24 13:43:28 UTC (rev 2550)
@@ -0,0 +1,44 @@
+#! /bin/sh
+#
+# (C) 1998 Manoj Srivastava & Eric Delaunay.
+
+set -e
+
+ARCHITECTURE=`dpkg --print-installation-architecture`
+PATCHNAME=M4SUBARCH
+PATCHFILE=debian-M4SUBARCH.diff.gz
+if [ -n "$PATCH_DIR" -a -f "$PATCH_DIR/$PATCHFILE" ]; then
+  PATCHDIR="$PATCH_DIR"
+else
+  PATCHDIR=/usr/src/kernel-patches/$ARCHITECTURE
+fi
+
+if ! test -d kernel -a -d Documentation ; then
+    echo "Not in kernel top level directory. Exiting" >&2
+    exit 1
+fi
+
+if ! test -f debian/APPLIED_${ARCHITECTURE}_$PATCHNAME ; then
+   exit 0		# no need to remove a non existent patch
+fi
+
+VERSION=$(grep ^VERSION Makefile 2>/dev/null | \
+                 sed -e 's/[^0-9]*\([0-9]*\)/\1/')
+PATCHLEVEL=$(grep ^PATCHLEVEL Makefile 2>/dev/null | \
+                    sed -e 's/[^0-9]*\([0-9]*\)/\1/')
+SUBLEVEL=$(grep ^SUBLEVEL Makefile 2>/dev/null | \
+                  sed -e 's/[^0-9]*\([0-9]*\)/\1/')
+
+PATCH_VERSION=$(patch -v | head -1 | sed -e 's/[^0-9\.]//g')
+
+PATCH_OPTIONS="-l -s -p1"
+
+echo $PATCHDIR/$PATCHFILE
+
+zcat $PATCHDIR/$PATCHFILE | patch -R $PATCH_OPTIONS
+
+# Work around bug in kernel-package
+rm -f stamp-patch
+
+rm -f debian/APPLIED_${ARCHITECTURE}_$PATCHNAME
+exit 0