Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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