Bug 706672

Summary: something wrong with command line parse
Product: [Fedora] Fedora EPEL Reporter: Levente Farkas <lfarkas>
Component: mockAssignee: Clark Williams <williams>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: el6CC: herrold, mebrown, pmatilai, williams
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-06-22 19:32:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Levente Farkas 2011-05-22 08:19:12 UTC
on rhel-6.1 (where dist is defined by rpm macros), this command line:
mock -r rhel-6.1-i386 --define "rhel 6.1" --rebuild OpenEXR-1.6.1-8.1.el6.src.rpm
will fail while 
mock -r rhel-6.1-i386 --rebuild OpenEXR-1.6.1-8.1.el6.src.rpm
won't. the reason was not to simple to find:-(
in the first case during the root phase in the first case mock do _not_ install ccache and simple miss that part of the chroot setup. and after that during the build phase we've got a stranege error:
--------------------------------
Executing command: ['bash', '--login', '-c', 'rpmbuild -bs --target i686 --nodeps builddir/build/SPECS/OpenEXR.spec']
error: parse error in expression
error: /builddir/build/SPECS/OpenEXR.spec:2: parseExpressionBoolean returns -1
Building target platforms: i686
Building for target i686
Child returncode was: 1
---------------------------------
it seems to me a mock bug.

Comment 1 Panu Matilainen 2011-05-26 07:59:17 UTC
This is the culprit:
--define "rhel 6.1"

Rpm only supports integer and string comparisons in spec expressions.
%{rhel} and %{fedora}, as used in specs, must be integers and "6.1" is not one. A simple reproducer is:

# This is valid
%if 0 < 1
echo FOO
%endif

# this is invalid
%if 0 < 1.0
echo FOO
%endif

--> NOTABUG.

Comment 2 Levente Farkas 2011-05-26 14:00:23 UTC
it's ok (but i don't know that).
but in this case why not install ccache during the root build? what's the connections between these?