Bug 147238 - Loses macro definition
Loses macro definition
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Paul Nasrat
Mike McLean
Depends On:
  Show dependency treegraph
Reported: 2005-02-04 17:33 EST by Enrico Scholz
Modified: 2007-11-30 17:10 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-07-13 12:50:13 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 Enrico Scholz 2005-02-04 17:33:01 EST
Description of problem:

----- test.spec
%{!?myvar:%define myvar                 foo}
%define othervar                        bar
%{!?release_func:%define release_func() %1}

Name:		test
Version:	%release_func 1
Release:	0.fdr.1
Epoch:		0
Group:          X
License:        X
Summary:        X


| $ rpmbuild -bs test.spec
| error: foo
| error: bar
| error: %myvar
| error: bar

please notice the 3rd line: the definition of %myvar was forgotten
suddenly when a function was executed.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. see above

Actual results:

3rd line is 'error: %myvar'

Expected results:

3rd line is 'error: foo'
Comment 1 Jeff Johnson 2006-07-13 12:50:13 EDT

A function cleans all macro definitions at same (or deeper) recursion level lazily upon exit.

    %{!?myvar:%global myvar                 foo}
will give you the behavior you expect.

This issue is too arcane to fix imho, use the workaround.

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