Skip to content

Instantly share code, notes, and snippets.

@robin-a-meade
Created April 9, 2023 06:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robin-a-meade/23e40aa4c966b4e411e8b5f1b0b3eb53 to your computer and use it in GitHub Desktop.
Save robin-a-meade/23e40aa4c966b4e411e8b5f1b0b3eb53 to your computer and use it in GitHub Desktop.
Check the gnome extension packages in the Fedora repo for any that are not compatible with the currently running version of Gnome
#!/bin/bash
# Execute as non-root. No need to execute with sudo.
die () { echo "error: $@" >&2; exit 1; }
# Check for required command
# https://unix.stackexchange.com/q/85249
check_for_required_command () {
echo -n "Checking for existence of $1 command ..... "
if ! command -v "$1" >/dev/null 2>&1; then
echo N
echo "Please install $1 and try again"
exit 1
else
echo Y
fi
}
check_for_required_command jq
check_for_required_command rpm2cpio
check_for_required_command cpio
# Determine what version of Fedora we are running
# Source /etc/os-release to set the $VERSION_ID variable
# For example, on a Fedora 38 system, VERSION_ID will be set to "38"
# https://www.freedesktop.org/software/systemd/man/os-release.html
source /etc/os-release
echo "You are running Fedora $VERSION_ID"
# Determine what version of Gnome Shell we are running
# https://unix.stackexchange.com/q/73212/
#GNOME_MAJOR="$(xmlstarlet sel -t -v /gnome-version/platform /usr/share/gnome/gnome-version.xml)"
#echo "You are running Gnome $GNOME_MAJOR"
#debugvar GNOME_MAJOR
gnome_shell_version=$(gnome-shell --version | awk '{print $3}')
gnome_shell_version_major=${gnome_shell_version%%.*}
echo "You are running Gnome $gnome_shell_version_major"
# Build an array of the Gnome shell extension packages present in the fedora repos
#
# To avoid retrieving both i686 and x86_64 architectures, we specify the architectures
# that we are interested in: x86_64 and noarch
#
# For the following command substitution, we want word splitting but not globbing
set -f # Temporarily disable globbing. Same as set -o noglob
packages=( $(
dnf repoquery --repo fedora --repo updates 'gnome-shell-extension-*' \
--arch x86_64 --arch noarch --latest-limit=1 2>/dev/null
))
set +f # Reinstate globbing. Same as set +o noglob
printf "There are %s packages matching the pattern 'gnome-shell-extension-*'\n" "${#packages[@]}"
declare -i i=0
for p in "${packages[@]}"; do
i+=1
printf "%5d %s\n" "$i" "$p"
done
readonly DIR=$(mktemp -d --tmpdir=/var/tmp) || die "Couldn't create a temporary directory"
echo "Created temporary directory '$DIR'"
trap "rm -rf ${DIR@Q}" EXIT
cd "$DIR" || die "Couldn't cd into the temporary directory"
echo "Downloading the packages"
dnf download "${packages[@]}"
echo
echo "$ ls -l"
ls -l
echo
needs_updating=()
no_metadata=()
up_to_date=()
shopt -s nullglob
echo
for rpm in *.rpm; do
rm -rf usr
rpm2cpio "$rpm" | cpio -idmv '*/metadata.json' 2>/dev/null
metadata_file=(usr/share/gnome-shell/extensions/*/metadata.json)
if [[ ${#metadata_file[@]} -eq 0 ]]; then
no_metadata+=($rpm)
continue
fi
# Use jq to test if the current Gnome version is declared as a supported version of Gnome Shell
# The value returned is 'true' if found, 'false' otherwise
good=$(jq --arg v "$gnome_shell_version_major" '.["shell-version"] | any(. | test(v | "^\(v)\\.?.*$"))' "$metadata_file")
#| any(. | test(/^a.*/))
if [[ $good == true ]]; then
up_to_date+=("$rpm")
else
echo
echo "$rpm"
echo " shell-version in metadata.json doesn't include \"$gnome_shell_version_major\""
echo -n ' shell-version: '
jq -c '.["shell-version"]' "$metadata_file"
needs_updating+=("$rpm")
fi
done
echo
echo "SUMMARY"
echo
echo "Support package, not an extension package (no metadata.json file) (${#no_metadata[@]}):"
for rpm in "${no_metadata[@]}"; do
echo " $rpm"
done
echo
echo "Needs updating (${#needs_updating[@]}):"
for rpm in "${needs_updating[@]}"; do
echo " $rpm"
done
echo
echo "Up-to-date (${#up_to_date[@]}):"
for rpm in "${up_to_date[@]}"; do
echo " $rpm"
done
echo
Checking for existence of jq command ..... Y
Checking for existence of rpm2cpio command ..... Y
Checking for existence of cpio command ..... Y
You are running Fedora 38
You are running Gnome 44
There are 43 packages matching the pattern 'gnome-shell-extension-*'
1 gnome-shell-extension-appindicator-0:53-1.fc38.noarch
2 gnome-shell-extension-apps-menu-0:44.0-1.fc38.noarch
3 gnome-shell-extension-argos-0:3^20220712git1180568-2.fc38.noarch
4 gnome-shell-extension-auto-move-windows-0:44.0-1.fc38.noarch
5 gnome-shell-extension-background-logo-0:44~beta-1.fc38.noarch
6 gnome-shell-extension-blur-my-shell-0:45-1.fc38.noarch
7 gnome-shell-extension-bubblemail-0:19-2.fc38.noarch
8 gnome-shell-extension-caffeine-0:46-1.fc38.noarch
9 gnome-shell-extension-common-0:44.0-1.fc38.noarch
10 gnome-shell-extension-dash-to-dock-0:79-1.fc38.noarch
11 gnome-shell-extension-dash-to-panel-0:55-2.fc38.noarch
12 gnome-shell-extension-disconnect-wifi-0:17-12.fc38.noarch
13 gnome-shell-extension-drive-menu-0:44.0-1.fc38.noarch
14 gnome-shell-extension-freon-2:45-4.20221109gitf2c0c94.fc38.noarch
15 gnome-shell-extension-frippery-applications-menu-0:43.0-2.fc38.noarch
16 gnome-shell-extension-frippery-bottom-panel-0:43.0-2.fc38.noarch
17 gnome-shell-extension-frippery-move-clock-0:43.0-2.fc38.noarch
18 gnome-shell-extension-frippery-panel-favorites-0:43.0-2.fc38.noarch
19 gnome-shell-extension-gamemode-0:8-2.fc38.noarch
20 gnome-shell-extension-gpaste-0:44.0-1.fc38.noarch
21 gnome-shell-extension-gsconnect-0:55-1.fc38.x86_64
22 gnome-shell-extension-ibus-font-0:0.20210510-5.fc38.noarch
23 gnome-shell-extension-just-perfection-0:24.0-1.fc38.noarch
24 gnome-shell-extension-launch-new-instance-0:44.0-1.fc38.noarch
25 gnome-shell-extension-native-window-placement-0:44.0-1.fc38.noarch
26 gnome-shell-extension-netspeed-0:3.32-0.7.20220421git5a96082.fc38.noarch
27 gnome-shell-extension-no-overview-0:12-3.fc38.noarch
28 gnome-shell-extension-openweather-0:119-2.fc38.noarch
29 gnome-shell-extension-pidgin-0:1.0.3-12.fc38.noarch
30 gnome-shell-extension-places-menu-0:44.0-1.fc38.noarch
31 gnome-shell-extension-pop-shell-0:1.2.0^10.dcf17f3-1.fc38.noarch
32 gnome-shell-extension-pop-shell-shortcut-overrides-0:1.2.0^10.dcf17f3-1.fc38.noarch
33 gnome-shell-extension-refresh-wifi-0:6.0-12.fc38.noarch
34 gnome-shell-extension-screenshot-window-sizer-0:44.0-1.fc38.noarch
35 gnome-shell-extension-suspend-button-0:19-12.20171024gita812520.fc38.noarch
36 gnome-shell-extension-system-monitor-applet-1:38-22.20230326git21d7b4e.fc38.noarch
37 gnome-shell-extension-unite-0:8-13.fc38.noarch
38 gnome-shell-extension-user-theme-0:44.0-1.fc38.noarch
39 gnome-shell-extension-vertical-overview-0:10-2.fc38.noarch
40 gnome-shell-extension-vertical-workspaces-0:26-1.fc38.noarch
41 gnome-shell-extension-window-list-0:44.0-1.fc38.noarch
42 gnome-shell-extension-windowsNavigator-0:44.0-1.fc38.noarch
43 gnome-shell-extension-workspace-indicator-0:44.0-1.fc38.noarch
Created temporary directory '/var/tmp/tmp.1E1tFchoIz'
Downloading the packages
Last metadata expiration check: 0:13:00 ago on Sat 08 Apr 2023 08:20:19 PM HST.
(1/43): gnome-shell-extension-apps-menu-44.0-1.fc38.noarch.rpm 31 kB/s | 16 kB 00:00
(2/43): gnome-shell-extension-argos-3^20220712git1180568-2.fc38.noarch.rpm 65 kB/s | 36 kB 00:00
(3/43): gnome-shell-extension-auto-move-windows-44.0-1.fc38.noarch.rpm 76 kB/s | 14 kB 00:00
(4/43): gnome-shell-extension-appindicator-53-1.fc38.noarch.rpm 101 kB/s | 73 kB 00:00
(5/43): gnome-shell-extension-background-logo-44~beta-1.fc38.noarch.rpm 103 kB/s | 21 kB 00:00
(6/43): gnome-shell-extension-bubblemail-19-2.fc38.noarch.rpm 214 kB/s | 46 kB 00:00
(7/43): gnome-shell-extension-blur-my-shell-45-1.fc38.noarch.rpm 255 kB/s | 112 kB 00:00
(8/43): gnome-shell-extension-caffeine-46-1.fc38.noarch.rpm 207 kB/s | 79 kB 00:00
(9/43): gnome-shell-extension-common-44.0-1.fc38.noarch.rpm 403 kB/s | 148 kB 00:00
(10/43): gnome-shell-extension-dash-to-dock-79-1.fc38.noarch.rpm 617 kB/s | 195 kB 00:00
(11/43): gnome-shell-extension-disconnect-wifi-17-12.fc38.noarch.rpm 171 kB/s | 25 kB 00:00
(12/43): gnome-shell-extension-dash-to-panel-55-2.fc38.noarch.rpm 579 kB/s | 216 kB 00:00
(13/43): gnome-shell-extension-drive-menu-44.0-1.fc38.noarch.rpm 83 kB/s | 12 kB 00:00
(14/43): gnome-shell-extension-freon-45-4.20221109gitf2c0c94.fc38.noarch.rp 324 kB/s | 59 kB 00:00
(15/43): gnome-shell-extension-frippery-applications-menu-43.0-2.fc38.noarc 516 kB/s | 87 kB 00:00
(16/43): gnome-shell-extension-frippery-bottom-panel-43.0-2.fc38.noarch.rpm 756 kB/s | 145 kB 00:00
(17/43): gnome-shell-extension-frippery-move-clock-43.0-2.fc38.noarch.rpm 150 kB/s | 23 kB 00:00
(18/43): gnome-shell-extension-frippery-panel-favorites-43.0-2.fc38.noarch. 205 kB/s | 30 kB 00:00
(19/43): gnome-shell-extension-gpaste-44.0-1.fc38.noarch.rpm 109 kB/s | 17 kB 00:00
(20/43): gnome-shell-extension-gamemode-8-2.fc38.noarch.rpm 198 kB/s | 33 kB 00:00
(21/43): gnome-shell-extension-ibus-font-0.20210510-5.fc38.noarch.rpm 112 kB/s | 16 kB 00:00
(22/43): gnome-shell-extension-gsconnect-55-1.fc38.x86_64.rpm 1.2 MB/s | 331 kB 00:00
(23/43): gnome-shell-extension-just-perfection-24.0-1.fc38.noarch.rpm 672 kB/s | 118 kB 00:00
(24/43): gnome-shell-extension-launch-new-instance-44.0-1.fc38.noarch.rpm 63 kB/s | 10 kB 00:00
(25/43): gnome-shell-extension-native-window-placement-44.0-1.fc38.noarch.r 90 kB/s | 14 kB 00:00
(26/43): gnome-shell-extension-netspeed-3.32-0.7.20220421git5a96082.fc38.no 267 kB/s | 41 kB 00:00
(27/43): gnome-shell-extension-no-overview-12-3.fc38.noarch.rpm 125 kB/s | 21 kB 00:00
(28/43): gnome-shell-extension-openweather-119-2.fc38.noarch.rpm 961 kB/s | 180 kB 00:00
(29/43): gnome-shell-extension-pidgin-1.0.3-12.fc38.noarch.rpm 200 kB/s | 33 kB 00:00
(30/43): gnome-shell-extension-pop-shell-shortcut-overrides-1.2.0^10.dcf17f 72 kB/s | 9.9 kB 00:00
(31/43): gnome-shell-extension-places-menu-44.0-1.fc38.noarch.rpm 90 kB/s | 15 kB 00:00
(32/43): gnome-shell-extension-pop-shell-1.2.0^10.dcf17f3-1.fc38.noarch.rpm 603 kB/s | 101 kB 00:00
(33/43): gnome-shell-extension-refresh-wifi-6.0-12.fc38.noarch.rpm 107 kB/s | 21 kB 00:00
(34/43): gnome-shell-extension-screenshot-window-sizer-44.0-1.fc38.noarch.r 65 kB/s | 13 kB 00:00
(35/43): gnome-shell-extension-suspend-button-19-12.20171024gita812520.fc38 115 kB/s | 21 kB 00:00
(36/43): gnome-shell-extension-unite-8-13.fc38.noarch.rpm 208 kB/s | 36 kB 00:00
(37/43): gnome-shell-extension-user-theme-44.0-1.fc38.noarch.rpm 70 kB/s | 12 kB 00:00
(38/43): gnome-shell-extension-system-monitor-applet-38-22.20230326git21d7b 438 kB/s | 85 kB 00:00
(39/43): gnome-shell-extension-vertical-overview-10-2.fc38.noarch.rpm 214 kB/s | 45 kB 00:00
(40/43): gnome-shell-extension-vertical-workspaces-26-1.fc38.noarch.rpm 473 kB/s | 101 kB 00:00
(41/43): gnome-shell-extension-window-list-44.0-1.fc38.noarch.rpm 118 kB/s | 24 kB 00:00
(42/43): gnome-shell-extension-windowsNavigator-44.0-1.fc38.noarch.rpm 75 kB/s | 12 kB 00:00
(43/43): gnome-shell-extension-workspace-indicator-44.0-1.fc38.noarch.rpm 96 kB/s | 15 kB 00:00
gnome-shell-extension-argos-3^20220712git1180568-2.fc38.noarch.rpm
shell-version in metadata.json doesn't include "44"
shell-version: ["3.34","3.36","3.38","40","41","42","43"]
gnome-shell-extension-bubblemail-19-2.fc38.noarch.rpm
shell-version in metadata.json doesn't include "44"
shell-version: ["3.34","3.36","3.38","40","41","42","43"]
gnome-shell-extension-disconnect-wifi-17-12.fc38.noarch.rpm
shell-version in metadata.json doesn't include "44"
shell-version: ["3.10","3.14","3.16","3.18","3.20","3.22","3.24","3.26"]
gnome-shell-extension-freon-45-4.20221109gitf2c0c94.fc38.noarch.rpm
shell-version in metadata.json doesn't include "44"
shell-version: ["40","41","42","43"]
gnome-shell-extension-frippery-applications-menu-43.0-2.fc38.noarch.rpm
shell-version in metadata.json doesn't include "44"
shell-version: ["40","41","42","43"]
gnome-shell-extension-frippery-bottom-panel-43.0-2.fc38.noarch.rpm
shell-version in metadata.json doesn't include "44"
shell-version: ["42","43"]
gnome-shell-extension-frippery-move-clock-43.0-2.fc38.noarch.rpm
shell-version in metadata.json doesn't include "44"
shell-version: ["40","41","42","43"]
gnome-shell-extension-frippery-panel-favorites-43.0-2.fc38.noarch.rpm
shell-version in metadata.json doesn't include "44"
shell-version: ["43"]
gnome-shell-extension-gamemode-8-2.fc38.noarch.rpm
shell-version in metadata.json doesn't include "44"
shell-version: ["3.38","40","41","42","43"]
gnome-shell-extension-ibus-font-0.20210510-5.fc38.noarch.rpm
shell-version in metadata.json doesn't include "44"
shell-version: ["40"]
gnome-shell-extension-netspeed-3.32-0.7.20220421git5a96082.fc38.noarch.rpm
shell-version in metadata.json doesn't include "44"
shell-version: ["40","41","42","43"]
gnome-shell-extension-openweather-119-2.fc38.noarch.rpm
shell-version in metadata.json doesn't include "44"
shell-version: ["42","43"]
gnome-shell-extension-pidgin-1.0.3-12.fc38.noarch.rpm
shell-version in metadata.json doesn't include "44"
shell-version: ["3.10","3.11","3.12","3.14","3.16","3.18","3.20","3.21.90","3.21.91","3.22"]
gnome-shell-extension-refresh-wifi-6.0-12.fc38.noarch.rpm
shell-version in metadata.json doesn't include "44"
shell-version: ["3.10","3.14","3.16","3.18","3.20","3.22","3.24","3.26"]
gnome-shell-extension-suspend-button-19-12.20171024gita812520.fc38.noarch.rpm
shell-version in metadata.json doesn't include "44"
shell-version: ["3.10","3.12","3.14","3.16","3.18","3.20","3.22","3.24","3.26"]
gnome-shell-extension-system-monitor-applet-38-22.20230326git21d7b4e.fc38.noarch.rpm
shell-version in metadata.json doesn't include "44"
shell-version: ["3.26","3.28","3.30","3.32","3.34","3.36","40","41","42","43"]
gnome-shell-extension-unite-8-13.fc38.noarch.rpm
shell-version in metadata.json doesn't include "44"
shell-version: ["3.18","3.20","3.22","3.24","3.26"]
gnome-shell-extension-vertical-overview-10-2.fc38.noarch.rpm
shell-version in metadata.json doesn't include "44"
shell-version: ["42","43"]
SUMMARY
Support package, not an extension package (no metadata.json file) (2):
gnome-shell-extension-common-44.0-1.fc38.noarch.rpm
gnome-shell-extension-pop-shell-shortcut-overrides-1.2.0^10.dcf17f3-1.fc38.noarch.rpm
Needs updating (18):
gnome-shell-extension-argos-3^20220712git1180568-2.fc38.noarch.rpm
gnome-shell-extension-bubblemail-19-2.fc38.noarch.rpm
gnome-shell-extension-disconnect-wifi-17-12.fc38.noarch.rpm
gnome-shell-extension-freon-45-4.20221109gitf2c0c94.fc38.noarch.rpm
gnome-shell-extension-frippery-applications-menu-43.0-2.fc38.noarch.rpm
gnome-shell-extension-frippery-bottom-panel-43.0-2.fc38.noarch.rpm
gnome-shell-extension-frippery-move-clock-43.0-2.fc38.noarch.rpm
gnome-shell-extension-frippery-panel-favorites-43.0-2.fc38.noarch.rpm
gnome-shell-extension-gamemode-8-2.fc38.noarch.rpm
gnome-shell-extension-ibus-font-0.20210510-5.fc38.noarch.rpm
gnome-shell-extension-netspeed-3.32-0.7.20220421git5a96082.fc38.noarch.rpm
gnome-shell-extension-openweather-119-2.fc38.noarch.rpm
gnome-shell-extension-pidgin-1.0.3-12.fc38.noarch.rpm
gnome-shell-extension-refresh-wifi-6.0-12.fc38.noarch.rpm
gnome-shell-extension-suspend-button-19-12.20171024gita812520.fc38.noarch.rpm
gnome-shell-extension-system-monitor-applet-38-22.20230326git21d7b4e.fc38.noarch.rpm
gnome-shell-extension-unite-8-13.fc38.noarch.rpm
gnome-shell-extension-vertical-overview-10-2.fc38.noarch.rpm
Up-to-date (23):
gnome-shell-extension-appindicator-53-1.fc38.noarch.rpm
gnome-shell-extension-apps-menu-44.0-1.fc38.noarch.rpm
gnome-shell-extension-auto-move-windows-44.0-1.fc38.noarch.rpm
gnome-shell-extension-background-logo-44~beta-1.fc38.noarch.rpm
gnome-shell-extension-blur-my-shell-45-1.fc38.noarch.rpm
gnome-shell-extension-caffeine-46-1.fc38.noarch.rpm
gnome-shell-extension-dash-to-dock-79-1.fc38.noarch.rpm
gnome-shell-extension-dash-to-panel-55-2.fc38.noarch.rpm
gnome-shell-extension-drive-menu-44.0-1.fc38.noarch.rpm
gnome-shell-extension-gpaste-44.0-1.fc38.noarch.rpm
gnome-shell-extension-gsconnect-55-1.fc38.x86_64.rpm
gnome-shell-extension-just-perfection-24.0-1.fc38.noarch.rpm
gnome-shell-extension-launch-new-instance-44.0-1.fc38.noarch.rpm
gnome-shell-extension-native-window-placement-44.0-1.fc38.noarch.rpm
gnome-shell-extension-no-overview-12-3.fc38.noarch.rpm
gnome-shell-extension-places-menu-44.0-1.fc38.noarch.rpm
gnome-shell-extension-pop-shell-1.2.0^10.dcf17f3-1.fc38.noarch.rpm
gnome-shell-extension-screenshot-window-sizer-44.0-1.fc38.noarch.rpm
gnome-shell-extension-user-theme-44.0-1.fc38.noarch.rpm
gnome-shell-extension-vertical-workspaces-26-1.fc38.noarch.rpm
gnome-shell-extension-window-list-44.0-1.fc38.noarch.rpm
gnome-shell-extension-windowsNavigator-44.0-1.fc38.noarch.rpm
gnome-shell-extension-workspace-indicator-44.0-1.fc38.noarch.rpm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment