autospec/patches/autospec-1.4.6-libapse_remove_sourceforge.patch
2011-04-26 21:39:44 +02:00

87 lines
3.5 KiB
Diff

diff -Nru autospec-1.4.6.ori/lib/libapse.lib.in autospec-1.4.6/lib/libapse.lib.in
--- autospec-1.4.6.ori/lib/libapse.lib.in 2009-04-10 19:47:03.000000000 +0200
+++ autospec-1.4.6/lib/libapse.lib.in 2009-07-01 02:29:14.912684915 +0200
@@ -294,81 +294,8 @@
local curr_curl_proxy_opts="\
${proxy:+ --proxy $proxy}${proxy_user:+ --proxy-user $proxy_user}"
- # sourceforge.net, sf.net
-
- local prj_name prj_group_id
-
- if [ "$(echo $pckurl | grep "sourceforge.net\|sf.net")" ]; then
- notify.note $"looking at"" <${NOTE}http://sourceforge.net${NORM}>..."
-
- prj_name=$(echo "$pckurl" | sed -n 's,.*/\(.*\)/.*,\1,p')
- [ "$prj_name" ] || notify.error $"\
-(bug)"" -- $FUNCNAME: "$"assertion failed:"" \"\$prj_name\" != \"\""
-
- curr_curl_url="http://sourceforge.net/projects/$prj_name"
- notify.debug "curl \$curr_curl_proxy_opts -s -L \"$curr_curl_url\""
- curl $curr_curl_proxy_opts -s -L "$curr_curl_url" > $fcurlout
-
- let "retval = $?"
- case "$retval" in
- 0) ;;
- 6) notify.warning $"couldn't resolve host" ;;
- 7) notify.warning $"failed to connect to host" ;;
- *) notify.warning $"curl error (exit code: $retval)" ;;
- esac
-
- [ "$retval" = "0" ] &&
- if [ "$(sed -n "s,.*Invalid Project.*,error,pi" $fcurlout)" != \
- "error" ]; then
- prj_group_id=$(\
- sed -n "s,.*download\.php?group_id=\([0-9]*\).*,\1,pi" \
- $fcurlout)
- [ "$prj_group_id" ] || notify.error $"\
-(bug)"" -- $FUNCNAME: "$"assertion failed:"" \"\$prj_group_id\" != \"\""
-
- curr_curl_url="\
-http://sourceforge.net/export/rss2_projfiles.php?group_id=$prj_group_id"
- notify.debug "curl \$curr_curl_proxy_opts -s -L \"$curr_curl_url\""
-
- curl $curr_curl_proxy_opts -s -L "$curr_curl_url" > $fcurlout
- let "retval = $?"
- case "$retval" in
- 0) ;;
- 6) notify.warning $"couldn't resolve host" ;;
- 7) notify.warning $"failed to connect to host" ;;
- *) notify.warning $"curl error (exit code: $retval)" ;;
- esac
-
- if [ $? -eq 0 ]; then
- for search_name in $src_name $specname; do
- new_version=$(\
-grep -i -m1 "$search_name [^ ]* released (.*)</title>" $fcurlout | \
-sed -n "s,.*$search_name \([^ ]*\) released (.*)</title>.*,\1,pi")
- [ "$new_version" ] && break
- done
-
- if [ -z "$new_version" ]; then
- [ "$src_name" ] || src_name="$specname"
-
- pck_file=`grep -i -m1 "Includes files: $src_name" $fcurlout | \
-sed -n "s,.*Includes files: \($src_name[-_0-9]*[^ -]*\) .*,\1,pi"`
- notify.debug "pck_file = \"$pck_file\""
- [ "$src_name" ] && unset src_name
-
- new_version=`echo $pck_file | sed -n "\
-/[0-9]/!q # return nothing if no number is found in the package name
-s,.*/,, # remove directory name, if any
-s/\.[^0-9].*// # remove trailing stuff (.tar.gz, ...)
-/-[0-9]*/{s/.*-\([0-9]*.*\)/\1/p;q} # <pck_name>-<pck_ver>
-/_[0-9]*/{s/.*_\([0-9]*.*\)/\1/p;q} # <pck_name>_<pck_ver>
-/[^-\.][0-9]\./{s/.*[^-\.]\([0-9]\..*\)/\1/p;q} # <pck_name><pck_ver>
-# <pck_name> (no version, but <pck_name> can end with numbers)
-/^[^0-9]*[0-9]*$/q"`
- fi
- fi
- fi
# SOURCE0 url based search (only if 'pckurl' is a valid url)
- elif [[ "$pckurl" =~ .*://.* ]]; then
+ if [[ "$pckurl" =~ .*://.* ]]; then
local pckurldir="`dirname $pckurl`/"
notify.debug "pckurldir = $pckurldir"