소스 검색

Merge branch 'CPackRPM-handleFileWithSpace'

Brad King 15 년 전
부모
커밋
48ac8180db
1개의 변경된 파일4개의 추가작업 그리고 3개의 파일을 삭제
  1. 4 3
      Modules/CPackRPM.cmake

+ 4 - 3
Modules/CPackRPM.cmake

@@ -430,12 +430,13 @@ SET(CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}")
 
 # Use files tree to construct files command (spec file)
 # 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)
 # because rpmbuild may automatically compress those files
 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}"
                OUTPUT_VARIABLE CPACK_RPM_INSTALL_FILES)