diff options
author | Laurentiu Palcu <laurentiu.palcu@intel.com> | 2014-01-28 10:24:22 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-02-11 11:53:43 +0000 |
commit | 65a28699c80595240b8c0c94582593c133ac242c (patch) | |
tree | adc4c36fa594b53907757af7da2979a1a527c49a | |
parent | 4a6596d95f0483891de4d2529303ddce343bb4f4 (diff) | |
download | poky-65a28699c80595240b8c0c94582593c133ac242c.tar.gz |
lib/oe/package_manager.py: RpmPM fixes
This commit:
* fixes a crash when handling interecept hook failures which happened when
MULTILIB_GLOBAL_VARIANTS was not set;
* convert dashes to underscores and use sets (so that we make sure the
items are unique) when creating RPM repos;
* uses a regex pattern to search for packages in the feeds list. The
old method could match also strings in the middle. For example: 'rpm'
matched 'kernel-module-lttng-probe-rpm" in qemux86_64 feeds;
* issue a bb.fatal if smart returns error while installing packages.
Otherwise we might end up with an incomplete image...
* fixes the /etc/rpm/platform file creation;
(From OE-Core rev: b98c7e4945f1c36a6e4f98144a3af4f3049450ae)
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oe/package_manager.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py index 139a6211ee..8a58d611be 100644 --- a/meta/lib/oe/package_manager.py +++ b/meta/lib/oe/package_manager.py | |||
@@ -251,7 +251,9 @@ class RpmPM(PackageManager): | |||
251 | for arch in feed_archs: | 251 | for arch in feed_archs: |
252 | arch = arch.replace('-', '_') | 252 | arch = arch.replace('-', '_') |
253 | for p in self.fullpkglist: | 253 | for p in self.fullpkglist: |
254 | if pkg in p and '@' + arch in p: | 254 | regex_match = r"^%s-[^-]*-[^-]*@%s$" % \ |
255 | (re.escape(pkg), re.escape(arch)) | ||
256 | if re.match(regex_match, p) is not None: | ||
255 | # First found is best match | 257 | # First found is best match |
256 | # bb.note('%s -> %s' % (pkg, pkg + '@' + arch)) | 258 | # bb.note('%s -> %s' % (pkg, pkg + '@' + arch)) |
257 | return pkg + '@' + arch | 259 | return pkg + '@' + arch |
@@ -328,7 +330,7 @@ class RpmPM(PackageManager): | |||
328 | platform_fd.write(platform + '\n') | 330 | platform_fd.write(platform + '\n') |
329 | for pt in platform_extra: | 331 | for pt in platform_extra: |
330 | channel_priority += 5 | 332 | channel_priority += 5 |
331 | platform_fd.write(pt + '.*\n') | 333 | platform_fd.write(re.sub("-linux.*$", "-linux.*\n", pt)) |
332 | 334 | ||
333 | # Tell RPM that the "/" directory exist and is available | 335 | # Tell RPM that the "/" directory exist and is available |
334 | bb.note("configuring RPM system provides") | 336 | bb.note("configuring RPM system provides") |
@@ -512,9 +514,8 @@ class RpmPM(PackageManager): | |||
512 | output = subprocess.check_output(cmd.split()) | 514 | output = subprocess.check_output(cmd.split()) |
513 | bb.note(output) | 515 | bb.note(output) |
514 | except subprocess.CalledProcessError as e: | 516 | except subprocess.CalledProcessError as e: |
515 | if not attempt_only: | 517 | bb.fatal("Unable to install packages. Command %s " |
516 | bb.note("Unable to install packages. Command %s " | 518 | "returned %d" % (cmd, e.returncode)) |
517 | "returned %d" % (cmd, e.returncode)) | ||
518 | 519 | ||
519 | ''' | 520 | ''' |
520 | Remove pkgs with smart, the pkg name is smart/rpm format | 521 | Remove pkgs with smart, the pkg name is smart/rpm format |
@@ -551,16 +552,14 @@ class RpmPM(PackageManager): | |||
551 | self._invoke_smart('upgrade') | 552 | self._invoke_smart('upgrade') |
552 | 553 | ||
553 | def write_index(self): | 554 | def write_index(self): |
554 | arch_list = list() | 555 | arch_list = set() |
555 | for mlib in self.ml_prefix_list: | 556 | for mlib in self.ml_prefix_list: |
556 | for arch in self.ml_prefix_list[mlib]: | 557 | for arch in self.ml_prefix_list[mlib]: |
557 | if arch not in arch_list: | 558 | if arch not in arch_list: |
558 | arch_list.append(arch) | 559 | arch_list.add(arch.replace('-', '_')) |
559 | 560 | ||
560 | sdk_pkg_archs = self.d.getVar('SDK_PACKAGE_ARCHS', True) | 561 | sdk_pkg_archs = (self.d.getVar('SDK_PACKAGE_ARCHS', True) or "").replace('-', '_') |
561 | if sdk_pkg_archs is not None: | 562 | arch_list = arch_list.union(set(sdk_pkg_archs.split())) |
562 | arch_list += [i.replace('-', '_') for i in sdk_pkg_archs.split() | ||
563 | if i.replace('-', '_') not in arch_list] | ||
564 | 563 | ||
565 | rpm_createrepo = bb.utils.which(os.getenv('PATH'), "createrepo") | 564 | rpm_createrepo = bb.utils.which(os.getenv('PATH'), "createrepo") |
566 | index_cmds = [] | 565 | index_cmds = [] |
@@ -730,7 +729,8 @@ class RpmPM(PackageManager): | |||
730 | return | 729 | return |
731 | 730 | ||
732 | def save_rpmpostinst(self, pkg): | 731 | def save_rpmpostinst(self, pkg): |
733 | mlibs = self.d.getVar('MULTILIB_GLOBAL_VARIANTS').split() | 732 | mlibs = (self.d.getVar('MULTILIB_GLOBAL_VARIANTS') or "").split() |
733 | |||
734 | new_pkg = pkg | 734 | new_pkg = pkg |
735 | # Remove any multilib prefix from the package name | 735 | # Remove any multilib prefix from the package name |
736 | for mlib in mlibs: | 736 | for mlib in mlibs: |