From 323ebb4bb4b054168a9f4f56039d791fcdab0c97 Mon Sep 17 00:00:00 2001 From: Alejandro Mery Date: Wed, 16 Sep 2009 12:02:49 +0000 Subject: [PATCH] sde-check-package: fixed sourceforge support --- bin/sde-check-package | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/bin/sde-check-package b/bin/sde-check-package index 6dcc609..4bbad36 100755 --- a/bin/sde-check-package +++ b/bin/sde-check-package @@ -108,6 +108,13 @@ check_package_update() { fi } +download_url_dump() { + lock "$dump" + [ -e "$dump" ] || + "$SDEROOT/lib/sde-download/dump-tokenized.sh" "$url" > "$dump" 2> "$dump.stderr" + unlock "$dump" +} + check_package() { local repo="${1%/*}" pkg="${1#*/}" local desc="$SDEROOT/package/$repo/$pkg/$pkg.desc" @@ -141,22 +148,11 @@ check_package() { case "$protocol" in http|https|ftp) - lock "$dump" - [ -e "$dump" ] || - "$SDEROOT/lib/sde-download/dump-tokenized.sh" "$url" > "$dump" 2> "$dump.stderr" - unlock "$dump" + download_url_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" + url="http://sourceforge.net/projects/${url#sourceforge://}files/" + download_url_dump ;; *) echo_warning "$pkg: $protocol not supported."