[packages/adapter: 260/631] - func to kill macros from preamble

glen glen at pld-linux.org
Mon Sep 12 19:56:15 CEST 2016


commit 0ea7c3cde2f7546660bc5c8d08ad196b3642fc47
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Mon Dec 26 20:06:04 2005 +0000

    - func to kill macros from preamble
    
    Changed files:
        adapter.awk -> 1.250

 adapter.awk | 12 ++++++++++++
 1 file changed, 12 insertions(+)
---
diff --git a/adapter.awk b/adapter.awk
index bf6a124..f707428 100644
--- a/adapter.awk
+++ b/adapter.awk
@@ -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);
+	}
+}
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/adapter.git/commitdiff/6ca0126d4d0c8c79feb7db10b0a0fade0f3b8885



More information about the pld-cvs-commit mailing list