RPM Community Forums

Mailing List Message of <rpm-users>

Re: Spaces in filenames in a spec file???

From: Jeff Johnson <n3npq@mac.com>
Date: Mon 13 Jul 2009 - 19:02:27 CEST
Message-id: <89E78929-131F-4D1E-A1A9-C0D9ADA4FA7A@mac.com>

On Jul 13, 2009, at 12:19 PM, Michael Lasevich wrote:

>> Due to the way macros are processed, having anything that starts w/  
>> a "%" in a comment is not guaranteed to be ignored.  If you'd like  
>> a rationale: macros are always expanded.. and may be multiple lines  
>> once expanded, only the first line would be commented out.
> ....
>> I suspect the #%pre or #%preun may be part of the problem.  Remove  
>> them, or again change the "%".
>> Also an empty changelog MIGHT cause problems.. (I'm not sure.)
>> --Mark
> Thats good to know, but I've been using this setup for 6+ years and  
> never had any other issues. (empty script tags do cause issue, thus  
> # if they are empty, but I will add a second % from now on just to  
> be sure)

The issue is only that scriptlet section markers (like %prep) are
increasingly being overloded as __MULTILINE__ macros by build mommas
who think overloading with macros is Cool! & Neat!.

If %prep becomes a multiline macro, then the "#" comment marker is not
propagated to the following lines, and the build fails for no
reason other than the build momma who did the macro overloading is an  

I categorically refuse to propagate leading comment markers into
macro expansions because its not only "#", but all possible, comment
markers that then need to be handled, and suddenly macro expansion
becaomes a very complicated because of additional contextual markers.

Otherwise It Simply Doesn't Matter how %foo is commented with "#".

> In any case, I removed ALL extra tags so new spec file is:
> ==========================================
> Release: 090713_1208
> License: None
> Group: None
> BuildRoot: /data/yum/factory/space_tester/root
> AutoReqProv: no
> Summary: No Summary
> BuildArch: noarch
> # Finished header
> %description
> Description:
> space_tester
> # Description done
> %files
> %defattr (755,root,root)
> %dir ""
> %attr(644,root,root) "/fileWithoutSpaces"
> %dir "/dirWithoutSpaces"
> %attr(644,root,root) "/File With Spaces"
> %dir "/dir With Spaces"
> ==========================================
> Same error.

Yes. From the error message you gave, I know what the flaw is.
This construct WORKSFORME @rpm5.org:

	%dir "/tmp/%{name} with spaces/"

I dimly remember fixing a couple years back, but my memory is  
sometimes flawed.

I'll check @rpm.org behavior next time I use (likely this week).

73 de Jeff
Received on Mon Jul 13 19:03:09 2009
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.