From 87b6aac2018b337753d68d329f6c3b6ca77ddefb Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Sat, 13 Apr 2019 12:02:56 +0000 Subject: [PATCH] comps-sync: Blacklist PackageKit globally We were trying to be accurate by filtering by group but PackageKit is spread across all of them and has various subpackages, so just add a global regexp-based blacklist. This doesn't actually drop PK yet because `gnome-software` hard requires it, but is prep for fixing that. --- comps-sync-blacklist.yml | 7 ++++--- comps-sync.py | 16 ++++++++++++---- fedora-common-ostree-pkgs.yaml | 1 - 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/comps-sync-blacklist.yml b/comps-sync-blacklist.yml index 4528c4e..c886fa3 100644 --- a/comps-sync-blacklist.yml +++ b/comps-sync-blacklist.yml @@ -13,6 +13,10 @@ blacklist_groups: - gnome-desktop - container-management +# PackageKit is spread across various groups +blacklist_all_regexp: + - "PackageKit.*" + # Common blacklist for all ostree desktop versions blacklist: core: @@ -107,9 +111,6 @@ desktop_blacklist: gnome-desktop: # https://github.com/pbrezina/authselect/issues/48 - fprintd-pam - # We use rpm-ostree for the host - - PackageKit-command-not-found - - PackageKit-gtk3-module # Non-critical apps -> Flatpak - baobab - cheese diff --git a/comps-sync.py b/comps-sync.py index fb5659c..38937c4 100755 --- a/comps-sync.py +++ b/comps-sync.py @@ -5,7 +5,7 @@ # which are not mentioned in comps, and add packages from # comps. -import os, sys, subprocess, argparse, shlex, json, yaml +import os, sys, subprocess, argparse, shlex, json, yaml, re import libcomps def fatal(msg): @@ -49,6 +49,13 @@ with open('comps-sync-blacklist.yml') as f: comps_whitelist = doc['whitelist'] comps_blacklist_groups = doc['blacklist_groups'] comps_desktop_blacklist = doc['desktop_blacklist'] + comps_blacklist_all = [re.compile(x) for x in doc['blacklist_all_regexp']] + +def is_blacklisted(pkgname): + for br in comps_blacklist_all: + if br.match(pkgname): + return True + return False # Parse comps, and build up a set of all packages so we # can find packages not listed in comps *at all*, beyond @@ -72,7 +79,7 @@ for gid in ws_environ.group_ids: if pkg.type not in (libcomps.PACKAGE_TYPE_DEFAULT, libcomps.PACKAGE_TYPE_MANDATORY): continue - if pkgname in blacklist: + if pkgname in blacklist or is_blacklisted(pkgname): continue pkgdata = ws_pkgs.get(pkgname) if pkgdata is None: @@ -84,7 +91,8 @@ for gid in ws_environ.group_ids: ws_ostree_pkgs = set() for pkg in comps.groups_match(id=ws_ostree_name)[0].packages: - ws_ostree_pkgs.add(pkg.name) + if not is_blacklisted(pkg.name): + ws_ostree_pkgs.add(pkg.name) comps_unknown = set() for pkg in manifest_packages: @@ -137,7 +145,7 @@ for desktop in [ 'gnome-desktop', 'kde-desktop', 'xfce-desktop', 'lxqt-desktop', for pkg in comps.groups_match(id=desktop)[0].packages: pkgname = pkg.name blacklist = comps_desktop_blacklist.get(desktop, set()) - if pkgname in blacklist: + if pkgname in blacklist or is_blacklisted(pkgname): continue comps_group_pkgs.add(pkg.name) diff --git a/fedora-common-ostree-pkgs.yaml b/fedora-common-ostree-pkgs.yaml index 255f7e3..6b66bcb 100644 --- a/fedora-common-ostree-pkgs.yaml +++ b/fedora-common-ostree-pkgs.yaml @@ -5,7 +5,6 @@ packages: - NetworkManager-config-connectivity-fedora - NetworkManager-wifi - NetworkManager-wwan - - PackageKit-gstreamer-plugin - aajohan-comfortaa-fonts - abattis-cantarell-fonts - acl