[elbe-devel] [PATCH 11/11] elbepack: virtapt: don't ignore exceptions
Thomas Weißschuh
thomas.weissschuh at linutronix.de
Thu Aug 1 17:53:08 CEST 2024
While the errors are reported, the program continues as if nothing
happened. The result will be wrong.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
elbepack/virtapt.py | 21 ++++++---------------
1 file changed, 6 insertions(+), 15 deletions(-)
diff --git a/elbepack/virtapt.py b/elbepack/virtapt.py
index 207f105e33b9..704f9909472a 100644
--- a/elbepack/virtapt.py
+++ b/elbepack/virtapt.py
@@ -72,25 +72,16 @@ class VirtApt:
self.source = apt_pkg.SourceList()
self.source.read_main_list()
self.cache = apt_pkg.Cache()
- try:
- self.cache.update(progress, self.source)
- except BaseException as e:
- print(e)
+ self.cache.update(progress, self.source)
apt_pkg.config.set('APT::Default-Release', suite)
self.cache = apt_pkg.Cache()
- try:
- self.cache.update(progress, self.source)
- except BaseException as e:
- print(e)
-
- try:
- self.depcache = apt_pkg.DepCache(self.cache)
- prefs_name = self.basefs.fname('/etc/apt/preferences')
- self.depcache.read_pinfile(prefs_name)
- except BaseException as e:
- print(e)
+ self.cache.update(progress, self.source)
+
+ self.depcache = apt_pkg.DepCache(self.cache)
+ prefs_name = self.basefs.fname('/etc/apt/preferences')
+ self.depcache.read_pinfile(prefs_name)
self.downloads = {}
self.acquire = apt_pkg.Acquire(progress)
--
2.45.2
More information about the elbe-devel
mailing list