Browse Source

claudia_launcher: Gracefully handle empty result from dpkg --get-selections

pull/362/head
Nedko Arnaudov 1 year ago
parent
commit
08a8f78727
1 changed files with 5 additions and 3 deletions
  1. +5
    -3
      src/claudia_launcher.py

+ 5
- 3
src/claudia_launcher.py View File

@@ -699,9 +699,11 @@ class ClaudiaLauncher(QWidget, ui_claudia_launcher.Ui_ClaudiaLauncherW):
elif os.path.exists("/usr/bin/dpkg"):
pkg_out = getoutput("env LANG=C LC_ALL=C /usr/bin/dpkg --get-selections 2>/dev/null").split("\n")
for pkg_info in pkg_out:
package, installed = pkg_info.rsplit("\t", 1)
if installed == "install":
pkglist.append(package.strip())
pkg_info = pkg_info.strip()
if pkg_info:
package, installed = pkg_info.rsplit("\t", 1)
if installed == "install":
pkglist.append(package.strip())

elif os.path.exists("/bin/rpm"):
pkg_out = getoutput("env LANG=C /bin/rpm -qa --qf \"%{NAME}\n\" 2>/dev/null").split("\n")


Loading…
Cancel
Save