[elbe-devel] [PATCH 3/5] elbepack: aptpkgutils: cleanup attribute handling in APTPackage

Thomas Weißschuh thomas.weissschuh at linutronix.de
Wed Nov 13 13:18:33 CET 2024


self.state and self.is_auto_installed are overridden in the parent
construct anyways, so their assignment is pointless.
THe local variable origin can be moved into the constructor invocation.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 elbepack/aptpkgutils.py | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/elbepack/aptpkgutils.py b/elbepack/aptpkgutils.py
index 448906c3c88ff7ee0b9656582ea8a45b37a7c089..2818818cea34b32e439b4ffc2a66998ecc991c56 100644
--- a/elbepack/aptpkgutils.py
+++ b/elbepack/aptpkgutils.py
@@ -253,10 +253,6 @@ class APTPackage(PackageBase):
         iarch = pkg.installed and pkg.installed.architecture
         carch = pkg.candidate and pkg.candidate.architecture
 
-        self.state = pkgstate(pkg)
-        self.is_auto_installed = pkg.is_auto_installed
-        origin = pkgorigin(pkg)
-
         if pkg.installed:
             self.installed_deb = os.path.basename(pkg.installed.filename)
         else:
@@ -267,8 +263,9 @@ class APTPackage(PackageBase):
                          ihashes, chashes,
                          iprio, cprio,
                          iarch, carch,
-                         pkgstate(pkg), pkg.is_auto_installed,
-                         origin)
+                         pkgstate(pkg),
+                         pkg.is_auto_installed,
+                         pkgorigin(pkg))
 
 
 class XMLPackage(PackageBase):

-- 
2.47.0



More information about the elbe-devel mailing list