]> git.pld-linux.org Git - packages/rpm-build-tools.git/commitdiff
- func to kill macros from preamble
authorElan Ruusamäe <glen@pld-linux.org>
Mon, 26 Dec 2005 20:06:04 +0000 (20:06 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    adapter.awk -> 1.250

adapter.awk

index bf6a1249744726bc83b37cb6508d55021e842f45..f70742811cd5be83270888714f53f787e13cb0e8 100644 (file)
@@ -126,6 +126,7 @@ ENVIRON["SKIP_SORTBR"] != 1 && preamble == 1 && /(Obsoletes|Provides|PreReq|(Bui
                sub(/PreReq:/, "Requires:", $1);
        }
        format_preamble()
+       kill_preamble_macros();
 
        b_idx++;
        l = substr($0, index($0, $2));
@@ -228,6 +229,9 @@ preamble == 1 {
        if ($2 ~ /^release$/)
                release = $3
 
+       if ($2 ~ /^mod_name$/)
+               mod_name = $3
+
        # do nothing further, otherwise adapter thinks we're at preamble
        print
        next
@@ -760,6 +764,7 @@ preamble == 1 {
        if (field ~ /^patch:/)
                $1 = "Patch0:"
 
+       kill_preamble_macros();
        format_preamble()
 
        if (field ~ /requires/) {
@@ -1209,3 +1214,10 @@ function cflags(var)
                sub("\$RPM_OPT_FLAGS", "%{rpmcflags}")
        return 1
 }
+
+function kill_preamble_macros()
+{
+       if ($1 ~ /^URL:/ || $1 ~ /^Obsoletes:/) {
+               sub("%{mod_name}", mod_name, $2);
+       }
+}
This page took 0.030755 seconds and 4 git commands to generate.