summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorKévin THIERRY <kevin.thierry@open.eurogiciel.org>2014-09-08 12:58:19 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-09-10 11:33:22 +0100
commite7a78bdc9715ed82541d5b8308d5cc4656ce58dd (patch)
treefb3f50ad44904ddabff581ffb6c0961f7b78fa58 /meta
parent1894522f357fdf0b6adb2dcc14f12817628596bd (diff)
downloadpoky-e7a78bdc9715ed82541d5b8308d5cc4656ce58dd.tar.gz
package_manager: RpmPkgsList: determine rpm version
Do not set the rpm_version to 5 if it is not provided, instead determine the real rpm version. (From OE-Core rev: 48beaee2e5b2b4ae35c596c19f8a38e0ff4427e9) (From OE-Core rev: fe4ad726d0dc63be73f885598e216b8eb927668a) Signed-off-by: Kévin THIERRY <kevin.thierry@open.eurogiciel.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oe/package_manager.py23
1 files changed, 11 insertions, 12 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 86cef02d77..a1ac6eb5fd 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -210,7 +210,7 @@ class PkgsList(object):
210 210
211 211
212class RpmPkgsList(PkgsList): 212class RpmPkgsList(PkgsList):
213 def __init__(self, d, rootfs_dir, arch_var=None, os_var=None, rpm_version=5): 213 def __init__(self, d, rootfs_dir, arch_var=None, os_var=None):
214 super(RpmPkgsList, self).__init__(d, rootfs_dir) 214 super(RpmPkgsList, self).__init__(d, rootfs_dir)
215 215
216 self.rpm_cmd = bb.utils.which(os.getenv('PATH'), "rpm") 216 self.rpm_cmd = bb.utils.which(os.getenv('PATH'), "rpm")
@@ -219,7 +219,14 @@ class RpmPkgsList(PkgsList):
219 self.ml_prefix_list, self.ml_os_list = \ 219 self.ml_prefix_list, self.ml_os_list = \
220 RpmIndexer(d, rootfs_dir).get_ml_prefix_and_os_list(arch_var, os_var) 220 RpmIndexer(d, rootfs_dir).get_ml_prefix_and_os_list(arch_var, os_var)
221 221
222 self.rpm_version = rpm_version 222 # Determine rpm version
223 cmd = "%s --version" % self.rpm_cmd
224 try:
225 output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
226 except subprocess.CalledProcessError as e:
227 bb.fatal("Getting rpm version failed. Command '%s' "
228 "returned %d:\n%s" % (cmd, e.returncode, e.output))
229 self.rpm_version = int(output.split()[-1].split('.')[0])
223 230
224 ''' 231 '''
225 Translate the RPM/Smart format names to the OE multilib format names 232 Translate the RPM/Smart format names to the OE multilib format names
@@ -564,17 +571,9 @@ class RpmPM(PackageManager):
564 if not os.path.exists(self.d.expand('${T}/saved')): 571 if not os.path.exists(self.d.expand('${T}/saved')):
565 bb.utils.mkdirhier(self.d.expand('${T}/saved')) 572 bb.utils.mkdirhier(self.d.expand('${T}/saved'))
566 573
567 # Determine rpm version
568 cmd = "%s --version" % self.rpm_cmd
569 try:
570 output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
571 except subprocess.CalledProcessError as e:
572 bb.fatal("Getting rpm version failed. Command '%s' "
573 "returned %d:\n%s" % (cmd, e.returncode, e.output))
574 self.rpm_version = int(output.split()[-1].split('.')[0])
575
576 self.indexer = RpmIndexer(self.d, self.deploy_dir) 574 self.indexer = RpmIndexer(self.d, self.deploy_dir)
577 self.pkgs_list = RpmPkgsList(self.d, self.target_rootfs, arch_var, os_var, self.rpm_version) 575 self.pkgs_list = RpmPkgsList(self.d, self.target_rootfs, arch_var, os_var)
576 self.rpm_version = self.pkgs_list.rpm_version
578 577
579 self.ml_prefix_list, self.ml_os_list = self.indexer.get_ml_prefix_and_os_list(arch_var, os_var) 578 self.ml_prefix_list, self.ml_os_list = self.indexer.get_ml_prefix_and_os_list(arch_var, os_var)
580 579