From 8643ccccfdd9ba6bcfdd0dc203461dc51f738093 Mon Sep 17 00:00:00 2001 From: Alejandro Mery Date: Wed, 4 Mar 2009 14:20:17 +0100 Subject: [PATCH] sde-check-package: added magic to handle sourceforge --- bin/sde-check-package | 12 ++++++++++++ etc/check_package.sed | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/bin/sde-check-package b/bin/sde-check-package index 81542cc..6dcc609 100755 --- a/bin/sde-check-package +++ b/bin/sde-check-package @@ -146,6 +146,18 @@ check_package() { "$SDEROOT/lib/sde-download/dump-tokenized.sh" "$url" > "$dump" 2> "$dump.stderr" unlock "$dump" ;; + sourceforge) + lock "$dump" + url="http://prdownloads.sourceforge.net/sourceforge/${url#sourceforge://}" + if [ ! -e "$dump" ]; then + "$SDEROOT/lib/sde-download/dump.sh" "$url" 2> "$dump.stderr" | grep "showfiles.php.*release_id" | + sed -e 's,.*"\([^"]\+\)".*,http://sourceforge.net\1,' -e 's,&,\&,g' | sort -u | + while read x; do + "$SDEROOT/lib/sde-download/dump-tokenized.sh" "$x" + done > "$dump" 2>> "$dump.stderr" + fi + unlock "$dump" + ;; *) echo_warning "$pkg: $protocol not supported." continue diff --git a/etc/check_package.sed b/etc/check_package.sed index 207ab97..2ecd1af 100644 --- a/etc/check_package.sed +++ b/etc/check_package.sed @@ -14,4 +14,4 @@ # GNU General Public License can be found in the file COPYING. # --- SDE-COPYRIGHT-NOTE-END --- -s,^http://\(.*\.\)\?dl\.\(sourceforge\|sf\)\.net/,http://prdownloads.sourceforge.net/, +s,^http://\(.*\.\)\?dl\.\(sourceforge\|sf\)\.net/\(sourceforge/\)\?,sourceforge://,