Bug 7907

Summary: absolutely broken %include handling
Product: [Retired] Red Hat Linux Reporter: vadim
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED DUPLICATE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1CC: wokoc30543
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-01-31 16:18:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description vadim 1999-12-20 19:39:38 UTC
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 16:11:59 UTC
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 16:18:59 UTC
*** This bug has been marked as a duplicate of 5364 ***

Comment 3 Ernest Myers 2020-07-08 07:49:37 UTC
Absolutely broken %include handling. Things are not be easy to handle them with including and handling through coding where you people can easily choose https://www.toptenwritingservices.com/bestessays-com-review/ website. We will be take these things for us only and aslo trying to show it whenever we handle them.