diff options
author | Christian Neukirchen <chneukirchen@gmail.com> | 2014-09-06 18:55:10 +0200 |
---|---|---|
committer | Christian Neukirchen <chneukirchen@gmail.com> | 2014-09-06 18:55:10 +0200 |
commit | 41698336e8eca90e5f5b539dc4bf4d9a41c7a3db (patch) | |
tree | c4e56bcbf0164045c4a334f8822b1cd6543469fc /xnuxnu | |
parent | e6e0d2aa326c690f85515e873a6e2571c1833a23 (diff) | |
download | xtools-41698336e8eca90e5f5b539dc4bf4d9a41c7a3db.tar.gz xtools-41698336e8eca90e5f5b539dc4bf4d9a41c7a3db.tar.xz xtools-41698336e8eca90e5f5b539dc4bf4d9a41c7a3db.zip |
xnuxnu: override file
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 | |