From c6bc4fbe38255a46e5ea2f42a1823865abc2a9de Mon Sep 17 00:00:00 2001 From: Jehan Date: Mon, 26 Dec 2022 18:53:51 +0100 Subject: [PATCH] tools: add a --runtime option to flatpak-releases script. This will allow to also check the list of runtime builds. We could see an example in a report (#8993) where someone had the latest flatpak build of GIMP but an older build of the runtime flatpak. So they had a bug because of a dependency which got updated since then. --- tools/flatpak-releases | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/tools/flatpak-releases b/tools/flatpak-releases index 83c519048a..d1d80df25e 100755 --- a/tools/flatpak-releases +++ b/tools/flatpak-releases @@ -22,6 +22,7 @@ # portability. install=-1 +show_runtime=0 appid=org.gimp.GIMP remote='flathub' branch='stable' @@ -38,6 +39,8 @@ do branch='master' elif [[ $var = '--system' ]]; then prefix='--system' + elif [[ $var = '--runtime' ]]; then + show_runtime=1 elif [[ $var =~ ^- ]]; then echo "Usage: ./flathub-releases [--beta] [--system] [-X] [org.example.app]" echo @@ -74,13 +77,28 @@ if [ "$got_info" -ne 0 ]; then # non-interactive case, it would just silently fail instead. So let's # make a second try on user-installed remote (totally arbitrary # choice). - package_info_cmd="flatpak remote-info --user $remote $appid" + user_system="--user" + package_info_cmd="flatpak remote-info $user_system $remote $appid" package_info=`$package_info_cmd 2>&1` got_info="$?" fi if [ "$got_info" -ne 0 ]; then echo "Flathub query failed with the following error: $package_info" exit 2 +elif [ "$show_runtime" -eq 1 ]; then + # With the special --runtime option, we list the associated runtime instead of + # the application. + runtime=`echo "$package_info" | grep Runtime: |sed 's/^ *Runtime: //'` + appid=$runtime + package_info_cmd="flatpak remote-info $user_system $remote $appid" + + package_info=`$package_info_cmd 2>&1` + got_info="$?" + + if [ "$got_info" -ne 0 ]; then + echo "Flathub query failed with the following error: $package_info" + exit 2 + fi fi release_number=0