Bug 706161

Summary: data returned from rpm -D and rpm --define is different
Product: [Fedora] Fedora Reporter: Miloslav Trmač <mitr>
Component: rpmAssignee: Panu Matilainen <pmatilai>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 14CC: ffesti, jnovy, pmatilai, tao
Target Milestone: ---Keywords: Upstream
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 166311 Environment:
Last Closed: 2012-05-07 09:28:03 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 Miloslav Trmač 2011-05-19 16:31:42 UTC
To reproduce:

# see (rpmbuild --help) implying that -D and --define are the same
$ echo '%_rpmdir	/home/mitr/rh/rpm/RPMS' > ~/.rpmmacros
$ rpmbuild -D '_rpmdir foo' --eval '%_rpmdir'
/home/mitr/rh/rpm/RPMS
$ rpmbuild --define '_rpmdir foo' --eval '%_rpmdir'
foo

Seen in rpm-4.8.1-5.fc14.x86_64; today's git head still contains 'D' for --predefine.

If you don't want to change the behavior of -D, I'd be fine with just changing the --help output.

+++ This bug was initially created as a clone of Bug #166311 +++
[edited]

rpm -D and rpm --define are supposed to have the same functionality.  The
data returned by these two commands is different.

--- Additional comment from pnasrat on 2005-08-23 11:53:03 EDT ---

Created attachment 118008 [details]
Proposed patch

D was mapped both predefine and define this should be the correct fix.

Comment 1 Panu Matilainen 2011-05-20 07:13:57 UTC
(clearing up unnecessary privacy flags)

Thanks for digging up the old bug. I tried to collect these sort of fixes from RHEL and other distros back in 4.4.2.* days but I've completely missed this one. Applied upstream now, leaving open for Fedora tracking.

Comment 2 Panu Matilainen 2012-05-07 09:28:03 UTC
F14 is EOL, but fixed in Fedora >= 15 for quite some time now.