RPM Package Manager, CVS Repository
http://rpm5.org/cvs/
____________________________________________________________________________
Server: rpm5.org Name: Ralf S. Engelschall
Root: /v/rpm/cvs Email: rse@rpm5.org
Module: rpm Date: 27-Dec-2007 10:19:57
Branch: HEAD Handle: 2007122709195700
Modified files:
rpm CHANGES macros.in
Log:
Improve %patch macro implementation: less expansion redundancy by using
additional helper macros and macro namespace collision avoidance by
using "__patch" instead of "patch" prefix.
Summary:
Revision Changes Path
1.2021 +1 -0 rpm/CHANGES
1.220 +8 -5 rpm/macros.in
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: rpm/CHANGES
============================================================================
$ cvs diff -u -r1.2020 -r1.2021 CHANGES
--- rpm/CHANGES 27 Dec 2007 09:11:20 -0000 1.2020
+++ rpm/CHANGES 27 Dec 2007 09:19:57 -0000 1.2021
@@ -1,4 +1,5 @@
5.0b3 -> 5.0b4:
+ - rse: improve %patch macro implementation: less expansion redundancy and macro namespace collision avoidance
- rse: fix %{uncompress:<file>.lzo} by passing the required "-dc" options to LZOP's lzop(1)
- rse: fix %{uncompress:<file>.lzma} by passing the required "-dc" options to LZMA Utils' lzma(1)
- rse: support arbitrary hash algorithm via the originally intended syntax "digest([<algorithm>:]/path) = hex"
@@ .
patch -p0 <<'@@ .'
Index: rpm/macros.in
============================================================================
$ cvs diff -u -r1.219 -r1.220 macros.in
--- rpm/macros.in 22 Dec 2007 11:06:57 -0000 1.219
+++ rpm/macros.in 27 Dec 2007 09:19:57 -0000 1.220
@@ -1,7 +1,7 @@
#/*! \page config_macros Default configuration: @USRLIBRPM@/macros
# \verbatim
#
-# $Id: macros.in,v 1.219 2007/12/22 11:06:57 rse Exp $
+# $Id: macros.in,v 1.220 2007/12/27 09:19:57 rse 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
@@ -392,10 +392,13 @@
#
%patch(b:p:P:REz:F:d:) \
-%define patch_file %{P:%{-P:%{-P*}}%{!-P:0}} \
-%define patch_suffix %{-b:-b --suffix %{-b*}} %{-z:--suffix %{-z*}} \
- echo "Patch #%{-P:%{-P*}}%{!-P:0} (%{basename:%patch_file}):" \
- %{uncompress:%patch_file} | %{__patch} -s %{-p:-p%{-p*}} %{-F:-F%{-F*}} %{-d:-d%{-d*}} %patch_suffix %{-R} %{-E}
+%define __patch_number %{-P:%{-P*}}%{!-P:0} \
+%define __patch_file %{P:%{__patch_number}} \
+%define __patch_suffix %{-b:-b --suffix %{-b*}} %{-z:--suffix %{-z*}} \
+%define __patch_options -s %{-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_options}\
+%{nil}
#
# Script gets packaged file list on input and buildroot as first parameter.
@@ .
Received on Thu Dec 27 10:19:57 2007