[packages/adapter: 135/631] - allow %{name} macro just in last url path component

glen glen at pld-linux.org
Mon Sep 12 19:45:47 CEST 2016


commit ced0372e0686eb4b7d91893265bb651233a04785
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Tue Feb 15 10:01:12 2005 +0000

    - allow %{name} macro just in last url path component
    
    Changed files:
        adapter.awk -> 1.130

 adapter.awk | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
---
diff --git a/adapter.awk b/adapter.awk
index 174431c..8a70dab 100644
--- a/adapter.awk
+++ b/adapter.awk
@@ -430,6 +430,18 @@ preamble == 1 {
 			sub(/\.pamd$/,"",url[n])
 		}
 
+		# allow %{name} just in last url component
+		s = ""
+		for (i = 1; i <= n; i++) {
+			url[i] = fixedsub("%{name}", name, url[i])
+			if (s) {
+				s = s "/" url[i]
+			} else {
+				s = url[i]
+			}
+		}
+		$2 = s url[n+1]
+
 		filename = url[n]
 		url[n] = fixedsub(name, "%{name}", url[n])
 		if (field ~ /source/)
@@ -438,7 +450,6 @@ preamble == 1 {
 
 		# sourceforge urls
 		sub("^http://dl.sourceforge.net/sourceforge/", "http://dl.sourceforge.net/", $2)
-		sub("^http://dl.sourceforge.net/%{name}/", "http://dl.sourceforge.net/"  name "/", $2)
 	}
 
 
================================================================

---- gitweb:

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



More information about the pld-cvs-commit mailing list