Bug 64482 - Subpackage conflicts with define package parameter
Summary: Subpackage conflicts with define package parameter
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rpm-build
Version: 7.3
Hardware: All
OS: Linux
medium
low
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-05-06 16:49 UTC by Need Real Name
Modified: 2008-05-01 15:38 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-05-06 16:49:28 UTC
Embargoed:


Attachments (Terms of Use)

Description Need Real Name 2002-05-06 16:49:24 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0rc1) Gecko/20020417

Description of problem:
I was trying to create subpackages but I kept on getting "Package does not
exist." I traced this to conflicting namespace with the "package" define. I
suppose "package" is a special global variable that %package uses. However, an
more useful error message would be nice.

See also 62584

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


How reproducible:
Always

Steps to Reproduce:
rpmbuild --define="dpackage daphne" daphne.spec

works, but 

rpmbuild --define="package daphne" daphne.spec

dosen't.

Actual Results:  error: line 17: Package does not exist: %description TEST


Expected Results:  A couple subpackages were supposed to be built.

Additional info:

Comment 1 Jeff Johnson 2002-05-09 14:33:34 UTC
%package is a spec file section marker, not a macro. You may
see what macros are defined at any point in a spec file parse
by putting in a %dump. The construct
	--define 'package daphne'
has no well defined or supported use AFA rpm is
concerned.

I suggest that
	Package does not exist.
is a precise and accurate albeit unhelpful
in your case.

Comment 2 Jeff Johnson 2002-05-09 14:35:00 UTC
Hmmm, well section markers can be overloaded
so
	--define 'package daphne'
actually eliminates the section marker. This
is a feature, not a bug. Apologies for the
confusion.

Comment 3 Need Real Name 2002-05-09 15:08:15 UTC
There are two problems really. 

I am not very familiar with the internals of RPM but the first error message was
complaining about a missing package with respect to a "TEST" sub-package, so I
thought I was doing something wrong with subpackages.

Second, I was using defines to abstract out stuff (package name, version,
release ) etc across multiple packaging scripts and using the --define was very
useful for this. However, can't there be a warning that we're overriding a
special internal token. Can you see a case where overriding a section marker is
actually a good thing?

Comment 4 Jeff Johnson 2002-05-09 15:51:58 UTC
Overriding a section marker with a macro
is quite a good thing. Try putting
into /etc/rpm/macros

	%build() %%build %* \
	exec 2> %{_tmppath}/%{name}.buildlog

Basically it's possible to prepend shell
commands to build scriptlets without editing
spec files by overloading scetions with macros.



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