reformat rpm name string to be more flexible
authorGui Chen <gui.chen@intel.com>
Sun, 20 Jan 2013 11:54:31 +0000 (19:54 +0800)
committerGui Chen <gui.chen@intel.com>
Mon, 21 Jan 2013 17:38:01 +0000 (01:38 +0800)
Change-Id: I5f735ad31ef7dd3a8c2a23eb31b6bca22aaa4f0f
Signed-off-by: Gui Chen <gui.chen@intel.com>
mic/utils/misc.py
plugins/backend/yumpkgmgr.py
plugins/backend/zypppkgmgr.py

index 31bf00e..ead3fe0 100644 (file)
@@ -49,7 +49,7 @@ import runner
 from mic import msger
 
 RPM_RE  = re.compile("(.*)\.(.*) (.*)-(.*)")
-RPM_FMT = "%(name)s.%(arch)s %(ver_rel)s"
+RPM_FMT = "%(name)s.%(arch)s %(version)s-%(release)s"
 SRPM_RE = re.compile("(.*)-(\d+.*)-(\d+\.\d+).src.rpm")
 
 def build_name(kscfg, release=None, prefix = None, suffix = None):
index 6a94631..2bba9f8 100644 (file)
@@ -356,7 +356,8 @@ class Yum(BackendPlugin, yum.YumBase):
             pkg_long_name = misc.RPM_FMT % {
                                 'name': pkg.name,
                                 'arch': pkg.arch,
-                                'ver_rel': pkg.printVer(),
+                                'version': pkg.version,
+                                'release': pkg.release
                             }
             self.__pkgs_content[pkg_long_name] = pkg.files
             license = pkg.license
index 48894b2..54186d9 100755 (executable)
@@ -417,8 +417,8 @@ class Zypp(BackendPlugin):
                 pkg_long_name = misc.RPM_FMT % {
                                     'name': hdr['name'],
                                     'arch': hdr['arch'],
-                                    'ver_rel': '%s-%s' % (hdr['version'],
-                                                          hdr['release']),
+                                    'version': hdr['version'],
+                                    'release': hdr['release']
                                 }
                 license = hdr['license']
 
@@ -426,7 +426,8 @@ class Zypp(BackendPlugin):
                 pkg_long_name = misc.RPM_FMT % {
                                     'name': pkg.name(),
                                     'arch': pkg.arch(),
-                                    'ver_rel': pkg.edition(),
+                                    'version': pkg.edition().version(),
+                                    'release': pkg.edition().release()
                                 }
 
                 package = zypp.asKindPackage(pkg)