Skip to content

Commit

Permalink
Check the installed package instead of from ubuntu-archive (bugfix)
Browse files Browse the repository at this point in the history
[p/b/b/check-ubuntu-desktop-recommends.sh] (LP: #2027655)
  • Loading branch information
Jeremy Szu committed Oct 20, 2023
1 parent 0abe030 commit 82b350f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion providers/base/bin/check-ubuntu-desktop-recommends.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ set -euo pipefail
IFS=$'\n\t'

noninstalled=()
target_version="$(dpkg-query --showformat='${Version}' --show ubuntu-desktop)"
apt_show_ud="$(apt-cache show ubuntu-desktop="$target_version")"
recommends="$(echo "${apt_show_ud}"| grep ^Recommends | head -n 1)"
while read -r pkg; do
# libreoffice-impress provides libreoffice-ogltrans, and libreoffice-ogltrans becomes a transitional package on Ubuntu 20.04.
# shellcheck disable=SC2016
if ! dpkg-query -W -f='${Status}\n' "$pkg" 2>&1 | grep "install ok installed" >/dev/null 2>&1 && [ "$pkg" != "libreoffice-ogltrans" ]; then
noninstalled+=("$pkg")
fi
done < <(apt-cache show ubuntu-desktop | grep ^Recommends | head -n 1 | cut -d : -f 2- | xargs | sed 's/ //g' | tr , $'\n')
done < <(echo "$recommends"| cut -d : -f 2-| xargs| sed 's/ //g'| tr , $'\n')

if [ -n "${noninstalled[*]}" ]; then
IFS=' '
Expand Down

0 comments on commit 82b350f

Please sign in to comment.