Skip to contentSkip to conversation

lib/oe/package_manager: update default rpm config %_prefer_color

PATCH Changqing Li 2 participants 3 messages May 6, 2020 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

ping

Quoted 42 lines · Changqing Li

From: Changqing Li <[email protected]>

* %_prefer_color is used by rpm to determine which color's ELF file is preferred to be installed.

Here are file colors:
0 is unknown or other
1 is Elf32
2 is Elf64
3 is (contains) both

if default value set to 7, both 32 and 64 bits's ELF will be installed, in this condition, when we have 64bits python3 installed first, then install lib32-python3 later, 64bits python3 will be overwrited,

file /usr/bin/python3 will be 32bits ELF
and sys.path will point to /usr/lib, not /usr/lib64, this may cause some python3 modules not work. so fixed by remove setting of default value 7, and use default value 2 of rpm.

* other distro like fedora also use the default %_prefer_color 2

---
  meta/lib/oe/package_manager.py | 2 --
  1 file changed, 2 deletions(-)
meta/lib/oe/package_manager.py +0 -2
index b066041..c055d2b 100644
@@ -805,8 +805,6 @@ class RpmPM(PackageManager):
          open(platformconfdir + "macros", 'w').write("%_transaction_color 7\n")
          if self.d.getVar('RPM_PREFER_ELF_ARCH'):
              open(platformconfdir + "macros", 'a').write("%%_prefer_color %s" % (self.d.getVar('RPM_PREFER_ELF_ARCH')))
-        else:
-            open(platformconfdir + "macros", 'a').write("%_prefer_color 7")
 
          if self.d.getVar('RPM_SIGN_PACKAGES') == '1':
              signer = get_signer(self.d, self.d.getVar('RPM_GPG_BACKEND'))
#2 lore raw

There was a response from RP:

This causes a failure on the autobuilder:

https://autobuilder.yoctoproject.org/typhoon/#/builders/44/builds/1867

Alex

Quoted 47 lines · Changqing Li

ping
On 4/30/20 12:10 PM, Changqing Li wrote:

From: Changqing Li <[email protected]> <[email protected]>

* %_prefer_color is used by rpm to determine which color's ELF file is preferred to be installed.

Here are file colors:
0 is unknown or other
1 is Elf32
2 is Elf64
3 is (contains) both

if default value set to 7, both 32 and 64 bits's ELF will be installed, in this condition, when we have 64bits python3 installed first, then install lib32-python3 later, 64bits python3 will be overwrited,

file /usr/bin/python3 will be 32bits ELF
and sys.path will point to /usr/lib, not /usr/lib64, this may cause some python3 modules not work. so fixed by remove setting of default value 7, and use default value 2 of rpm.

* other distro like fedora also use the default %_prefer_color 2

---
 meta/lib/oe/package_manager.py | 2 --
 1 file changed, 2 deletions(-)
meta/lib/oe/package_manager.py +0 -2
index b066041..c055d2b 100644
@@ -805,8 +805,6 @@ class RpmPM(PackageManager):
         open(platformconfdir + "macros", 'w').write("%_transaction_color 7\n")
         if self.d.getVar('RPM_PREFER_ELF_ARCH'):
             open(platformconfdir + "macros", 'a').write("%%_prefer_color %s" % (self.d.getVar('RPM_PREFER_ELF_ARCH')))
-        else:
-            open(platformconfdir + "macros", 'a').write("%_prefer_color 7")
 
         if self.d.getVar('RPM_SIGN_PACKAGES') == '1':
             signer = get_signer(self.d, self.d.getVar('RPM_GPG_BACKEND'))
#3 lore raw

Hi, Alex

Thanks. I will check this failure.

Changqing

Quoted 56 lines · Alexander Kanavin

There was a response from RP:

This causes a failure on the autobuilder:

https://autobuilder.yoctoproject.org/typhoon/#/builders/44/builds/1867

Alex

On Wed, 6 May 2020 at 04:39, Changqing Li <[email protected] <mailto:[email protected]>> wrote:

    ping

    On 4/30/20 12:10 PM, Changqing Li wrote:
Quoted 41 lines

From: Changqing Li<[email protected]> <mailto:[email protected]>

* %_prefer_color is used by rpm to determine which color's ELF file is preferred to be installed.

Here are file colors:
0 is unknown or other
1 is Elf32
2 is Elf64
3 is (contains) both

if default value set to 7, both 32 and 64 bits's ELF will be installed, in this condition, when we have 64bits python3 installed first, then install lib32-python3 later, 64bits python3 will be overwrited,

file /usr/bin/python3 will be 32bits ELF
and sys.path will point to /usr/lib, not /usr/lib64, this may cause some python3 modules not work. so fixed by remove setting of default value 7, and use default value 2 of rpm.

* other distro like fedora also use the default %_prefer_color 2

---
meta/lib/oe/package_manager.py | 2 --
1 file changed, 2 deletions(-)

diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index b066041..c055d2b 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -805,8 +805,6 @@ class RpmPM(PackageManager):
open(platformconfdir + "macros", 'w').write("%_transaction_color 7\n")
if self.d.getVar('RPM_PREFER_ELF_ARCH'):
open(platformconfdir + "macros", 'a').write("%%_prefer_color %s" % (self.d.getVar('RPM_PREFER_ELF_ARCH')))
- else:
- open(platformconfdir + "macros", 'a').write("%_prefer_color 7")

if self.d.getVar('RPM_SIGN_PACKAGES') == '1':
signer = get_signer(self.d, self.d.getVar('RPM_GPG_BACKEND'))