File: patch.unapply

package info (click to toggle)
bottlerocket 0.05b3-6
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 288 kB
  • ctags: 66
  • sloc: ansic: 1,371; sh: 221; makefile: 112; tcl: 92
file content (24 lines) | stat: -rw-r--r-- 526 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh
. debian/scripts/vars
mkdir -p $STAMP_DIR/patches/
for f in `find debian/patches -type f|sort -r`;do
	stampfile=$STAMP_DIR/patches/`basename $f`
	if [ -e $stampfile ];then
		echo -n "Reversing patch $f"
		case "$f" in
			*.gz)         cmd=zcat;;
			*.bz)         cmd=bzcat;;
			*.bz2)        cmd=bz2cat;;
			*)            cmd=cat;;
		esac
		if $cmd $f | patch -R -p1 > $stampfile.log;then
			echo " successful."
			rm $stampfile
		else
			echo " failed!"
			exit 1
		fi
	else
		echo "Patch $f not applied!"
	fi
done