forked from mirrors/nixpkgs
Allow pure-meta updates to specify tarball regexp
This commit is contained in:
parent
2e12709a26
commit
0fcee20522
|
@ -3,6 +3,7 @@
|
|||
own_dir="$(cd "$(dirname "$0")"; pwd)"
|
||||
|
||||
URL_WAS_SET=
|
||||
DL_URL_RE=
|
||||
CURRENT_URL=
|
||||
CURRENT_REV=
|
||||
PREFETCH_COMMAND=
|
||||
|
@ -13,6 +14,10 @@ url () {
|
|||
CURRENT_URL="$1"
|
||||
}
|
||||
|
||||
dl_url_re () {
|
||||
DL_URL_RE="$1"
|
||||
}
|
||||
|
||||
version_unpack () {
|
||||
sed -re '
|
||||
s/[.]/ /g;
|
||||
|
@ -123,7 +128,7 @@ ensure_choice () {
|
|||
echo "CURRENT_URL: $CURRENT_URL" >&2
|
||||
[ -z "$URL_WAS_SET" ] && [ -z "$CURRENT_URL" ] && ensure_url
|
||||
[ -n "$NEED_TO_CHOOSE_URL" ] && {
|
||||
version_link '[.]tar[.]([^./])+$'
|
||||
version_link "${DL_URL_RE:-'[.]tar[.]([^./])+$'}"
|
||||
unset NEED_TO_CHOOSE_URL
|
||||
}
|
||||
[ -z "$CURRENT_URL" ] && {
|
||||
|
@ -174,6 +179,12 @@ retrieve_version () {
|
|||
PACKAGED_VERSION="$(retrieve_meta version)"
|
||||
}
|
||||
|
||||
ensure_dl_url_re () {
|
||||
echo "Ensuring DL_URL_RE. DL_URL_RE: $DL_URL_RE" >&2
|
||||
[ -z "$DL_URL_RE" ] && dl_url_re "$(retrieve_meta downloadURLRegexp)"
|
||||
echo "DL_URL_RE: $DL_URL_RE" >&2
|
||||
}
|
||||
|
||||
directory_of () {
|
||||
cd "$(dirname "$1")"; pwd
|
||||
}
|
||||
|
@ -291,9 +302,9 @@ process_config () {
|
|||
}
|
||||
"
|
||||
fi
|
||||
ensure_name
|
||||
ensure_attribute_name
|
||||
retrieve_version
|
||||
ensure_dl_url_re
|
||||
ensure_choice
|
||||
ensure_version
|
||||
ensure_target
|
||||
|
|
Loading…
Reference in a new issue