[elbe-devel] [PATCH 5/6] elbepack: check_updates: use helper for boolean attributes

Thomas Weißschuh thomas.weissschuh at linutronix.de
Tue May 28 10:26:25 CEST 2024


Both "true" and "1" are valid values. Use the helper to recognize both.

Also drop the always useless assignment to pauto later.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 elbepack/commands/check_updates.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/elbepack/commands/check_updates.py b/elbepack/commands/check_updates.py
index 8f391d40fe56..270f137da1fa 100644
--- a/elbepack/commands/check_updates.py
+++ b/elbepack/commands/check_updates.py
@@ -78,9 +78,8 @@ def run_command(argv):
 
     for p in fullp:
         pname = p.et.text
-        pauto = p.et.get('auto')
 
-        if pauto != 'true':
+        if p.bool_attr('auto'):
             v.mark_install(pname)
 
     errors = 0
@@ -91,7 +90,6 @@ def run_command(argv):
     for p in fullp:
         xp = XMLPackage(p, arch)
         pname = p.et.text
-        pauto = p.et.get('auto')
 
         if not v.has_pkg(xp.name):
             if not xp.is_auto_installed:

-- 
2.45.1



More information about the elbe-devel mailing list