浏览代码

CPackRPM:: Quote every filenames in %file section (see bugs 10701,10871,10345)

Eric NOULARD 15 年之前
父节点
当前提交
6926e9114c
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4 3
      Modules/CPackRPM.cmake

+ 4 - 3
Modules/CPackRPM.cmake

@@ -396,12 +396,13 @@ SET(CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}")
 
 
 # Use files tree to construct files command (spec file)
 # Use files tree to construct files command (spec file)
 # We should not forget to include symlinks (thus -o -type l)
 # We should not forget to include symlinks (thus -o -type l)
-# We must remove the './' due to the local search (thus the sed)
+# We must remove the './' due to the local search and escape the
+# file name by enclosing it between double quotes (thus the sed)
 # Then we must authorize any man pages extension (adding * at the end)
 # Then we must authorize any man pages extension (adding * at the end)
 # because rpmbuild may automatically compress those files
 # because rpmbuild may automatically compress those files
 EXECUTE_PROCESS(COMMAND find -type f -o -type l
 EXECUTE_PROCESS(COMMAND find -type f -o -type l
-               COMMAND sed {s/\\.//}
-               COMMAND sed {s/.*man.*\\/.*/&*/}
+               COMMAND sed {s:.*/man.*/.*:&*:}
+               COMMAND sed {s/\\.\\\(.*\\\)/\"\\1\"/}
                WORKING_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}"
                WORKING_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}"
                OUTPUT_VARIABLE CPACK_RPM_INSTALL_FILES)
                OUTPUT_VARIABLE CPACK_RPM_INSTALL_FILES)