[packages/adapter: 450/631] - new sf urls

glen glen at pld-linux.org
Mon Sep 12 20:12:10 CEST 2016


commit 2bee64857b5e0d2d3face12da53905d6fb5cf391
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Sat Aug 29 18:50:16 2009 +0000

    - new sf urls
    
    Changed files:
        adapter.awk -> 1.425

 adapter.awk | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/adapter.awk b/adapter.awk
index da4313e..9f885a8 100644
--- a/adapter.awk
+++ b/adapter.awk
@@ -1581,19 +1581,25 @@ function unify_url(url)
 
 	# sourceforge urls
 	# Docs about sourceforge mirror system: http://sourceforge.net/docs/B05/
-	sub("[?&]big_mirror=.*$", "", url);
-	sub("[?&]modtime=.*$", "", url);
-	sub("[?]use_mirror=.*$", "", url);
-	sub("[?]download$", "", url);
-
 	sub("^http://prdownloads\.sourceforge\.net/", "http://dl.sourceforge.net/", url)
 	sub("^http://download\.sf\.net/", "http://dl.sourceforge.net/", url)
 	sub("^http://download\.sourceforge\.net/", "http://dl.sourceforge.net/", url)
 	sub("^http://downloads\.sourceforge\.net/", "http://dl.sourceforge.net/", url)
-
 	sub("^http://.*\.dl\.sourceforge\.net/", "http://dl.sourceforge.net/", url)
 	sub("^http://dl\.sourceforge\.net/sourceforge/", "http://dl.sourceforge.net/", url)
 	sub("^http://dl\.sf\.net/", "http://dl.sourceforge.net/", url)
+	# new style urls, strip "files/" between and prepend dl.
+	if (match(url, "^http://sourceforge.net/projects/[^/]+/files/")) {
+		url = substr(url, 1, RLENGTH - length("files/")) substr(url, RSTART + RLENGTH);
+		sub("^http://sourceforge.net/projects/", "http://dl.sourceforge.net/project/", url);
+	}
+	if (url ~ /sourceforge.net/) {
+		sub("[?&]big_mirror=.*$", "", url);
+		sub("[?&]modtime=.*$", "", url);
+		sub("[?]use_mirror=.*$", "", url);
+		sub("[?]download$", "", url);
+		sub("/download$", "", url);
+	}
 
 	sub("^ftp://ftp\.gnome\.org/", "http://ftp.gnome.org/", url)
 	sub("^http://ftp\.gnome\.org/pub/gnome/", "http://ftp.gnome.org/pub/GNOME/", url)
================================================================

---- gitweb:

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



More information about the pld-cvs-commit mailing list