Bug 712061 - RPM cannot handle some constructs
Summary: RPM cannot handle some constructs
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: rpm
Version: 6.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Panu Matilainen
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-06-09 11:55 UTC by Vít Ondruch
Modified: 2011-06-10 09:43 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-06-09 12:29:45 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Vít Ondruch 2011-06-09 11:55:48 UTC
Description of problem:
RPM cannot handle the following construct

%{?condition:bash -c " \}
some command \
  with plenty of options \
%{?condition:"}

The idea is to wrap some command by external command, only when condition is valid. When building, everything is ignored since begin of the construct till begin of the next section

Comment 2 Panu Matilainen 2011-06-09 12:29:45 UTC
You need to double-escape the backslash inside macros as \ is a line-continuation
marker for the macro body itself. This works:

%{?condition:bash -c " \\}
some command \
  with plenty of options \
%{?condition:"}

Comment 3 Vít Ondruch 2011-06-10 09:43:30 UTC
But again, then there is bug. The following is the content of the script. Why is there double backslash?

bash -c " \\
some command \
  with plenty of options \
"


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