File: patch.apply

package info (click to toggle)
xfree86-2 3.3.6-2
  • links: PTS
  • area: main
  • in suites: potato
  • size: 14,804 kB
  • ctags: 2
  • sloc: sh: 890; makefile: 63
file content (24 lines) | stat: -rw-r--r-- 527 bytes parent folder | download | duplicates (4)
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 $SOURCE_TREE
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 | (cd $SOURCE_TREE;patch -p1) > $stampfile.log;then
			echo "done."
			touch $stampfile
		else
			echo "failed!"
			exit 1
		fi
	else
		echo "Patch $f already applied!"
	fi
done