Skip to content

Commit

Permalink
setup-util-jq: 1.7 is now latest, also fix setup-util installing
Browse files Browse the repository at this point in the history
fallback ecosystems to uninstall
  • Loading branch information
balupton committed Sep 7, 2023
1 parent e4df2da commit aaf5e9b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
4 changes: 4 additions & 0 deletions commands/github-download
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ function github_download() (
--[no-]dry
Whether or not to only output the resolved URL and do nothing else.
QUIRKS:
To get the release identifier of a tag that hasn't been promoted to a release:
fetch 'https://bevry.me/api/github/repos/jqlang/jq/releases' | jq -r '.[] | {tag_name, id}'
EOF
if test "$#" -ne 0; then
echo-error "$@"
Expand Down
17 changes: 8 additions & 9 deletions commands/setup-util
Original file line number Diff line number Diff line change
Expand Up @@ -3361,15 +3361,14 @@ function setup_util() (
fi
done
# fallback for failed packages which are missing their package system
if test "$fallback" = 'yes'; then
if test "${#fallbacks[@]}" -ne 0; then
for installer in "${fallbacks[@]}"; do
run_installer "$installer" "do_${installer}_fallback"
if test "$had_break" = 'yes'; then
break
fi
done
fi
# don't fallback if uninstall though (as the package won't be installed in an ecosystem that is not installed)
if test "$fallback" = 'yes' -a "$action" != 'uninstall' -a "${#fallbacks[@]}" -ne 0; then
for installer in "${fallbacks[@]}"; do
run_installer "$installer" "do_${installer}_fallback"
if test "$had_break" = 'yes'; then
break
fi
done
fi
}
run_installers
Expand Down
6 changes: 1 addition & 5 deletions commands/setup-util-jq
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,10 @@ function setup_util_jq() (
ZYPPER='jq' # SUSE
)
function get_github_asset_url {
# use 'jq-1.7rc2' release, as it supports more targets than 1.6, change back to [latest] when 1.7 is released
# use release identifier instead of tag name, as we need jq to use tag name
# fetch the release identifier via:
# fetch "https://bevry.me/api/github/repos/jqlang/jq/releases" | jq -r ".[] | {tag_name, id}"
github-download \
--dry \
--slug='jqlang/jq' \
--release='118848514' \
--release='latest' \
--asset-filter="$(echo-escape-regex "$1")$" | echo-first-line || :
}
function add_download_option {
Expand Down

0 comments on commit aaf5e9b

Please sign in to comment.