diff options
Diffstat (limited to 'xnuxnu')
-rwxr-xr-x | xnuxnu | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/xnuxnu b/xnuxnu index 29c2abd..cbd4054 100755 --- a/xnuxnu +++ b/xnuxnu @@ -3,18 +3,18 @@ pkgname=$1 orig_pkgname=$pkgname -IFS=' +nl=' ' export LC_ALL=C -void_version=$(./xbps-src show "$1" | sed -n '/version/s/[^:]*:[\t]*//p') +void_version=$(./xbps-src show "$1" | sed -n '/^version/s/[^:]*:[\t]*//p') ./xbps-src show "$1" | - sed -n '/distfiles:/{s/[^:]*:[\t]*//;s|/[^/]*$|/|p}; - /Upstream URL/s/[^:]*:[\t]*//p' | - while read url; do - rx="\b$pkgname[-_]?((src|source)[-_])?\K([^-/_\s]*?\d[^-/_\s]*?)(?=(?:[-_.](?:src|source|orig))?\.(?:[jt]ar|shar|t[bglx]z|tbz2|zip))\b" + sed -n '/^distfiles:/{s/[^:]*:[\t]*//;s|/[^/]*$|/|p}; + /^Upstream URL/s/[^:]*:[\t]*//p' | + while IFS=$nl read url; do + rx="(?<!-)\b$pkgname[-_]?((src|source)[-_])?\K([^-/_\s]*?\d[^-/_\s]*?)(?=(?:[-_.](?:src|source|orig))?\.(?:[jt]ar|shar|t[bglx]z|tbz2|zip))\b" case "$url" in *sourceforge.net/sourceforge*) url="http://sourceforge.net/projects/$pkgname/rss?limit=200";; @@ -32,8 +32,12 @@ void_version=$(./xbps-src show "$1" | sed -n '/version/s/[^:]*:[\t]*//p') rx='"name":\s*"v?\K[^\d]*([\d\.]+)(?=")';; esac + set -- $(grep "^${orig_pkgname} " xnuxnu-override) + url=${2:-$url} + rx=${3:-$rx} + echo "fetching $url" 1>&2 - curl -A xnuxnu -Ls $url | + curl -A xnuxnu -Ls "$url" | grep -Po -i "$rx" | sort -Vu done | |