From 4fa1755315860eb4103971be0d950812b27a85c2 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 25 Sep 2015 11:52:32 -0400 Subject: [PATCH] Revert topic 'cpack-package-empty-dirs' The changes in commit 47b060ae (CPackDeb: allow empty directories in component packages, 2015-09-21), commit b58de9fe (CPack: allow packaging of empty directories, 2015-09-21), and commit b761e90d (CPack: remove accidental changes, 2015-09-22) regressed packaging of CMake itself. Revert the changes until they can be revised and rebased on other changes that make additional fixes. --- Help/release/dev/cpack-package-empty-dirs.rts | 4 ---- Source/CPack/cmCPackDebGenerator.cxx | 2 -- Source/CPack/cmCPackGenerator.cxx | 4 ---- Source/cmSystemTools.cxx | 21 ------------------- Tests/CPackComponentsDEB/CMakeLists.txt | 3 ++- .../RunCMake/CPack/COMPONENTS_EMPTY_DIR.cmake | 5 ----- .../COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake | 5 ----- .../DEB/COMPONENTS_EMPTY_DIR-specifics.cmake | 2 -- .../CPack/DEB/EMPTY_DIR-ExpectedFiles.cmake | 5 ----- .../CPack/DEB/EMPTY_DIR-specifics.cmake | 1 - Tests/RunCMake/CPack/EMPTY_DIR.cmake | 4 ---- .../COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake | 5 ----- .../CPack/RPM/COMPONENTS_EMPTY_DIR-stderr.txt | 1 - .../CPack/RPM/EMPTY_DIR-ExpectedFiles.cmake | 5 ----- Tests/RunCMake/CPack/RPM/EMPTY_DIR-stderr.txt | 1 - Tests/RunCMake/CPack/RunCMakeTest.cmake | 2 -- 16 files changed, 2 insertions(+), 68 deletions(-) delete mode 100644 Help/release/dev/cpack-package-empty-dirs.rts delete mode 100644 Tests/RunCMake/CPack/COMPONENTS_EMPTY_DIR.cmake delete mode 100644 Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-specifics.cmake delete mode 100644 Tests/RunCMake/CPack/DEB/EMPTY_DIR-ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/DEB/EMPTY_DIR-specifics.cmake delete mode 100644 Tests/RunCMake/CPack/EMPTY_DIR.cmake delete mode 100644 Tests/RunCMake/CPack/RPM/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/RPM/COMPONENTS_EMPTY_DIR-stderr.txt delete mode 100644 Tests/RunCMake/CPack/RPM/EMPTY_DIR-ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/RPM/EMPTY_DIR-stderr.txt diff --git a/Help/release/dev/cpack-package-empty-dirs.rts b/Help/release/dev/cpack-package-empty-dirs.rts deleted file mode 100644 index 1f56e1a90..000000000 --- a/Help/release/dev/cpack-package-empty-dirs.rts +++ /dev/null @@ -1,4 +0,0 @@ -cpack-package-empty-dirs ------------------------- - -* The :module:`CPack` module learned to package empty directories. diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index 93c94e2c1..5cdab5228 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -95,7 +95,6 @@ int cmCPackDebGenerator::PackageOnePack(std::string initialTopLevel, std::string findExpr(this->GetOption("GEN_WDIR")); findExpr += "/*"; gl.RecurseOn(); - gl.SetRecurseListDirs(true); if ( !gl.FindFiles(findExpr) ) { cmCPackLogger(cmCPackLog::LOG_ERROR, @@ -223,7 +222,6 @@ int cmCPackDebGenerator::PackageComponentsAllInOne() std::string findExpr(this->GetOption("GEN_WDIR")); findExpr += "/*"; gl.RecurseOn(); - gl.SetRecurseListDirs(true); if ( !gl.FindFiles(findExpr) ) { cmCPackLogger(cmCPackLog::LOG_ERROR, diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 04b197693..92a4b2bcd 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -367,7 +367,6 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories( cmCPackLogger(cmCPackLog::LOG_OUTPUT, "- Install directory: " << top << std::endl); gl.RecurseOn(); - gl.SetRecurseListDirs(true); if ( !gl.FindFiles(findExpr) ) { cmCPackLogger(cmCPackLog::LOG_ERROR, @@ -870,7 +869,6 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( cmsys::Glob glB; findExpr += "/*"; glB.RecurseOn(); - glB.SetRecurseListDirs(true); glB.FindFiles(findExpr); filesBefore = glB.GetFiles(); std::sort(filesBefore.begin(),filesBefore.end()); @@ -910,7 +908,6 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( { cmsys::Glob glA; glA.RecurseOn(); - glA.SetRecurseListDirs(true); glA.FindFiles(findExpr); std::vector filesAfter = glA.GetFiles(); std::sort(filesAfter.begin(),filesAfter.end()); @@ -1077,7 +1074,6 @@ int cmCPackGenerator::DoPackage() std::string findExpr = tempDirectory; findExpr += "/*"; gl.RecurseOn(); - gl.SetRecurseListDirs(true); gl.SetRecurseThroughSymlinks(false); if ( !gl.FindFiles(findExpr) ) { diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index c24b5ea39..26750665d 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -895,33 +895,12 @@ std::string cmSystemTools::FileExistsInParentDirectories(const char* fname, bool cmSystemTools::cmCopyFile(const char* source, const char* destination) { - // FIXME remove if statement once kwsys SystemTools get support for - // source is directory handling in CopyFileAlways function - if(cmSystemTools::FileIsDirectory(source)) - { - return Superclass::MakeDirectory(destination); - } - return Superclass::CopyFileAlways(source, destination); } bool cmSystemTools::CopyFileIfDifferent(const char* source, const char* destination) { - // FIXME remove if statement once kwsys SystemTools get support for - // source is directory handling in CopyFileIfDifferent function - if(cmSystemTools::FileIsDirectory(source)) - { - if(SystemTools::FileExists(destination)) - { - return true; - } - else - { - return Superclass::MakeDirectory(destination); - } - } - return Superclass::CopyFileIfDifferent(source, destination); } diff --git a/Tests/CPackComponentsDEB/CMakeLists.txt b/Tests/CPackComponentsDEB/CMakeLists.txt index 093b23fdd..98ed911c5 100644 --- a/Tests/CPackComponentsDEB/CMakeLists.txt +++ b/Tests/CPackComponentsDEB/CMakeLists.txt @@ -110,8 +110,9 @@ install(FILES ${CPackComponentsDEB_BINARY_DIR}/symtest if(EXISTS "./dirtest") execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory ./dirtest) endif() -# NOTE: directory left empty on purpose execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ./dirtest) +# BUG: apparently cannot add an empty directory +execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ../mylibapp ./dirtest/symtest) # NOTE: we should not add the trailing "/" to dirtest install(DIRECTORY ${CPackComponentsDEB_BINARY_DIR}/dirtest DESTINATION bin/ diff --git a/Tests/RunCMake/CPack/COMPONENTS_EMPTY_DIR.cmake b/Tests/RunCMake/CPack/COMPONENTS_EMPTY_DIR.cmake deleted file mode 100644 index 7210e7d63..000000000 --- a/Tests/RunCMake/CPack/COMPONENTS_EMPTY_DIR.cmake +++ /dev/null @@ -1,5 +0,0 @@ -set(CPACK_COMPONENTS_ALL test) -install(DIRECTORY DESTINATION empty - COMPONENT test) - -set(CPACK_PACKAGE_NAME "components_empty_dir") diff --git a/Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake b/Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake deleted file mode 100644 index 5adca685a..000000000 --- a/Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake +++ /dev/null @@ -1,5 +0,0 @@ -set(whitespaces_ "[\t\n\r ]*") - -set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILE_1 "components_empty_dir*.deb") -set(EXPECTED_FILE_CONTENT_1 "^.*/usr/${whitespaces_}.*/usr/empty/$") diff --git a/Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-specifics.cmake b/Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-specifics.cmake deleted file mode 100644 index 2720fe921..000000000 --- a/Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-specifics.cmake +++ /dev/null @@ -1,2 +0,0 @@ -set(CPACK_PACKAGE_CONTACT "someone") -set(CPACK_DEB_COMPONENT_INSTALL "ON") diff --git a/Tests/RunCMake/CPack/DEB/EMPTY_DIR-ExpectedFiles.cmake b/Tests/RunCMake/CPack/DEB/EMPTY_DIR-ExpectedFiles.cmake deleted file mode 100644 index 1552a36ad..000000000 --- a/Tests/RunCMake/CPack/DEB/EMPTY_DIR-ExpectedFiles.cmake +++ /dev/null @@ -1,5 +0,0 @@ -set(whitespaces_ "[\t\n\r ]*") - -set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILE_1 "empty_dir*.deb") -set(EXPECTED_FILE_CONTENT_1 "^.*/usr/${whitespaces_}.*/usr/empty/$") diff --git a/Tests/RunCMake/CPack/DEB/EMPTY_DIR-specifics.cmake b/Tests/RunCMake/CPack/DEB/EMPTY_DIR-specifics.cmake deleted file mode 100644 index 8821ab9be..000000000 --- a/Tests/RunCMake/CPack/DEB/EMPTY_DIR-specifics.cmake +++ /dev/null @@ -1 +0,0 @@ -set(CPACK_PACKAGE_CONTACT "someone") diff --git a/Tests/RunCMake/CPack/EMPTY_DIR.cmake b/Tests/RunCMake/CPack/EMPTY_DIR.cmake deleted file mode 100644 index 023ba173e..000000000 --- a/Tests/RunCMake/CPack/EMPTY_DIR.cmake +++ /dev/null @@ -1,4 +0,0 @@ -install(DIRECTORY DESTINATION empty - COMPONENT test) - -set(CPACK_PACKAGE_NAME "empty_dir") diff --git a/Tests/RunCMake/CPack/RPM/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake b/Tests/RunCMake/CPack/RPM/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake deleted file mode 100644 index d3962768f..000000000 --- a/Tests/RunCMake/CPack/RPM/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake +++ /dev/null @@ -1,5 +0,0 @@ -set(whitespaces_ "[\t\n\r ]*") - -set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILE_1 "components_empty_dir*.rpm") -set(EXPECTED_FILE_CONTENT_1 "^/usr/empty$") diff --git a/Tests/RunCMake/CPack/RPM/COMPONENTS_EMPTY_DIR-stderr.txt b/Tests/RunCMake/CPack/RPM/COMPONENTS_EMPTY_DIR-stderr.txt deleted file mode 100644 index 6ddca1275..000000000 --- a/Tests/RunCMake/CPack/RPM/COMPONENTS_EMPTY_DIR-stderr.txt +++ /dev/null @@ -1 +0,0 @@ -^CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/COMPONENTS_EMPTY_DIR-build/_CPack_Packages/.*/RPM/SPECS/components_empty_dir.spec$ diff --git a/Tests/RunCMake/CPack/RPM/EMPTY_DIR-ExpectedFiles.cmake b/Tests/RunCMake/CPack/RPM/EMPTY_DIR-ExpectedFiles.cmake deleted file mode 100644 index 0c2977f7b..000000000 --- a/Tests/RunCMake/CPack/RPM/EMPTY_DIR-ExpectedFiles.cmake +++ /dev/null @@ -1,5 +0,0 @@ -set(whitespaces_ "[\t\n\r ]*") - -set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILE_1 "empty_dir*.rpm") -set(EXPECTED_FILE_CONTENT_1 "^/usr/empty$") diff --git a/Tests/RunCMake/CPack/RPM/EMPTY_DIR-stderr.txt b/Tests/RunCMake/CPack/RPM/EMPTY_DIR-stderr.txt deleted file mode 100644 index 1777aa01d..000000000 --- a/Tests/RunCMake/CPack/RPM/EMPTY_DIR-stderr.txt +++ /dev/null @@ -1 +0,0 @@ -^CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/EMPTY_DIR-build/_CPack_Packages/.*/RPM/SPECS/empty_dir.spec$ diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake index 89673c2ad..3e5714d2c 100644 --- a/Tests/RunCMake/CPack/RunCMakeTest.cmake +++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake @@ -8,5 +8,3 @@ run_cpack_test(MINIMAL "RPM;DEB" false) run_cpack_test(PARTIALLY_RELOCATABLE_WARNING "RPM" false) run_cpack_test(DEB_EXTRA "DEB" false) run_cpack_test(DEPENDENCIES "RPM;DEB" true) -run_cpack_test(EMPTY_DIR "RPM;DEB" true) -run_cpack_test(COMPONENTS_EMPTY_DIR "RPM;DEB" true)