Bug 7907 - absolutely broken %include handling
absolutely broken %include handling
Status: CLOSED DUPLICATE of bug 5364
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
6.1
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-12-20 14:39 EST by vadim
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-01-31 11:18:07 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description vadim 1999-12-20 14:39:38 EST
1)
%if blabla
%include file
%endif
will die (because it'll check if it's EOF and we're still in IF, but won't
check whether this file is the last one. Patch is obvious)

2)
comments in %included file are not comments at all (i.e. if something is
inside comment, which is macro, it'll get processed)
Comment 1 Jeff Johnson 2000-01-31 11:11:59 EST
Here's a workaround for 1:

# define arch specific variable
%{expand: %%{global} _is_%{_target_cpu} %%{nil}}

# include file only if is_blabla is defined (i.e. on arch blabla)
%{?is_blabla: %include file}

There is no work-around for 2) since macro expansion is entirely context free.
Moreover, you will find that there is a limit of the size of the expansion
buffer (8Kb) on the contents of file.
Comment 2 Jeff Johnson 2000-01-31 11:18:59 EST
*** This bug has been marked as a duplicate of 5364 ***

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