File: patch.apply

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-- 496 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); do
	stampfile=$STAMP_DIR/patches/`basename $f`
	if [ ! -e $stampfile ]; then
		echo -n "Applying patch $f..."
		case "$f" in
			*.gz)		cmd=zcat;;
			*.bz) 	cmd=bzcat;;
			*.bz2)	cmd=bz2cat;;
			*)		cmd=cat;;
		esac
		if $cmd $f | patch -p1 > $stampfile.log;then
			echo "done."
			touch $stampfile
		else
			echo "failed!"
			exit 1
		fi
	else
		echo "Patch $f already applied!"
	fi
done