File: apply-patch.awk

package info (click to toggle)
clutter-sharp 1.0.0~alpha3~git20090817.r1.349dba6-8
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 4,104 kB
  • ctags: 2,193
  • sloc: xml: 23,456; cs: 9,946; sh: 3,393; perl: 1,213; makefile: 270; awk: 50; sed: 13
file content (21 lines) | stat: -rw-r--r-- 488 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
	if ($0 ~ /default void ConnectDefaultHandlers/) {
		method_found = 1
	} else if (method_found == 1 && $0 ~ /{/) {
		in_method = 1
		if (mode == 1) {
			print
			print "// BEGIN PATCH"
			system ("monodis patch.dll | awk -v mode=0 -f " self)
			print "// END PATCH"
		}
	} else if (in_method == 1 && $0 ~ /}/) {
		in_method = 0
	}

	if (in_method == 1 && method_found == 1) {
		method_found = 0
	} else if ((in_method == 1 && mode == 0) || (in_method == 0 && mode == 1)) {
		print
	}
}