]> git.pld-linux.org Git - packages/rpm.git/commitdiff
- allow -b (base in %patchset_source), somewhat cleaner. auto/ac/rpm-build-macros-1_351-1
authorElan Ruusamäe <glen@pld-linux.org>
Fri, 22 Dec 2006 19:28:31 +0000 (19:28 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    rpm.macros -> 1.351

rpm.macros

index 7d8c13761495ce21df5edb185a8c100f39ae1b4f..5432c4d5c4766aceeea1aacf9255d03c7bdcbd91 100644 (file)
@@ -1289,8 +1289,12 @@ done                                                                                                                             \
 # generate SourceX urls from range START STOP
 # Format can be SINGLE format char of %e, %f, %g, see seq(1)
 # The sources start from 10000
-%patchset_source(x:f:) %(\
-       seq -f 'Patch10%03g:' %1 %{?2}%{!?2:%{1}} > %{tmpdir}/__ps1; \
+%patchset_source(f:b:) %(\
+       base=%{-b*}%{!-b*:10000};
+       start=$((%1 + $base)); \
+       end=$((%{?2}%{!?2:%{1}} + $base)); \
+       # we need to call seq twice as it doesn't allow two formats \
+       seq -f 'Patch%g:' $start $end > %{tmpdir}/__ps1; \
        seq -f '%{-f*}' %1 %{?2}%{!?2:%{1}} > %{tmpdir}/__ps2; \
        paste %{tmpdir}/__ps{1,2}; \
        rm -f %{tmpdir}/__ps{1,2}; \
@@ -1301,9 +1305,11 @@ done                                                                                                                             \
 # -p specify -pX for %patch line
 # -b base offset: defaults to 10000
 %patchset_patch(f:p:b:) %(
+       base=%{-b*}%{!-b*:10000};
+       start=$((%1 + $base)); \
+       end=$((%{?2}%{!?2:%{1}} + $base)); \
        echo ": patchset_patch %1%{?2: to %2}"; \
-       seq -f '%g=%{-p*:-p%{-p*}}' %1 %{?2}%{!?2:%{1}} | \
-       awk -vbase=%{-b*}%{!-b*:10000} -F= '{printf(": patchset %d\\n%%%%patch%d %s\\n", $1, $1+base, $2)}'; \
+       seq -f 'patch%g %{-p*:-p%{-p*}}' $start $end | sed -e s,^,%%,; \
 ) \
 %{nil}
 
This page took 0.096085 seconds and 4 git commands to generate.