[elbe-devel] [PATCH 06/13] implement version check for pinned packages

Manuel Traut manut at linutronix.de
Thu Sep 28 23:59:54 CEST 2017


currently we don't detect if a version pinned package was installed in a
different version. this adds a check for this case and inserts an entry
in validation.txt if a version missmatch was detected.

Signed-off-by: Manuel Traut <manut at linutronix.de>
---
 elbepack/dump.py | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/elbepack/dump.py b/elbepack/dump.py
index 98ab2a5d..45669ec1 100644
--- a/elbepack/dump.py
+++ b/elbepack/dump.py
@@ -93,8 +93,8 @@ def check_full_pkgs(pkgs, fullpkgs, errorname, cache):
 
     errors = 0
 
-    for name in [p.et.text for p in pkgs]:
-
+    for p in pkgs:
+        name = p.et.text
         nomulti_name = name.split(":")[0]
         if not cache.has_pkg(nomulti_name):
             elog.printo( "- package %s does not exist" % nomulti_name )
@@ -106,6 +106,13 @@ def check_full_pkgs(pkgs, fullpkgs, errorname, cache):
             errors += 1
             continue
 
+        ver  = p.et.get('version')
+        pkg = cache.get_pkg(name)
+        if ver and (pkg.installed_version != ver):
+            elog.printo( "- package %s version %s does not match installed version %s" % (name, ver,  pkg.installed_version) )
+            errors += 1
+            continue
+
     if errors == 0:
         elog.printo( "No Errors found" )
 
-- 
2.14.1




More information about the elbe-devel mailing list