Bug #4565
closedUser story #4459: Support Rudder agent on AIX 5.3+
With older versions of rpm, boolean tests on macros fail if not quoted
Description
For example, given this line in a .spec file:
%if %{is_tokyocabinet_here} == "false"
We can get this error:
21:43:01 undefined identifier 21:43:01 /usr/src/packages/SPECS/rudder-agent.spec:190: parseExpressionBoolean returns -1
Quoting the macro solves the problem. It will not be expanded, and we will end up with a string containing literally "%{is_tokyocabinet_here}", but that's fine because the test will fail.
Fixing.
Updated by Jonathan CLARKE over 10 years ago
- Status changed from In progress to Pending technical review
- Assignee changed from Jonathan CLARKE to Matthieu CERDA
PR available for review: https://github.com/Normation/rudder-packages/pull/248
Updated by Jonathan CLARKE over 10 years ago
- Status changed from Pending technical review to Pending release
- % Done changed from 0 to 100
Applied in changeset commit:246d1207ebaa2b936d697888e56df5f98495f01a.
Updated by Matthieu CERDA over 10 years ago
Applied in changeset commit:76041115f9b7008d9f752a567734f1ecc4bd80bd.
Updated by Christophe Nowicki over 10 years ago
Hi Girls,
%if 0%{?mymacro:1} # ... %{mymacro} is defined %else # ... %{mymacro} is not defined %endif
Take a look at :
http://backreference.org/2011/09/17/some-tips-on-rpm-conditional-macros/
and
https://fedoraproject.org/wiki/Packaging:DistTag#Conditionals
Best Regards,
Updated by Jonathan CLARKE over 10 years ago
Thanks for the tip Christophe. I actually came across that same blog post, which is why I decided to use the "quoted" approach, because the RPM version on AIX is OLD... Long live support for old OS!
Updated by Vincent MEMBRÉ over 10 years ago
- Subject changed from With older versions of rpm, boolean tests on macros can fail if not quoted to With older versions of rpm, boolean tests on macros fail if not quoted
Updated by Vincent MEMBRÉ over 10 years ago
- Project changed from 34 to Rudder
- Category set to System integration
- Parent task set to #4459
Updated by Vincent MEMBRÉ over 10 years ago
- Status changed from Pending release to Released
This bug has been fixed in Rudder 2.10.0~beta1, which was released today.
Check out:
The release announcement: http://www.rudder-project.org/pipermail/rudder-announce/2014-March/000084.html
The full ChangeLog: http://www.rudder-project.org/foswiki/bin/view/System/Documentation:ChangeLog210
Download information: https://www.rudder-project.org/site/get-rudder/downloads/