07.09.2011 18:59, TASAKA Mamoru wrote:

If you still see some issue, please write in detail what you see (and post
the spec file you are currently using).

Yes, apparently I still have it.
The long time awhile I have there condition:
%if %( php -r "echo (version_compare(PHP_VERSION, '5.3.0', '>=') ? 1 : 0);" )
today it produce parse error.

Now I change it on:
%if %( php -r "echo (version_compare(PHP_VERSION, '5.3.0', '>=') ? 1 : 0);" &>/dev/null || echo 0 )
but on make srpm got error:
error: /home/pasha/SOFT/git/php-pecl-runkit/master/php-pecl-runkit.spec:74: parseExpressionBoolean returns -1 error: query of specfile /home/pasha/SOFT/git/php-pecl-runkit/master/php-pecl-runkit.spec failed, can't parse
Could not make an srpm: Could not parse the spec, exited 1

Obviously it because () in construction, but they in quotes!?
Changing it to:
%if %( php -r "echo \(version_compare\(PHP_VERSION, '5.3.0', '>='\) ? 1 : 0\);" &>/dev/null || echo 0 ) give me chance build package. See http://koji.fedoraproject.org/koji/taskinfo?taskID=3341569 but it also doesn't work as intended, patches doesn't applied: http://koji.fedoraproject.org/koji/getfile?taskID=3341573&name=build.log <http://koji.fedoraproject.org/koji/getfile?taskID=3341573&name=build.log>

If I redirecting to null only stderr and remove parenthesis escaping:
%if %( php -r "echo (version_compare(PHP_VERSION, '5.3.0', '>=') ? 1 : 0);" 2>/dev/null || echo 0 ) package also built: http://koji.fedoraproject.org/koji/taskinfo?taskID=3341605 and rpm do what I want: http://koji.fedoraproject.org/koji/getfile?taskID=3341605&name=build.log <http://koji.fedoraproject.org/koji/getfile?taskID=3341605&name=build.log>

So, it seams I completely don't understand rpm expression parsing logic:
1) Why "&>/dev/null" is incorrect? Independent on shell were it intended to be parsed, macros just should pass content of macros %() to shell and return string value. Or not? 2) Why "&>/dev/null" became correct if I escape parenthesis (even if command really not work)? 3) Why initial command work before and not now? Is it bug or expected change?


--
With best wishes, Pavel Alexeev (aka Pahan-Hubbitus). For fast contact with me use jabber: hubbi...@jabber.ru
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Reply via email to