Chmouel Boudjnah wrote:
> 
> "Michael Ju. Tokarev" <[EMAIL PROTECTED]> writes:
> 
> > It controlled by "%define lfs 0" in .spec.  Can I say, for example,
> > "rpm --rebuild kernel-...src.rpm lfn=1" ?
> 
> rpm --rebuild --define 'lfs 1' k*src.rpm

That can seems strange.  It seemed that this --define is ignored (or overwritten?)
in .spec.   For example, I made a tiny .spec file to test this:
---- test.spec ---
Summary: Test Package
Name: test
Version: 0.1
Release: 1
Source0: test.tar.gz
%define tst 0
Copyright: GPL
Group: Test/Test
%description
Test package
%prep
%if %{tst}
echo TST is here: %{tst}
%else
echo TST is NOT here: %{tst}
%endif
---

And after this I do "rpm -bp test.spec".  It says "TST is NOT here: 0".
And the same if I say "rpm -bp --define 'tst 1' test.spec": "TST is NOT here: 0".
If I comment out definition of tst in .spec (line 6), with any options,
it will give me _the_same_results_, and I can guess that this is a bug in rpm
(it seemed to ignore comments at all).  But if I delete this line at all,
rpm will complain:
 Macro %tst has empty body
 Macro %tst has empty body
 parse error in expression
 /usr/mjt/rpm/specs/test.spec:11: parseExpressionBoolean returns -1
Also the same if I chanfge %if to %ifdef, remove "%{" and "}" around tst
in condition etc etc, and with any syntax of --define (tried 'tst 1',
'tst=1', 'tst' etc).

Yes, I always can edit .spec file for this.  I even can define some "rpmwrapper"
for this (e.g. kernel-lfs-....spec that runs "rpm -bb kernel.spec" after 
editing/patching of that original kernel).  But this solution seemed to be
not exactly correct... (my rpm version is rpm-3.0.4-0.38).


> --
> MandrakeSoft Inc                http://www.mandrakesoft.com
> Pasadena, CA USA                                  --Chmouel

-- 
To unsubscribe:
mail -s unsubscribe [EMAIL PROTECTED] < /dev/null

Reply via email to