Skip to content

Commit

Permalink
Add an ignore list to the appstream checker script (#3120)
Browse files Browse the repository at this point in the history
**Summary**

This PR gives the appstream progress checker the ability to ignore a
list of packages, which is provided by
common/Scripts/appstream_ignored_packages.txt. It also contains a
starting point for that list of ignored packages.

**Test Plan**

1. Run `go-task check-appstream-progress` within the repo.
2. Make note of how many packages are reported as needing appstream
data.
3. Check out this PR.
4. Run `go-task check-appstream-progress` again.
5. Note the abrupt decrease in packages reported as needing appstream
data.
  • Loading branch information
malfisya authored Jul 1, 2024
2 parents 1a623b3 + 2de33be commit accf04e
Show file tree
Hide file tree
Showing 2 changed files with 124 additions and 2 deletions.
89 changes: 89 additions & 0 deletions common/Scripts/appstream_ignored_packages.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Add packages to be ignored by the appstream checker here.
# Comments in this file must be on a separate line and start with a # character.
# Blank lines are meaningless to the parser, and can be used to separate categories of packages.

# Plasma Internals
polkit-kde-agent
plasma-thunderbolt
powerdevil
akonadi-import-wizard
sddm-kcm
colord-kde
flatpak-kcm
kaccounts-integration
kf6-kded
klayout
kf6-kguiaddons
kf6-knewstuff
kded
kdepim-runtime
knewstuff
kio
kf6-kio
kwin
kf6-kwallet
kio-extras
kmail-account-wizard
drkonqi
plasma-browser-integration

# If you need it, it's already installed
calamares
lightdm-settings
lightdm-gtk-greeter-settings
libgtk-3
libkcddb
linux-steam-integration
pinentry
qt5-tools
qt6-tools
hwloc
snapd
solus-mate-transition-tool
stoken
xdg-desktop-portal-gtk
xdg-desktop-portal-xapp
xdg-desktop-portal-kde
xdg-desktop-portal-gnome
xorg-xwayland
v4l-utils
evolution-data-server
doflicky
ibus

# XFCE Internals
libxfce4ui
xfwm4
xfce4-settings
xfdesktop
xfce4-session
xfce4-notifyd
xfce4-screensaver
xfce4-panel
xfce4-settings


# GNOME Internals
libgnomekbd
gnome-online-accounts-gtk
gnome-online-accounts
gnome-remote-desktop
gnome-browser-connector
gnome-bluetooth

# Budgie Internals
gnome-bluetooth-1
budgie-desktop
budgie-screensaver
budgie-desktop-view

# MATE Internals
mate-screensaver
mate-media
mate-control-center
mate-desktop
mate-user-guide
mate-notification-daemon
mate-panel
mate-session-manager
mate-power-manager
37 changes: 35 additions & 2 deletions common/Scripts/check_appstream_progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,33 @@
pathlib.Path("/usr/share/appdata"),
]

IGNORE_LIST_PATH = pathlib.Path.joinpath(
pathlib.Path(__file__).parent, "appstream_ignored_packages.txt"
)


def main():
parser = argparse.ArgumentParser(
prog="check_appstream_progress",
description="Scan either the whole Solus packages repo or a single pspec.xml "
"to check for .desktop files and appstream metadata.",
"to check for .desktop files and appstream metadata."
"Place the names of packages to be ignored (such as internal pieces of desktop environments,"
" for example) in a file called 'appstream_ignored_packages.txt' next to this script.",
formatter_class=argparse.RawTextHelpFormatter,
)
parser.add_argument(
"--package-names-only",
action="store_true",
dest="package_names_only",
default=False,
help="Output only the names of packages which need appstream metainfo added to them",
help="Output only the names of packages which need appstream metainfo added to them, suppressing info messages",
)
parser.add_argument(
"--no-ignorelist",
action="store_true",
dest="no_ignorelist",
default=False,
help="Report all packages, even if they are present in appstream_ignored_packages.txt",
)
parser.add_argument(
"packages_or_pspec_path",
Expand All @@ -48,6 +61,26 @@ def main():
if not args.package_names_only:
print("Directory detected, scanning whole repository...")
repo_info = check_whole_repo(pathlib.Path(sys.argv[1]))
if not args.no_ignorelist:
if os.path.isfile(IGNORE_LIST_PATH):
with open(IGNORE_LIST_PATH, "r") as ignore_file:
if not args.package_names_only:
print(f"Ignoring packages in {IGNORE_LIST_PATH}")
ignore_list = [
package
for package in ignore_file.read().splitlines()
if not package.startswith("#")
]
repo_info["problematic_packages"] = [
package
for package in repo_info["problematic_packages"]
if package not in ignore_list
]
else:
if not args.package_names_only:
print(
f"WARNING: No ignore list file detected at {IGNORE_LIST_PATH}"
)
if not args.package_names_only:
print(
f'Count of packages shipping .desktop file: {len(repo_info["packages_with_desktop_file"])}'
Expand Down

0 comments on commit accf04e

Please sign in to comment.