summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorsegfault <segfault@riseup.net>2018-10-20 14:32:09 +0200
committersegfault <segfault@riseup.net>2018-10-20 14:37:36 +0200
commitd72ee99922b53312f18750e34f8c33741e880dcf (patch)
tree54e264cd4ae949081e4c77df3b73ca726d087f63 /config
parentba0967fe41bb066edcb26989e2d6afd6d064d4a9 (diff)
ASP: Make code more readable (refs: #15983)
Diffstat (limited to 'config')
-rwxr-xr-xconfig/chroot_local-includes/usr/local/sbin/tails-additional-software15
1 files changed, 8 insertions, 7 deletions
diff --git a/config/chroot_local-includes/usr/local/sbin/tails-additional-software b/config/chroot_local-includes/usr/local/sbin/tails-additional-software
index 72ea74b..359a1df 100755
--- a/config/chroot_local-includes/usr/local/sbin/tails-additional-software
+++ b/config/chroot_local-includes/usr/local/sbin/tails-additional-software
@@ -472,17 +472,18 @@ def apt_hook_post():
packages = json.load(f)
os.remove(ASP_STATE_PACKAGES)
- additional_packages_names = set(map(
- filter_package_details,
- get_additional_packages(search_new_persistence=True)))
+ additional_packages_names = {
+ filter_package_details(pkg) for pkg in get_additional_packages(search_new_persistence=True)
+ }
apt_cache = apt.cache.Cache()
# Filter automatically installed packages and packages already configured
# as additional software
- new_manually_installed_packages = set(filter(
- lambda pkg: not apt_cache[pkg].is_auto_installed
- and pkg not in additional_packages_names, # NOQA: E131
- set(packages["installed"])))
+ new_manually_installed_packages = {
+ pkg for pkg in packages["installed"] if not apt_cache[pkg].is_auto_installed and
+ pkg not in additional_packages_names
+ }
+
if new_manually_installed_packages:
handle_installed_packages(new_manually_installed_packages)