Skip to contentSkip to conversation

fix package archs ordering for RPM

PATCH In review Laurentiu Palcu 3 participants 6 messages Mar 3, 2014 – Mar 4, 2014

lore
Share & tools
lore
#0 lore raw

cover fix package archs ordering for RPM

This got messed up by me trying to fix a multilib problem using python sets. Unfortunately sets do not keep the initial ordering and an image might end up containing packages meant for other architectures... So, revert the offending commit and fix the original issue by just checking if a channel was already added or not.

laurentiu

The following changes since commit 8f36e1ef1afd10594391596391564e8904a840f2:

poky.conf: add CentOS 6.5 to SANITY_TESTED_DISTROS (2014-02-28 18:05:47 +0000)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib lpalcu/b5890_rpm_pkg_arch_selection_logic_fix
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=lpalcu/b5890_rpm_pkg_arch_selection_logic_fix

Laurentiu Palcu (2):
Revert "lib/oe/package_manager.py: RpmPM: fix issue with multilib
builds"
package_manager.py: RpmPM: don't add smart channel if already added

 meta/lib/oe/package_manager.py |   19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/2 Revert "lib/oe/package_manager.py: RpmPM: fix issue with multilib builds"

Converting a list to a set does not keep the order of the items, as they were added, which might result in the wrong packages being installed in the final image...

This reverts commit 12f47c23df8c109676f66d580d666a3147f3b046.

[YOCTO #5890]

---
 meta/lib/oe/package_manager.py |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
meta/lib/oe/package_manager.py +7 -6
index ff4f1de..6c133c3 100644
@@ -368,18 +368,19 @@ class RpmPM(PackageManager):
                                 self.ml_os_list['default'])
 
         # List must be prefered to least preferred order
-        default_platform_extra = set()
-        platform_extra = set()
+        default_platform_extra = list()
+        platform_extra = list()
         bbextendvariant = self.d.getVar('BBEXTENDVARIANT', True) or ""
         for mlib in self.ml_os_list:
             for arch in self.ml_prefix_list[mlib]:
                 plt = arch.replace('-', '_') + '-.*-' + self.ml_os_list[mlib]
                 if mlib == bbextendvariant:
-                        default_platform_extra.add(plt)
+                    if plt not in default_platform_extra:
+                        default_platform_extra.append(plt)
                 else:
-                        platform_extra.add(plt)
-
-        platform_extra = platform_extra.union(default_platform_extra)
+                    if plt not in platform_extra:
+                        platform_extra.append(plt)
+        platform_extra = default_platform_extra + platform_extra
 
         self._create_configs(platform, platform_extra)
 
Signature · 1 line
1.7.9.5
Acked-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] Revert "lib/oe/package_manager.py: RpmPM: fix issue with multilib builds"

Quoted 15 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Laurentiu Palcu
Sent: Monday, March 03, 2014 1:44 AM
To: [email protected]
Subject: [OE-core] [PATCH 1/2] Revert "lib/oe/package_manager.py:
RpmPM: fix issue with multilib builds"

Converting a list to a set does not keep the order of the items, as they were added, which might result in the wrong packages being installed in the final image...

Quoted 5 lines

This reverts commit 12f47c23df8c109676f66d580d666a3147f3b046.

[YOCTO #5890]

This resolves the packaging issues I was seeing.
Thanks,
Nitin

Quoted 41 lines
---
 meta/lib/oe/package_manager.py |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
(quoted diff) +0 -0

b/meta/lib/oe/package_manager.py index ff4f1de..6c133c3 100644

meta/lib/oe/package_manager.py +7 -7
@@ -368,18 +368,19 @@ class RpmPM(PackageManager):
                                 self.ml_os_list['default'])
 
         # List must be prefered to least preferred order
-        default_platform_extra = set()
-        platform_extra = set()
+        default_platform_extra = list()
+        platform_extra = list()
         bbextendvariant = self.d.getVar('BBEXTENDVARIANT', True) or ""
         for mlib in self.ml_os_list:
             for arch in self.ml_prefix_list[mlib]:
                 plt = arch.replace('-', '_') + '-.*-' + self.ml_os_list[mlib]
                 if mlib == bbextendvariant:
-                        default_platform_extra.add(plt)
+                    if plt not in default_platform_extra:
+                        default_platform_extra.append(plt)
                 else:
-                        platform_extra.add(plt)
-
-        platform_extra = platform_extra.union(default_platform_extra)
+                    if plt not in platform_extra:
+                        platform_extra.append(plt)
+        platform_extra = default_platform_extra + platform_extra
 
         self._create_configs(platform, platform_extra)
 
--

1.7.9.5

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#3 lore raw

PATCH 2/2 package_manager.py: RpmPM: don't add smart channel if already added

In reply to Laurentiu Palcu

Make sure the channel was not already added, before attempting to add.

