From 284edbde0e512a735b95e7c8e8bd2f08b023d614 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Sat, 29 Aug 2009 18:50:16 +0000 Subject: [PATCH] - 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) -- 2.44.0