diff --git a/pkgs/build-support/upstream-updater/update-walker.sh b/pkgs/build-support/upstream-updater/update-walker.sh index 78c61dd2b82a..8d7a6b219f16 100755 --- a/pkgs/build-support/upstream-updater/update-walker.sh +++ b/pkgs/build-support/upstream-updater/update-walker.sh @@ -82,20 +82,26 @@ version () { } ensure_version () { + echo "Ensuring version. CURRENT_VERSION: $CURRENT_VERSION" >&2 [ -z "$CURRENT_VERSION" ] && version '.*-([0-9.]+)[-._].*' '\1' } ensure_target () { + echo "Ensuring target. CURRENT_TARGET: $CURRENT_TARGET" >&2 [ -z "$CURRENT_TARGET" ] && target default.nix } ensure_name () { + echo "Ensuring name. CURRENT_NAME: $CURRENT_NAME" >&2 [ -z "$CURRENT_NAME" ] && name "$(basename "$CONFIG_DIR")" echo "Resulting name: $CURRENT_NAME" } ensure_choice () { - [ -n "NEED_TO_CHOOSE_URL" ] && { + echo "Ensuring that choice is made." >&2 + echo "NEED_TO_CHOOSE_URL: [$NEED_TO_CHOOSE_URL]." >&2 + echo "CURRENT_URL: $CURRENT_URL" >&2 + [ -n "$NEED_TO_CHOOSE_URL" ] && { version_link '[.]tar[.]([^./])+$' unset NEED_TO_CHOOSE_URL } @@ -106,12 +112,19 @@ ensure_choice () { } } +ensure_hash () { + echo "Ensuring hash. CURRENT_HASH: $CURRENT_HASH" >&2 + [ -z "$CURRENT_HASH" ] && hash +} + hash () { CURRENT_HASH="$(nix-prefetch-url "$CURRENT_URL")" + echo "CURRENT_HASH: $CURRENT_HASH" >&2 } name () { CURRENT_NAME="$1" + echo "CURRENT_NAME: $CURRENT_NAME" >&2 } retrieve_version () { @@ -196,7 +209,7 @@ do_regenerate () { } do_overwrite () { - hash + ensure_hash do_regenerate "$1" > "$1.new.tmp" mv "$1.new.tmp" "$1" }