Bug 143874
Summary: | Commented %define still %defines | ||||||
---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Matthew Saltzman <mjs> | ||||
Component: | rpm | Assignee: | Jeff Johnson <jbj> | ||||
Status: | CLOSED NOTABUG | QA Contact: | Mike McLean <mikem> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | medium | ||||||
Version: | 3 | CC: | nobody+pnasrat | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | i386 | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | |||||||
: | 1065463 (view as bug list) | Environment: | |||||
Last Closed: | 2004-12-30 16:29:32 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
Matthew Saltzman
2004-12-30 16:23:11 UTC
Created attachment 109189 [details]
RPM spec file exhibiting how commented %defines are still live.
Build this package (foo-0.0) with "rpmbuild -bp foo.spec". The output echoes
"bazz" when it should echo "bar".
This is a known limitation of the spec parser, macros are expanded everywhere - comments, changelog etc. Common packager approaches are to either add a % to escape or replace the % with the # eg: #%%define foo bazz or #define foo bazz OK fine, but this needs to be documented in big red letters in places that specfile authors are likely to see it (appropriate sections of the HOWTO and Maximum RPM, at least). For anyone used to most common programming languages, shell languages, makefile syntax, etc., this is totally unexpected behavior. In the Maximum RPM snapshot (http://www.rpm.org/max-rpm-snapshot/ch-rpm-inside.html#S1-RPM-INSIDE-COMMENTS) the following appears: Comments are a way to make RPM ignore a line in the spec file. The contents of a comment line are entirely up to the person writing the spec file. To create a comment, enter an octothorp (#) at the start of the line. Any text following the comment character will be ignored by RPM. The same appears in Appendix E (http://www.rpm.org/max-rpm-snapshot/ch-rpm-specref.html#S1-RPM-SPECREF-COMMENTS) I have not encountered any reference to expansion of macros in comments anywhere I've looked. For speedy update patches against maximum rpm happily taken and the snapshot will be updated. CVS details here, feel free to attach here or post to rpm-list: http://rpm.org/cvs_help/ OK Will post here or there when I have a chance to write the patches. |