RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Anders F. Björklund Root: /v/rpm/cvs Email: a...@rpm5.org Module: rpm Date: 18-Dec-2008 18:11:34 Branch: HEAD Handle: 2008121817113301 Modified files: rpm CHANGES macros.in rpm/build parsePrep.c Log: add default patch flags macro Summary: Revision Changes Path 1.2692 +1 -0 rpm/CHANGES 2.128 +8 -5 rpm/build/parsePrep.c 1.264 +5 -2 rpm/macros.in ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/CHANGES ============================================================================ $ cvs diff -u -r1.2691 -r1.2692 CHANGES --- rpm/CHANGES 18 Dec 2008 00:01:15 -0000 1.2691 +++ rpm/CHANGES 18 Dec 2008 17:11:33 -0000 1.2692 @@ -1,5 +1,6 @@ 5.2a2 -> 5.2a3: + - rpm.org: add %{_default_patch_flags} macro for patch options - proyvind: add -Werror=format-security to gcc warning flags. - proyvind: xzdio: rename from lzdio. - proyvind: lzdio: set memlimit for decoding to 100MiB. @@ . patch -p0 <<'@@ .' Index: rpm/build/parsePrep.c ============================================================================ $ cvs diff -u -r2.127 -r2.128 parsePrep.c --- rpm/build/parsePrep.c 15 Dec 2008 22:43:43 -0000 2.127 +++ rpm/build/parsePrep.c 18 Dec 2008 17:11:34 -0000 2.128 @@ -87,7 +87,7 @@ struct Source *sp; rpmCompressedMagic compressed = COMPRESSED_NOT; int urltype; - const char *patch; + const char *patch, *flags; *t = '\0'; if (db) @@ -146,6 +146,8 @@ if (strcmp(patch, "%{__patch}") == 0) patch = xstrdup("patch"); + flags = rpmExpand("%{?_default_patch_flags}%{!?_default_patch_flags:-s}", NULL); + if (compressed) { const char *zipper; @@ -173,7 +175,7 @@ sprintf(buf, "echo \"Patch #%d (%s):\"\n" - "%s -d < '%s' | %s -p%d %s -s\n" + "%s -d < '%s' | %s -p%d %s %s\n" "STATUS=$?\n" "if [ $STATUS -ne 0 ]; then\n" " exit $STATUS\n" @@ -183,19 +185,20 @@ (const char *) basename((char *)fn), /*...@=moduncon@*/ zipper, - fn, patch, strip, args); + fn, patch, strip, args, flags); zipper = _free(zipper); } else { sprintf(buf, "echo \"Patch #%d (%s):\"\n" - "%s -p%d %s -s < '%s'", c, + "%s -p%d %s %s < '%s'", c, /*...@-moduncon@*/ (const char *) basename((char *)fn), /*...@=moduncon@*/ - patch, strip, args, fn); + patch, strip, args, flags, fn); } patch = _free(patch); + flags = _free(flags); Lurlfn = _free(Lurlfn); return buf; } @@ . patch -p0 <<'@@ .' Index: rpm/macros.in ============================================================================ $ cvs diff -u -r1.263 -r1.264 macros.in --- rpm/macros.in 15 Dec 2008 22:43:43 -0000 1.263 +++ rpm/macros.in 18 Dec 2008 17:11:34 -0000 1.264 @@ -1,7 +1,7 @@ #/*! \page config_macros Default configuration: @USRLIBRPM@/macros # \verbatim # -# $Id: macros.in,v 1.263 2008/12/15 22:43:43 pkarlsen Exp $ +# $Id: macros.in,v 1.264 2008/12/18 17:11:34 afb Exp $ # # This is a global RPM configuration file. All changes made here will # be lost when the rpm package is upgraded. Any per-system configuration @@ -382,6 +382,9 @@ # Default fuzz level for %patch in spec file. #%_default_patch_fuzz -1 +# Default patch flags +%_default_patch_flags -s + #============================================================================== # ---- Build configuration macros. # @@ -407,7 +410,7 @@ %define __patch_file %{P:%{__patch_number}} \ %define __patch_suffix %{-b:-b --suffix %{-b*}} %{-z:--suffix %{-z*}} \ %define __patch_fuzz %{?_default_patch_fuzz:%(test %{_default_patch_fuzz} -ge 0 && echo "--fuzz=%{_default_patch_fuzz} ")} \ -%define __patch_options -s %{-p:-p%{-p*}} %{-F:-F%{-F*}} %{-d:-d%{-d*}} %{-R} %{-E} %{__patch_suffix} \ +%define __patch_options %{_default_patch_flags} %{-p:-p%{-p*}} %{-F:-F%{-F*}} %{-d:-d%{-d*}} %{-R} %{-E} %{__patch_suffix} \ echo "Patch #%{__patch_number} (%{basename:%{__patch_file}}):" && ( %{uncompress:%{__patch_file}} | %{__patch} %{__patch_fuzz}%{__patch_options} ) || exit 1\ } @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org