[YOCTO #5890]

---
 meta/lib/oe/package_manager.py |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
meta/lib/oe/package_manager.py +4 -2
index 6c133c3..ee42952 100644
@@ -604,11 +604,11 @@ class RpmPM(PackageManager):
         # self._invoke_smart('config --set rpm-log-level=debug')
         # cmd = 'config --set rpm-log-file=/tmp/smart-debug-logfile'
         # self._invoke_smart(cmd)
-
+        ch_already_added = []
         for canonical_arch in platform_extra:
             arch = canonical_arch.split('-')[0]
             arch_channel = os.path.join(self.deploy_dir, arch)
-            if os.path.exists(arch_channel):
+            if os.path.exists(arch_channel) and not arch in ch_already_added:
                 bb.note('Note: adding Smart channel %s (%s)' %
                         (arch, channel_priority))
                 self._invoke_smart('channel --add %s type=rpm-md baseurl=%s -y'
@@ -617,6 +617,8 @@ class RpmPM(PackageManager):
                                    (arch, channel_priority))
                 channel_priority -= 5
 
+                ch_already_added.append(arch)
+
         bb.note('adding Smart RPM DB channel')
         self._invoke_smart('channel --add rpmsys type=rpm-sys -y')
 
Signature · 1 line
1.7.9.5
#4 lore raw

Re: [PATCH 2/2] package_manager.py: RpmPM: don't add smart channel if already added

Quoted 3 lines · Laurentiu Palcu

Make sure the channel was not already added, before attempting to add.

[YOCTO #5890]

When generating the rootfs/etc/rpm/platform file, the order should be in the order of highest to lowest priority as well.

Smart uses this order (via an RPM API) to help determine scores when two packages from repositories at the same priority (with different architectures) are selected.

--Mark

Quoted 33 lines
---
  meta/lib/oe/package_manager.py |    6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)
meta/lib/oe/package_manager.py +4 -2
index 6c133c3..ee42952 100644
@@ -604,11 +604,11 @@ class RpmPM(PackageManager):
          # self._invoke_smart('config --set rpm-log-level=debug')
          # cmd = 'config --set rpm-log-file=/tmp/smart-debug-logfile'
          # self._invoke_smart(cmd)
-
+        ch_already_added = []
          for canonical_arch in platform_extra:
              arch = canonical_arch.split('-')[0]
              arch_channel = os.path.join(self.deploy_dir, arch)
-            if os.path.exists(arch_channel):
+            if os.path.exists(arch_channel) and not arch in ch_already_added:
                  bb.note('Note: adding Smart channel %s (%s)' %
                          (arch, channel_priority))
                  self._invoke_smart('channel --add %s type=rpm-md baseurl=%s -y'
@@ -617,6 +617,8 @@ class RpmPM(PackageManager):
                                     (arch, channel_priority))
                  channel_priority -= 5
 
+                ch_already_added.append(arch)
+
          bb.note('adding Smart RPM DB channel')
          self._invoke_smart('channel --add rpmsys type=rpm-sys -y')
 
#5 lore raw

Re: [PATCH 2/2] package_manager.py: RpmPM: don't add smart channel if already added

Hi Mark,

Quoted 11 lines · Mark Hatle
Quoted 3 lines · Laurentiu Palcu

Make sure the channel was not already added, before attempting to add.

[YOCTO #5890]

When generating the rootfs/etc/rpm/platform file, the order should be in the order of highest to lowest priority as well.

Smart uses this order (via an RPM API) to help determine scores when two packages from repositories at the same priority (with different architectures) are selected.

Thanks for the info. This patchset should restore the behavior to the one you describe. Python's sets messed up the order, so I reverted that patch.

laurentiu

Quoted 41 lines

--Mark

Quoted 25 lines
---
 meta/lib/oe/package_manager.py |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
meta/lib/oe/package_manager.py +2 -2
index 6c133c3..ee42952 100644
@@ -604,11 +604,11 @@ class RpmPM(PackageManager):
         # self._invoke_smart('config --set rpm-log-level=debug')
         # cmd = 'config --set rpm-log-file=/tmp/smart-debug-logfile'
         # self._invoke_smart(cmd)
-
+        ch_already_added = []
         for canonical_arch in platform_extra:
             arch = canonical_arch.split('-')[0]
             arch_channel = os.path.join(self.deploy_dir, arch)
-            if os.path.exists(arch_channel):
+            if os.path.exists(arch_channel) and not arch in ch_already_added:
                 bb.note('Note: adding Smart channel %s (%s)' %
                         (arch, channel_priority))
                 self._invoke_smart('channel --add %s type=rpm-md baseurl=%s -y'

meta/lib/oe/package_manager.py class RpmPM(PackageManager): · line 624

Quoted 8 lines
meta/lib/oe/package_manager.py +2 -0
@@ -617,6 +617,8 @@ class RpmPM(PackageManager):
                                    (arch, channel_priority))
                 channel_priority -= 5
 
+                ch_already_added.append(arch)
+
         bb.note('adding Smart RPM DB channel')
         self._invoke_smart('channel --add rpmsys type=rpm-sys -y')
 

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core