MantisBT - CMake
View Issue Details
0013468CMakeCPackpublic2012-08-14 04:322013-08-16 05:33
Viktor Dubrovsky 
Eric NOULARD 
normalcrashalways
closedfixed 
i686Suse Linux Enterprise Server11sp1
CMake 2.8.9 
CMake 2.8.10 
0013468: Can't add attr directive to CPACK_RPM_USER_FILELIST
When I try to add directive "%attr(777,-,-) /path/to/file" to CPACK_RPM_USER_FILELIST rpmbuid crashes, because cpack doesn't correct parse this string.
I get in .spec file this stuff:
%config "/path/to/file"
%attr( "%attr(777,-,-) /path/to/file"
Add "%attr(777,-,-) /path/to/file" to CPACK_RPM_USER_FILELIST.
It's simply to fix. Expand regexp in 712 and 713 lines CPackRPM.cmake file with characters "0-9", "," and "-".
I substitute those regexps by mine:
string(REGEX REPLACE "%[A-Za-z0-9\(\)-\,]* " "" F_PATH ${F})
string(REGEX MATCH "%[A-Za-z0-9\(\)-\,]*" F_PREFIX ${F})

And all goes to work fine!
Sorry for my bad english :)
No tags attached.
related to 0014362closed Kitware Robot Can't add attr directive to CPACK_RPM_USER_FILELIST (some symbols not allowed) 
Issue History
2012-08-14 04:32Viktor DubrovskyNew Issue
2012-08-14 05:11Rolf Eike BeerAssigned To => Eric NOULARD
2012-08-14 05:11Rolf Eike BeerStatusnew => assigned
2012-08-14 13:38Eric NOULARDTarget Version => CMake 2.8.10
2012-08-14 13:45Eric NOULARDNote Added: 0030646
2012-08-14 13:45Eric NOULARDStatusassigned => resolved
2012-08-14 13:45Eric NOULARDResolutionopen => fixed
2012-09-04 14:55Eric NOULARDNote Added: 0030913
2012-09-04 14:55Eric NOULARDStatusresolved => feedback
2012-09-04 14:55Eric NOULARDResolutionfixed => reopened
2012-09-10 16:43Eric NOULARDNote Added: 0030990
2012-09-10 16:43Eric NOULARDStatusfeedback => resolved
2012-09-10 16:43Eric NOULARDResolutionreopened => fixed
2013-03-04 08:38Robert MaynardNote Added: 0032443
2013-03-04 08:38Robert MaynardStatusresolved => closed
2013-08-16 05:33Eric NOULARDRelationship addedrelated to 0014362

Notes
(0030646)
Eric NOULARD   
2012-08-14 13:45   
Thank you Viktor.

Just pushed the fix into next.
Merge topic 'CPackRPM_handleAttrDirectiveProperly' into next

4198963 Handles %attr(nnn,-,-) /path/to/file in CPACK_RPM_USER_FILELIST properly.
(0030913)
Eric NOULARD   
2012-09-04 14:55   
From cmake-developer mailing list.
The fix was wrong, the message is not yet in
the ML archive so here comes the excerpt concerning this bug:

David Cole Said:
The character set used in the REGEX here has errors in it: [A-Za-z\(\)-\,]

1) The comma does not need to be escaped in this character set
context, but "\\" does if you mean to include the backslash character.
2) The hyphen, if meant to be matched is not matched here, but used as
a range separator from the \) to the \,

What's the intent of the change? To handle commas and hyphens, you
would add ",-" at the end of the existing character set. If more
characters need to be matched, then add them, but keep the hyphen last
or make it first or escape it in order to match it here.
(0030990)
Eric NOULARD   
2012-09-10 16:43   
I did revert the commit in stage and next in order to avoid conflict and
propose a cleaner history:
Merge topic 'CPackRPM_handleAttrDirectiveProperly' into next

3608a36 Revert "Handles %attr(nnn,-,-) /path/to/file in CPACK_RPM_USER_FILELIST properly."

Then I restarted the branch as "CPackRPM_handleAttrDirectiveProperly-reloaded",
pushed it to stage and then merge it to next:

Merge topic 'CPackRPM_handleAttrDirectiveProperly-reloaded' into next

d8a1dd5 Handles %attr(nnn,-,-) /path/to/file in CPACK_RPM_USER_FILELIST properly.
(0032443)
Robert Maynard   
2013-03-04 08:38   
Closing resolved issues that have not been updated in more than 4 months.