[opensuse-factory] bug in "src" rpms "arch" field (in 11.4 & 12.1) -- i.e. a process problem.
I was writing a util to examine poorly named 'rpm' files to see what was in them and what architecture they were for. I was surprised to find out that all of the "src" rpms don't say "arch=src" or "arch=none", but arch=i586 OR arch=x86_64... Are there separate sources for each architecture? If not, could this information be set that "src"'s "arch" field indicates it is "arch" agnostic"? -- so one can look at the arch field and know it's not a binary installable? I'm querying the fields inside the RPM's because historically, the names on the outside of the RPM were often difficult to parse -- especially in relation to the NVR fields. I sorta got caught with with my "pants down", so to speak, relying on querying the information inside the RPM, entirely, thinking that doing so would be the "Authoritative" source for the rpm's contents... -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On 2012-07-01 16:45:47 -0700, Linda Walsh wrote:
I was writing a util to examine poorly named 'rpm' files to see what was in them and what architecture they were for.
I was surprised to find out that all of the "src" rpms don't say "arch=src" or "arch=none", but arch=i586 OR arch=x86_64...
Are there separate sources for each architecture? If not, could this information be set that "src"'s "arch" field indicates it is "arch" agnostic"? -- so one can look at the arch field and know it's not a binary installable?
You can distinguish binaries from a source rpm via the sourcerpm tag ("RPMTAG_SOURCERPM"). Source rpms have no sourcerpm tag. For instance try: rpm -qp --queryformat "%{SOURCERPM}\n" <sourcerpm> and rpm -qp --queryformat "%{SOURCERPM}\n" <binaryrpm> Marcus -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Monday 2012-07-02 01:45, Linda Walsh wrote:
I was writing a util to examine poorly named 'rpm' files to see what was in them and what architecture they were for.
I was surprised to find out that all of the "src" rpms don't say "arch=src" or "arch=none", but arch=i586 OR arch=x86_64...
Are there separate sources for each architecture?
In principle yes (/srv/obs/build/openSUSE:Factory/standard/i586, /srv/obs/build/openSUSE:Factory/standard/x86_64). It's just that the files get intermixed when they get copied/hardlinked to /srv/obs/repos.
If not, could this information be set that "src"'s "arch" field indicates it is "arch" agnostic"? -- so one can look at the arch field and know it's not a binary installable?
1. If rpm -q --qf="%{SOURCERPM}" is empty/(none), you have a SRPM at hand. 2. If rpm -q --qf="%{ARCH}" is noarch, you have a noarch rpm. 3. Otherwise %{ARCH} gives the particular target it was compiled for. It is conceivable that the only reason %{ARCH} is not something generic for SRPMS is that there simply is no way to specify an alternate BuildArch:, since the SRPM is implicit in a .spec - and as such inherits from the main package. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Jan Engelhardt wrote:
If not, could this information be set that "src"'s "arch" field indicates it is "arch" agnostic"? -- so one can look at the arch field and know it's not a binary installable?
1. If rpm -q --qf="%{SOURCERPM}" is empty/(none), you have a SRPM at hand. 2. If rpm -q --qf="%{ARCH}" is noarch, you have a noarch rpm. 3. Otherwise %{ARCH} gives the particular target it was compiled for.
I noticed the above, but didn't know if it was by accident or by design and whether or not it would change some next release... I started changing code based on the assumption that no "srpm" meant it was the srpm...just seemed a bit "kludgey".... Thanks. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
participants (3)
-
Jan Engelhardt
-
Linda Walsh
-
Marcus Hüwe