diff --git a/patch/PKGBUILD b/patch/PKGBUILD new file mode 100644 index 00000000..31c7c309 --- /dev/null +++ b/patch/PKGBUILD @@ -0,0 +1,56 @@ +# Maintainer: Alexey Pavlov + +pkgname=patch +pkgver=2.7.1 +pkgrel=1 +pkgdesc="A utility to apply patch files to original sources" +arch=('i686' 'x86_64') +url="http://www.gnu.org/software/patch/patch.html" +license=('GPL') +groups=('base-devel') +depends=('glibc') +makedepends=('ed') +optdepends=('ed: for patch -e functionality') +source=(ftp://ftp.gnu.org/gnu/${pkgname}/${pkgname}-${pkgver}.tar.xz{,.sig} + patch-2.7.1-initialize-data-structures-early-enough.patch + msys2-patch-2.7.1.patch + msys2-patch-manifest.patch) +md5sums=('e9ae5393426d3ad783a300a338c09b72' + 'SKIP' + 'dc6367a7cd49933d4006c246789e98da' + '1e6764d4ab3c40e05509ca7bb239328c' + '418a3715d6fff5900744f6d5fa60234a') + +prepare() { + cd ${srcdir}/${pkgname}-${pkgver} + + # Fix segfault on non-numeric strip-count + # (also segfaults on nonexistent directory passed to -d) + # http://savannah.gnu.org/bugs/?37500 + patch -Np1 -i \ + $srcdir/patch-2.7.1-initialize-data-structures-early-enough.patch + + patch -Np1 -i $srcdir/msys2-patch-2.7.1.patch + patch -Np2 -i $srcdir/msys2-patch-manifest.patch + + autoreconf -fi +} + +build() { + cd ${srcdir}/${pkgname}-${pkgver} + + ./configure --build=${CHOST} \ + --prefix=/usr \ + ac_cv_func_setmode_dos=yes + make +} + +check() { + cd ${srcdir}/${pkgname}-${pkgver} + make check +} + +package() { + cd ${srcdir}/${pkgname}-${pkgver} + make DESTDIR=$pkgdir install +} diff --git a/patch/msys2-patch-2.7.1.patch b/patch/msys2-patch-2.7.1.patch new file mode 100644 index 00000000..56752de1 --- /dev/null +++ b/patch/msys2-patch-2.7.1.patch @@ -0,0 +1,322 @@ +diff -Naur patch-2.7.1/build-aux/ar-lib patch-2.7.1-p/build-aux/ar-lib +--- patch-2.7.1/build-aux/ar-lib 2012-04-06 15:41:12 +0400 ++++ patch-2.7.1-p/build-aux/ar-lib 2013-02-24 13:43:38 +0400 +@@ -53,7 +53,7 @@ + MINGW*) + file_conv=mingw + ;; +- CYGWIN*) ++ CYGWIN* | MSYS*) + file_conv=cygwin + ;; + *) +@@ -65,7 +65,7 @@ + mingw) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; +- cygwin) ++ cygwin | msys) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine) +diff -Naur patch-2.7.1/build-aux/config.guess patch-2.7.1-p/build-aux/config.guess +--- patch-2.7.1/build-aux/config.guess 2012-09-28 14:47:37 +0400 ++++ patch-2.7.1-p/build-aux/config.guess 2013-02-24 13:43:19 +0400 +@@ -805,6 +805,9 @@ + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; ++ i*:MSYS*:*) ++ echo ${UNAME_MACHINE}-pc-msys ++ exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; +@@ -851,6 +854,9 @@ + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; ++ amd64:MSYS*:*:* | x86_64:MSYS*:*:*) ++ echo x86_64-unknown-msys ++ exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; +diff -Naur patch-2.7.1/build-aux/config.rpath patch-2.7.1-p/build-aux/config.rpath +--- patch-2.7.1/build-aux/config.rpath 2012-08-01 06:44:13 +0400 ++++ patch-2.7.1-p/build-aux/config.rpath 2013-02-24 13:42:48 +0400 +@@ -57,7 +57,7 @@ + aix*) + wl='-Wl,' + ;; +- mingw* | cygwin* | pw32* | os2* | cegcc*) ++ mingw* | cygwin* | msys* | pw32* | os2* | cegcc*) + ;; + hpux9* | hpux10* | hpux11*) + wl='-Wl,' +@@ -149,7 +149,7 @@ + hardcode_minus_L=no + + case "$host_os" in +- cygwin* | mingw* | pw32* | cegcc*) ++ cygwin* | msys* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. +@@ -198,7 +198,7 @@ + ld_shlibs=no + fi + ;; +- cygwin* | mingw* | pw32* | cegcc*) ++ cygwin* | msys* | mingw* | pw32* | cegcc*) + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' +@@ -348,7 +348,7 @@ + ;; + bsdi[45]*) + ;; +- cygwin* | mingw* | pw32* | cegcc*) ++ cygwin* | msys* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is +@@ -537,7 +537,7 @@ + bsdi[45]*) + library_names_spec='$libname$shrext' + ;; +- cygwin* | mingw* | pw32* | cegcc*) ++ cygwin* | msys* | mingw* | pw32* | cegcc*) + shrext=.dll + library_names_spec='$libname.dll.a $libname.lib' + ;; +--- patch-2.7.1/configure 2012-09-28 20:41:27 +0400 ++++ patch-2.7.1-p/configure 2013-02-24 13:57:57 +0400 +@@ -6818,7 +6839,7 @@ + # special semantics and is distinct from /, please report it to + # . + case $host in +- *-cygwin | i370-ibm-openedition) ++ *-cygwin | *-msys | i370-ibm-openedition) + gl_cv_double_slash_root=yes ;; + *) + # Be optimistic and assume that / and // are the same when we +@@ -9454,7 +9475,7 @@ + case "$host_os" in + # Guess yes on platforms where we know the result. + *-gnu* | freebsd* | netbsd* | openbsd* \ +- | hpux* | solaris* | cygwin* | mingw*) ++ | hpux* | solaris* | cygwin* | msys* | mingw*) + ac_cv_func_malloc_0_nonnull=yes ;; + # If we don't know, assume the worst. + *) ac_cv_func_malloc_0_nonnull=no ;; +@@ -13852,7 +13873,7 @@ + # special semantics and is distinct from /, please report it to + # . + case $host in +- *-cygwin | i370-ibm-openedition) ++ *-cygwin | *-msys | i370-ibm-openedition) + gl_cv_double_slash_root=yes ;; + *) + # Be optimistic and assume that / and // are the same when we +@@ -13894,7 +13915,7 @@ + case "$host_os" in + mingw*) # on this platform, dup2 always returns 0 for success + gl_cv_func_dup2_works="guessing no" ;; +- cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0 ++ cygwin* | msys*) # on cygwin 1.5.x, dup2(1,1) returns 0 + gl_cv_func_dup2_works="guessing no" ;; + linux*) # On linux between 2008-07-27 and 2009-05-11, dup2 of a + # closed fd may yield -EBADF instead of -1 / errno=EBADF. +@@ -15094,7 +15115,7 @@ + case "$host_os" in + # Guess yes on platforms where we know the result. + *-gnu* | freebsd* | netbsd* | openbsd* \ +- | hpux* | solaris* | cygwin* | mingw*) ++ | hpux* | solaris* | cygwin* | msys* | mingw*) + ac_cv_func_malloc_0_nonnull=yes ;; + # If we don't know, assume the worst. + *) ac_cv_func_malloc_0_nonnull=no ;; +@@ -16911,7 +16932,7 @@ + case "$host_os" in + # Guess yes on platforms where we know the result. + *-gnu* | freebsd* | netbsd* | openbsd* \ +- | hpux* | solaris* | cygwin* | mingw*) ++ | hpux* | solaris* | cygwin* | msys* | mingw*) + ac_cv_func_realloc_0_nonnull=yes ;; + # If we don't know, assume the worst. + *) ac_cv_func_realloc_0_nonnull=no ;; +diff -Naur patch-2.7.1/lib/Makefile.in patch-2.7.1-p/lib/Makefile.in +--- patch-2.7.1/lib/Makefile.in 2012-09-28 20:41:31 +0400 ++++ patch-2.7.1-p/lib/Makefile.in 2013-02-24 13:57:54 +0400 +@@ -1651,7 +1651,7 @@ + case '$(host_os)' in \ + darwin[56]*) \ + need_charset_alias=true ;; \ +- darwin* | cygwin* | mingw* | pw32* | cegcc*) \ ++ darwin* | cygwin* | msys* | mingw* | pw32* | cegcc*) \ + need_charset_alias=false ;; \ + *) \ + need_charset_alias=true ;; \ +diff -Naur patch-2.7.1/lib/gnulib.mk patch-2.7.1-p/lib/gnulib.mk +--- patch-2.7.1/lib/gnulib.mk 2012-09-28 20:40:58 +0400 ++++ patch-2.7.1-p/lib/gnulib.mk 2013-02-24 13:46:08 +0400 +@@ -572,7 +572,7 @@ + case '$(host_os)' in \ + darwin[56]*) \ + need_charset_alias=true ;; \ +- darwin* | cygwin* | mingw* | pw32* | cegcc*) \ ++ darwin* | cygwin* | msys* | mingw* | pw32* | cegcc*) \ + need_charset_alias=false ;; \ + *) \ + need_charset_alias=true ;; \ +diff -Naur patch-2.7.1/m4/double-slash-root.m4 patch-2.7.1-p/m4/double-slash-root.m4 +--- patch-2.7.1/m4/double-slash-root.m4 2012-08-01 06:44:13 +0400 ++++ patch-2.7.1-p/m4/double-slash-root.m4 2013-02-24 13:47:12 +0400 +@@ -16,7 +16,7 @@ + # special semantics and is distinct from /, please report it to + # . + case $host in +- *-cygwin | i370-ibm-openedition) ++ *-cygwin | *-msys | i370-ibm-openedition) + gl_cv_double_slash_root=yes ;; + *) + # Be optimistic and assume that / and // are the same when we +diff -Naur patch-2.7.1/m4/dup2.m4 patch-2.7.1-p/m4/dup2.m4 +--- patch-2.7.1/m4/dup2.m4 2012-08-01 06:44:13 +0400 ++++ patch-2.7.1-p/m4/dup2.m4 2013-02-24 13:47:28 +0400 +@@ -46,7 +46,7 @@ + [case "$host_os" in + mingw*) # on this platform, dup2 always returns 0 for success + gl_cv_func_dup2_works="guessing no" ;; +- cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0 ++ cygwin* | msys*) # on cygwin 1.5.x, dup2(1,1) returns 0 + gl_cv_func_dup2_works="guessing no" ;; + linux*) # On linux between 2008-07-27 and 2009-05-11, dup2 of a + # closed fd may yield -EBADF instead of -1 / errno=EBADF. +diff -Naur patch-2.7.1/m4/malloc.m4 patch-2.7.1-p/m4/malloc.m4 +--- patch-2.7.1/m4/malloc.m4 2012-08-01 06:44:13 +0400 ++++ patch-2.7.1-p/m4/malloc.m4 2013-02-24 13:47:58 +0400 +@@ -30,7 +30,7 @@ + [case "$host_os" in + # Guess yes on platforms where we know the result. + *-gnu* | freebsd* | netbsd* | openbsd* \ +- | hpux* | solaris* | cygwin* | mingw*) ++ | hpux* | solaris* | cygwin* | msys* | mingw*) + ac_cv_func_malloc_0_nonnull=yes ;; + # If we don't know, assume the worst. + *) ac_cv_func_malloc_0_nonnull=no ;; +diff -Naur patch-2.7.1/m4/printf.m4 patch-2.7.1-p/m4/printf.m4 +--- patch-2.7.1/m4/printf.m4 2012-08-01 06:44:13 +0400 ++++ patch-2.7.1-p/m4/printf.m4 2013-02-24 13:48:31 +0400 +@@ -735,7 +735,7 @@ + openbsd*) gl_cv_func_printf_directive_ls="guessing no";; + irix*) gl_cv_func_printf_directive_ls="guessing no";; + solaris*) gl_cv_func_printf_directive_ls="guessing no";; +- cygwin*) gl_cv_func_printf_directive_ls="guessing no";; ++ cygwin* | msys*) gl_cv_func_printf_directive_ls="guessing no";; + beos* | haiku*) gl_cv_func_printf_directive_ls="guessing no";; + *) gl_cv_func_printf_directive_ls="guessing yes";; + esac +@@ -812,7 +812,7 @@ + [ + changequote(,)dnl + case "$host_os" in +- cygwin*) gl_cv_func_printf_flag_grouping="guessing no";; ++ cygwin* | msys*) gl_cv_func_printf_flag_grouping="guessing no";; + netbsd*) gl_cv_func_printf_flag_grouping="guessing no";; + mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";; + *) gl_cv_func_printf_flag_grouping="guessing yes";; +@@ -1464,7 +1464,7 @@ + darwin[1-6].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + darwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on Cygwin. +- cygwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; ++ cygwin* | msys*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on Solaris >= 2.6. + solaris2.[0-5] | solaris2.[0-5].*) + gl_cv_func_vsnprintf_zerosize_c99="guessing no";; +diff -Naur patch-2.7.1/m4/realloc.m4 patch-2.7.1-p/m4/realloc.m4 +--- patch-2.7.1/m4/realloc.m4 2012-08-01 06:44:13 +0400 ++++ patch-2.7.1-p/m4/realloc.m4 2013-02-24 13:48:54 +0400 +@@ -30,7 +30,7 @@ + [case "$host_os" in + # Guess yes on platforms where we know the result. + *-gnu* | freebsd* | netbsd* | openbsd* \ +- | hpux* | solaris* | cygwin* | mingw*) ++ | hpux* | solaris* | cygwin* | msys* | mingw*) + ac_cv_func_realloc_0_nonnull=yes ;; + # If we don't know, assume the worst. + *) ac_cv_func_realloc_0_nonnull=no ;; +diff -Naur patch-2.7.1/src/inp.c patch-2.7.1-p/src/inp.c +--- patch-2.7.1/src/inp.c 2012-09-19 05:07:31 +0400 ++++ patch-2.7.1-p/src/inp.c 2013-02-24 13:50:56 +0400 +@@ -231,7 +231,11 @@ + { + if (S_ISREG (instat.st_mode)) + { ++#ifdef __CYGWIN__ ++ int ifd = open (filename, O_RDONLY | (binary_transput ?: O_TEXT)); ++#else + int ifd = open (filename, O_RDONLY|binary_transput); ++#endif + size_t buffered = 0, n; + if (ifd < 0) + pfatal ("can't open file %s", quotearg (filename)); +diff -Naur patch-2.7.1/src/patch.c patch-2.7.1-p/src/patch.c +--- patch-2.7.1/src/patch.c 2012-09-28 14:43:12 +0400 ++++ patch-2.7.1-p/src/patch.c 2013-02-24 13:51:50 +0400 +@@ -798,7 +798,11 @@ + "", + " -d DIR --directory=DIR Change the working directory to DIR first.", + " --reject-format=FORMAT Create 'context' or 'unified' rejects.", ++#ifdef __CYGWIN__ ++" --binary Read data in binary mode. Writing data is always binary.", ++#else + " --binary Read and write data in binary mode.", ++#endif + " --read-only=BEHAVIOR How to handle read-only input files: 'ignore' that they", + " are read-only, 'warn' (default), or 'fail'.", + "", +@@ -1526,9 +1530,15 @@ + static FILE * + create_output_file (char const *name, int open_flags) + { ++#ifdef __CYGWIN__ ++ int fd = create_file (name, O_WRONLY | O_BINARY | open_flags, ++ instat.st_mode, true); ++ FILE *f = fdopen (fd, "wb"); ++#else + int fd = create_file (name, O_WRONLY | binary_transput | open_flags, + instat.st_mode, true); + FILE *f = fdopen (fd, binary_transput ? "wb" : "w"); ++#endif + if (! f) + pfatal ("Can't create file %s", quotearg (name)); + return f; +diff -Naur patch-2.7.1/src/pch.c patch-2.7.1-p/src/pch.c +--- patch-2.7.1/src/pch.c 2012-09-22 21:44:33 +0400 ++++ patch-2.7.1-p/src/pch.c 2013-02-24 13:54:00 +0400 +@@ -124,8 +124,10 @@ + #if HAVE_SETMODE_DOS + if (binary_transput) + { ++#ifndef __CYGWIN__ + if (isatty (fileno (pfp))) + fatal ("cannot read binary data from tty on this platform"); ++#endif + setmode (fileno (pfp), O_BINARY); + } + #endif +@@ -2393,7 +2395,11 @@ + verbosity == VERBOSE ? "" : "- ", + outname); + fflush (stdout); ++#ifdef __CYGWIN__ ++ pipefp = popen(buf, "wb"); ++#else + pipefp = popen(buf, binary_transput ? "wb" : "w"); ++#endif + if (!pipefp) + pfatal ("Can't open pipe to %s", quotearg (buf)); + } diff --git a/patch/msys2-patch-manifest.patch b/patch/msys2-patch-manifest.patch new file mode 100644 index 00000000..e5882675 --- /dev/null +++ b/patch/msys2-patch-manifest.patch @@ -0,0 +1,74 @@ +--- src/patch-2.7.1/src/Makefile.in.orig 2013-07-26 18:29:38.000000000 +0400 ++++ src/patch-2.7.1/src/Makefile.in 2013-07-27 08:49:08.000000000 +0400 +@@ -915,6 +915,7 @@ + WERROR_CFLAGS = @WERROR_CFLAGS@ + WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ + WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ ++WINDRES = windres + WINT_T_SUFFIX = @WINT_T_SUFFIX@ + YACC = @YACC@ + YFLAGS = @YFLAGS@ +@@ -1057,9 +1058,12 @@ + + clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) +-patch$(EXEEXT): $(patch_OBJECTS) $(patch_DEPENDENCIES) $(EXTRA_patch_DEPENDENCIES) ++patch.res: patch.rc patch.manifest ++ $(WINDRES) --input $< --output $@ --output-format=coff ++ ++patch$(EXEEXT): $(patch_OBJECTS) patch.res $(patch_DEPENDENCIES) $(EXTRA_patch_DEPENDENCIES) + @rm -f patch$(EXEEXT) +- $(AM_V_CCLD)$(LINK) $(patch_OBJECTS) $(patch_LDADD) $(LIBS) ++ $(AM_V_CCLD)$(LINK) $(patch_OBJECTS) patch.res $(patch_LDADD) $(LIBS) + + mostlyclean-compile: + -rm -f *.$(OBJEXT) +--- /dev/null 2013-07-12 17:17:55.297805948 +0400 ++++ src/patch-2.7.1/src/patch.manifest 2013-07-27 08:49:36.000000000 +0400 +@@ -0,0 +1,16 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +--- /dev/null 2013-07-12 17:17:55.297805948 +0400 ++++ src/patch-2.7.1/src/patch.rc 2013-07-27 08:50:20.000000000 +0400 +@@ -0,0 +1 @@ ++1 24 patch.manifest +--- src/patch-2.7.1/src/Makefile.am.orig 2012-09-14 13:15:41.000000000 +0400 ++++ src/patch-2.7.1/src/Makefile.am 2013-07-27 08:58:34.000000000 +0400 +@@ -17,6 +17,7 @@ + ## Process this file with automake to produce Makefile.in. + + AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS) ++WINDRES = windres + + bin_PROGRAMS = patch + patch_SOURCES = \ +@@ -34,9 +35,14 @@ + + AM_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib + patch_LDADD = $(LDADD) $(top_builddir)/lib/libpatch.a $(LIB_CLOCK_GETTIME) \ +- $(LIB_XATTR) ++ $(LIB_XATTR) patch.res + + if ENABLE_MERGE + patch_SOURCES += merge.c + AM_CPPFLAGS += -DENABLE_MERGE + endif ++ ++patch.res: patch.rc patch.manifest ++ $(WINDRES) --input $< --output $@ --output-format=coff ++ ++patch_DEPENDENCIES = patch.res diff --git a/patch/patch-2.7.1-initialize-data-structures-early-enough.patch b/patch/patch-2.7.1-initialize-data-structures-early-enough.patch new file mode 100644 index 00000000..046edc3d --- /dev/null +++ b/patch/patch-2.7.1-initialize-data-structures-early-enough.patch @@ -0,0 +1,81 @@ +From 291ec175812b7ba291d124e4cf2fbf9efec590c8 Mon Sep 17 00:00:00 2001 +From: Andreas Gruenbacher +Date: Thu, 4 Oct 2012 12:33:09 +0200 +Subject: [PATCH] Initialize data structures early enough + +* src/patch.c (main): Initialize data structures early enough, before error +paths can access them. +* tests/bad-usage: Test bad command line usage. +* tests/Makefile.am (TESTS): Add bad-usage here. +--- + src/patch.c | 8 ++++---- + tests/Makefile.am | 1 + + tests/bad-usage | 18 ++++++++++++++++++ + 3 files changed, 23 insertions(+), 4 deletions(-) + create mode 100644 tests/bad-usage + +diff --git a/src/patch.c b/src/patch.c +index 828943b..0255fbb 100644 +--- a/src/patch.c ++++ b/src/patch.c +@@ -150,6 +150,10 @@ main (int argc, char **argv) + else if ((version_control = getenv ("VERSION_CONTROL"))) + version_control_context = "$VERSION_CONTROL"; + ++ init_backup_hash_table (); ++ init_files_to_delete (); ++ init_files_to_output (); ++ + /* parse switches */ + Argc = argc; + Argv = argv; +@@ -162,10 +166,6 @@ main (int argc, char **argv) + if (make_backups | backup_if_mismatch) + backup_type = get_version (version_control_context, version_control); + +- init_backup_hash_table (); +- init_files_to_delete (); +- init_files_to_output (); +- + init_output (&outstate); + if (outfile) + outstate.ofp = open_outfile (outfile); +diff --git a/tests/Makefile.am b/tests/Makefile.am +index 02fc6de..5cea52d 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -20,6 +20,7 @@ TESTS = \ + asymmetric-hunks \ + backup-prefix-suffix \ + bad-filenames \ ++ bad-usage \ + concat-git-diff \ + copy-rename \ + corrupt-reject-files \ +diff --git a/tests/bad-usage b/tests/bad-usage +new file mode 100644 +index 0000000..022eeda +--- /dev/null ++++ b/tests/bad-usage +@@ -0,0 +1,18 @@ ++# Copyright (C) 2009, 2011-2012 Free Software Foundation, Inc. ++# ++# Copying and distribution of this file, with or without modification, ++# in any medium, are permitted without royalty provided the copyright ++# notice and this notice are preserved. ++ ++. $srcdir/test-lib.sh ++ ++require_cat ++use_local_patch ++use_tmpdir ++ ++# ============================================================== ++ ++check 'patch -px || echo "status: $?"' <