void-packages/srcpkgs/mate-utils/patches/cross-strftime.patch
Đoàn Trần Công Danh 765e304c4b srcpkgs/m*: 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

47 lines
1.4 KiB
Diff

--- a/configure.ac 2015-09-01 15:56:57.000000000 +0200
+++ b/configure.ac 2015-10-23 15:09:25.486599085 +0200
@@ -277,24 +277,32 @@ AS_IF([test "x$have_ipv6" = "xyes"],
]
)
-
-dnl strftime extension checks
-AC_TRY_RUN([
+dnl ***************************************
+dnl *** Check for strftime() extensions ***
+dnl ***************************************
+AC_CACHE_CHECK([Define if strftime supports %E and %O modifiers], ac_cv_strftime_extensions,
+ [AC_TRY_RUN([
+ #include <string.h>
#include <time.h>
- int main (void) {
- char buf[100];
- struct tm tm = {0};
- tm.tm_year = 99;
- if (strftime(buf, 100, "%EY", &tm) == 4 && strcmp (buf, "1999")==0)
+ int
+ main (int argc, char **argv)
+ {
+ struct tm tm;
+ char buffer[16];
+ tm.tm_year = 81;
+ if (strftime (buffer, 16, "%EY", &tm) == 4 && strcmp (buffer, "1981") == 0)
return 0;
return 1;
}
],
- [
- AC_DEFINE([HAVE_STRFTIME_EXTENSION], [1],
- [Define if strftime supports %E and %O modifiers.])
- ]
+ ac_cv_strftime_extensions=yes,
+ ac_cv_strftime_extensions=no,
+ [AC_MSG_ERROR([cross-compiling, preset ac_cv_strftime_extensions=yes/no])]
+ )]
)
+if test x"$ac_cv_strftime_extensions" = x"yes"; then
+ AC_DEFINE([HAVE_STRFTIME_EXTENSION], 1, [Define if strftime supports %E and %O modifiers.])
+fi
dnl mate-search-tool checks
withval=""