void-packages/srcpkgs/chkrootkit/patches/fcntl.patch
Đoàn Trần Công Danh c987560802 srcpkgs/c*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

30 lines
656 B
Diff

--- a/chklastlog.c
+++ b/chklastlog.c
@@ -41,6 +41,7 @@ int main () { return 0; }
#include <stdlib.h>
#endif
#include <sys/stat.h>
+#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <signal.h>
--- a/chkproc.c
+++ b/chkproc.c
@@ -62,6 +62,7 @@ int main (){ return 0; }
#include <string.h>
#include <errno.h>
#include <sys/types.h>
+#include <fcntl.h>
#include <dirent.h>
#include <ctype.h>
#include <stdlib.h>
--- a/chkwtmp.c
+++ b/chkwtmp.c
@@ -25,6 +25,7 @@ int main () { return 0; }
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
+#include <fcntl.h>
#include <string.h>
#include <utmp.h>
#include <time.h>