Bug 153078
Summary: | --specfile ignores %{_arch} and ignores %ifarch | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 3 | Reporter: | James Olin Oden <james.oden> | ||||||
Component: | rpm | Assignee: | Paul Nasrat <nobody+pnasrat> | ||||||
Status: | CLOSED UPSTREAM | QA Contact: | Mike McLean <mikem> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | medium | ||||||||
Version: | 3.0 | CC: | herrold | ||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | All | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2005-10-26 22:50:39 UTC | Type: | --- | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Attachments: |
|
Description
James Olin Oden
2005-04-01 12:33:35 UTC
In build/spec.c::rpmspecQuery(), anyarch is set to one and passed to parseSpec () for the corresponding argument. I suspect setting this to 0 (i.e. false) will cause the behaviour I want...will test this...but this leads me to believe that at some consumer expected it work this way. I could make this optional, but then I would have to change the signature of rpmspecQuery() to a take this as an option, or I could add it to the QVA_t structure? Any thoughts? Created attachment 112650 [details]
First pass patch
This patch adds a --target option to query that works like rpmbuilds --target
option. It does report the correct arch now when querying, but it does not
handle the %ifarch stuff. That said, at one point I had debug statements in
readLine() and found that it should be doing the right thing, but somehow I
still get all packages. Any advice would be greatly appreciated.
Created attachment 112651 [details]
This one works.
Got the answer I should have figured out myself from googling. Appearantly,
Wanderlei Antonio Cavassin, sent the following patch a long time ago:
--- rpm-3.0.5/lib/query.c.orig Sat Oct 28 18:47:45 2000
+++ rpm-3.0.5/lib/query.c Sat Oct 28 18:47:54 2000
@@ -556,7 +556,8 @@
}
for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
- showPackage(qva, NULL, pkg->header);
+ if (pkg->fileList != NULL)
+ showPackage(qva, NULL, pkg->header);
}
freeSpecVec(spec);
} break;
Obviously, this was for a much older rpm, but the concept of checking for a
NULL spec->fileList was the trick.
So basically, the following things are done in this patch:
- Add --target option to query. This drills into QVA_t structure adding a
target structure. Uses the same semantics and stratagy as rpmbuild's
--target.
- If target is specified in the QVA_t struct given specQuery() then
the macro environment is cleared and reinitialized for each target is
done in build.c. Also, the packages that have a null spec->fileList are
not queried.
- If the target is not specified query happens the same way.
- some specQuery code was refactored to make it easier to iterate accross
multiple specified targets.
Let me know if there is anything I could do to make this an acceptable patch.
Also, Paul, if you like the patch, I will work it into the HEAD.
Fixed in rpm-4.4.3-0.20 something. |