[cmake-developers] CpackRPM doesn't escape filenames

Harry Mallon Harry at codexdigital.com
Tue Jul 12 07:12:21 EDT 2016


Hi Brad,

A simple version, which covers the main test case is shown here. The %files list in the auto spec file shows "%dist.txt" when I think it should show "%%dist.txt". Even when I manually changed it to %% it didn't work for me though. Maybe someone who knows RPM better would be able to tell me why. Other cases could also be tested by adding more files (for those who have any of ?|*.\'" in their file names).

----------------------

CMakeLists.txt:

cmake_minimum_required(VERSION 3.5)

set(CPACK_GENERATOR "RPM")

project(Test)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/%dist.txt" "")

install(FILES
    "${CMAKE_CURRENT_BINARY_DIR}/%dist.txt"
    DESTINATION foo
)

include(CPack)



Harry Mallon
CODEX | Software Engineer
60 Poland Street | London | England | W1F 7NT
E harry at codexdigital.com | T +44 203 7000 989
> On 11 Jul 2016, at 19:10, Brad King <brad.king at kitware.com> wrote:
>
> On 07/11/2016 11:32 AM, Harry Mallon wrote:
>> When using CPackRPM my filenames in auto generated RPM SPEC
>> look like "/usr/share/foo/bar10%.xml" when the "%" symbol
>> (which is in the filename should be escaped to "%%".
>
> Thanks.  Please open an issue here:
>
> https://gitlab.kitware.com/cmake/cmake/issues
>
> Ideally please include a http://sscce.org/ showing how to
> reproduce the problem.  Then perhaps it can be adapted as
> a test case.
>
> Thanks,
> -Brad
>



More information about the cmake-developers mailing list