Bug 547997
Summary: | rpmbuild -bs became more strict and chokes on undefined macros in Requires | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Jens Petersen <petersen> |
Component: | rpm | Assignee: | Panu Matilainen <pmatilai> |
Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | rawhide | CC: | ffesti, haskell-devel, jnovy, pmatilai, rdieter |
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: | 2009-12-17 07:20:11 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: |
Description
Jens Petersen
2009-12-16 10:13:50 UTC
Fwiw, a workaround is easy enough. For any undefined macro, say, %{foo}, change: Requires: %{foo} to %{?foo:Requires: %{foo}} This technique can be applied to BuildRequires as well. (In reply to comment #1) > Requires: %{foo} > to > %{?foo:Requires: %{foo}} Thanks Rex that helps a lot actually. :) It has given me enough ideas to experiment a bit - perhaps after that I may be able to close this actually. Yup, this is one of the fundamental chicken-and-egg problems with spec files: there's no guarantee that a spec can be correctly parsed if build-requires are missing, but in order to parse out build-requires from the spec, rpmbuild needs to be able to parse the entire spec... Generally, if there's a chance for a macro to be undefined, the spec should be written to deal with it somehow. The approach shown by Rex works fine for Requires and many others, but with BuildRequires it can cause the BuildRequire that would correct the situation to be missed. Another variant that avoids that would be BuildRequires: ghc %{?ghc_version:= %{ghc_version}} Anyway, I've loosened up the new checks to permit unexpanded macros to slip through the valid character checks until we have a better fix for this. Built into 4.8.0-0.beta1.4 in rawhide now. Ah thanks that saves we having to write extra ghc macros for now then. :) http://koji.fedoraproject.org/koji/buildinfo?buildID=147621 |