[packages/adapter: 276/631] - damn adapter, can't live with it and without it

glen glen at pld-linux.org
Mon Sep 12 19:57:35 CEST 2016


commit 8f7c516b5083f986f068181dbdeebab67516654e
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Mon Jan 2 17:55:27 2006 +0000

    - damn adapter, can't live with it and without it
    
    Changed files:
        adapter.awk -> 1.266

 adapter.awk | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/adapter.awk b/adapter.awk
index 1407bdb..802b216 100644
--- a/adapter.awk
+++ b/adapter.awk
@@ -766,7 +766,7 @@ ENVIRON["SKIP_SORTBR"] != 1 && preamble == 1 && $0 ~ PREAMBLE_TAGS, $0 ~ PREAMBL
 		sub(/PreReq:/, "Requires:", $1);
 	}
 	format_preamble()
-	kill_preamble_macros();
+#	kill_preamble_macros(); # breaks tabbing
 
 	b_idx++;
 	l = substr($0, index($0, $2));
@@ -1265,8 +1265,12 @@ function cflags(var)
 
 function demacroize(str)
 {
-	sub("%{mod_name}", mod_name, str);
-	sub("%{name}", name, str);
+	if (mod_name) {
+		sub("%{mod_name}", mod_name, str);
+	}
+	if (name) {
+		sub("%{name}", name, str);
+	}
 	if (version) {
 		sub("%{version}", version, str);
 	}
@@ -1285,6 +1289,7 @@ function demacroize(str)
 function kill_preamble_macros()
 {
 	if ($1 ~ /^URL:/ || $1 ~ /^Obsoletes:/) {
+		# NB! assigning $2 a value breaks tabbing
 		$2 = demacroize($2);
 		# unify sourceforge url
 		sub("\.sf\.net/$", ".sourceforge.net/", $2);
================================================================

---- gitweb:

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



More information about the pld-cvs-commit mailing list