Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 4 additions & 2 deletions providers/base/bin/check-ubuntu-desktop-recommends.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@
set -euo pipefail
IFS=$'\n\t'

target_package=${1:-ubuntu-desktop}

noninstalled=()
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 < <(apt-cache show "${target_package}" | grep ^Recommends | head -n 1 | cut -d : -f 2- | xargs | sed 's/ //g' | tr , $'\n')

if [ -n "${noninstalled[*]}" ]; then
IFS=' '
echo "${noninstalled[*]} are not installed."
exit 1
fi

echo "All packages in Recommends of ubuntu-desktop are installed."
echo "All packages in Recommends of ${target_package} are installed."
exit 0
13 changes: 10 additions & 3 deletions providers/base/units/miscellanea/jobs.pxu
Original file line number Diff line number Diff line change
Expand Up @@ -486,12 +486,19 @@ _description: Verify installed Debian package files against MD5 checksum lists f

plugin: shell
category_id: com.canonical.plainbox::miscellanea
estimated_duration: 60
estimated_duration: 1
id: miscellanea/ubuntu-desktop-recommends
requires: package.name == 'ubuntu-desktop'
command: check-ubuntu-desktop-recommends.sh
_summary: Check if Debian packages in Recommends of ubuntu-desktop are installed
_description: Check if Debian packages in Recommends of ubuntu-desktop are installed
_summary: Check that all the recommended packages for ubuntu-desktop are installed

plugin: shell
category_id: com.canonical.plainbox::miscellanea
estimated_duration: 1
id: miscellanea/ubuntu-desktop-minimal-recommends
requires: package.name == 'ubuntu-desktop-minimal'
command: check-ubuntu-desktop-recommends.sh ubuntu-desktop-minimal
_summary: Check that all the recommended packages for ubuntu-desktop-minimal are installed

plugin: shell
category_id: com.canonical.plainbox::miscellanea
Expand Down