File: patch.apply

package info (click to toggle)
gkrellm 0.7.5-3
  • links: PTS
  • area: main
  • in suites: potato
  • size: 208 kB
  • ctags: 12
  • sloc: sh: 163; makefile: 140
file content (26 lines) | stat: -rw-r--r-- 564 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh
. debian/scripts/vars
. debian/scripts/lib
mkdir -p $STAMP_DIR/patches $SOURCE_DIR/$TAR_DIR

for d in $PATCH_DIR $ADD_PATCH_DIR;do
	mkdir -p $STAMP_DIR/log/$d
        if [ -d $d ]; then
     		for f in `(cd $d;find -type f ! -name 'chk-*')|sort`;do
			stampfile=$STAMP_DIR/patches/$f
			log=$STAMP_DIR/log/$d/$f
			if [ ! -e $stampfile ];then
				START $d/$f
				if file2cat $d/$f | (cd $SOURCE_DIR/$TAR_DIR;patch -p1) > $log;then
					OK
					touch $stampfile
				else
					FAILED
					exit 1
				fi
			else
				ALREADY_DONE $d/$f
			fi
		done
	fi
done