Bug 47778 - incorrect handling of "%define pre 3"
incorrect handling of "%define pre 3"
Product: Red Hat Linux
Classification: Retired
Component: rpm-build (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
Depends On:
  Show dependency treegraph
Reported: 2001-07-07 09:19 EDT by j. alan eldridge
Modified: 2008-05-01 11:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-07-07 09:22:08 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description j. alan eldridge 2001-07-07 09:19:03 EDT
Description of Problem:

In a kernel spec file, to represent the "pre?" version component of one 
of Linus's test kernels, I defined the symbol:

%define pre 3

which I then used like:

%if "%{pre}" == ""
%define ver 2.4.%{sublevel}
%define ver 2.4.%{sublevel}pre%{pre}

So, an rpm build dies because I have:


# pre-install actions

which rpm-build dutifully translates to"

# pre-install actions

Either don't allow defining that variable, or recognize that %pre is a 
directive and handle it differently.
Comment 1 j. alan eldridge 2001-07-07 09:22:05 EDT
I think this should apply to %post, %dir, and whatever else rpm may need to 
distinguish on a context basis, or else disallow defining.

Comment 2 Jeff Johnson 2001-07-07 09:38:37 EDT
This is a feature, not a bug, as it permits overloading other uses
of % (like the %pre section marker as you describe) with a macro
expansion. This permits, for example, all %build sections in a spec
file to include a per-buildsystem preface if necessary.

Note You need to log in before you can comment on or make changes to this bug.