rpm.archscore's influence on smart

Jeff Johnson n3npq at mac.com
Tue Mar 23 05:38:42 PDT 2010


On Mar 23, 2010, at 8:09 AM, Eric MSP Veith wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Dear List,
> 
> I'm having a problem with rpm's .archscore which I don't quite understand.
> 
> Normally, I have only repos of type rpm-dir which contain either i686 or 
> noarch packages. To save me from the heavy burden ;-) of appending --
> target=i686-whatever-linux every time I run rpmbuild, I created 
> /etc/rpm/platform with i686-slackware-linux.
> 
> rpm.archscore("i686") returns 1 then, and 0 for every other architecture, 
> which is right.
> 
> Yesterday I added the YUM repo of go-oo to install OpenOffice. Packages 
> there are built for i586 and didn't show up at first due to the contents of 
> /etc/rpm/platform.
> 
> Until here I understand, there rest I don't:
> 

I can't help with what is in smart and yum, but I can try to help
with the underlying RPM archScore implementation details.

YUM for sure and likely smart as well likely have internal
tables to determine their own archscore equivalent.

> Removing /etc/rpm/platform makes the packages in the Go-OO YUM repo show up, 
> but hides all i686 and noarch packages from the rpm-dir repositories. 
> archscore() returns 0 for all architectures then.
> 

Removing /etc/rpm/platform causes a fallback to the older
mechanism to use arch from uname(2) fields. You will
have much better control over archscore if you
add a known CPU-VENDOR-OS string rather than depending
on whatever comes from uname(2).

> Putting "i[56]86-slackware-linux" into /etc/rpm/platform leads to 
> rpm.archscore() returning 0 for every architecture I query. Still, the Go-OO 
> packages (i586) show up, while the rpm-dir repositories show no packages 
> anymore, not even the "noarch" ones.
> 

Adding a pattern won't work. The 1st line of /etc/rpm/platform
is always a literal CPU-VENDOR-OS-GNU (with conventions for filling in
fewer fields). So you've just named your arch literally 'i[56]86'
which isn't compatible with any package.

Since this is rpm-5.1.9, patterns are permitted _AFTER_ the first
line, and archscore is (essentially) the line # of the 1st pattern
that matches the package platform string (basically CPU-VENDOR-OS-GNU
but from a *.rpm, not from the system).


> Putting more than one line into /etc/rpm/platform causes smart to segfault. 
> :-/
> 

Hmmm, I've seen that segfault about a year ago. I can try to find
the fix, I've forgotten details. The fix was in rpmio/mire.c
iirc and had to do with mixing strings and patterns in a mire
container.

Or is it really smart segfaulting? I'm assuming that its an rpm segfault ...

> I'm running smart-1.3 from the tarball powered by Python 2.6.3 and RPM 
> 5.1.9.
> 


> - ---%<---
> $ uname -im
> i686 i386
> - --->%---
> 
> Can somebody explain Smart's behaviour to me, and how I can use both 
> repositories (the Go-OO with i586 and my rpm-dir reposoitories with i686 
> packages)?
> 
> Thanks alot in advance.
> 

hth

73 de Jeff
> 			Eric
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
> 
> iEYEARECAAYFAkuor5gACgkQhS0drJ3goJL0xgCfSxHP/6bABZxynVg9qBEk8E/T
> y4wAnA2yUWQ/Bnq1RA01hTAoT+Sy5A0V
> =y/i6
> -----END PGP SIGNATURE-----




More information about the Smart mailing list