From 8f3367449183608fbae0de171825e75da8f6b79a Mon Sep 17 00:00:00 2001 From: Asit Dhal Date: Fri, 15 Jan 2021 16:34:03 +0100 Subject: cpack(DEB): Issue warning if custom script for control file is missing Fixes: #17794 --- Source/CPack/cmCPackDebGenerator.cxx | 9 +++++++++ Tests/RunCMake/CPack/tests/EXTRA/DEB-stderr.txt | 6 ++++++ 2 files changed, 15 insertions(+) create mode 100644 Tests/RunCMake/CPack/tests/EXTRA/DEB-stderr.txt diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index 43dbdb5..1220514 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -396,6 +396,15 @@ bool DebGenerator::generateControlTar(std::string const& md5Filename) const } // if we can copy the file, it means it does exist, let's add it: + if (!cmsys::SystemTools::FileExists(i)) { + cmCPackLogger(cmCPackLog::LOG_WARNING, + "Adding file to tar:" << std::endl + << "#top level directory: " + << this->WorkDir << std::endl + << "#missing file: " << i + << std::endl); + } + if (cmsys::SystemTools::CopyFileIfDifferent(i, localcopy)) { control_tar.Add(localcopy, this->WorkDir.length(), "."); } diff --git a/Tests/RunCMake/CPack/tests/EXTRA/DEB-stderr.txt b/Tests/RunCMake/CPack/tests/EXTRA/DEB-stderr.txt new file mode 100644 index 0000000..37360e8 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/EXTRA/DEB-stderr.txt @@ -0,0 +1,6 @@ +CPack Warning: Adding file to tar: +#top level directory: .*/Tests/RunCMake/DEB.EXTRA/CPack/EXTRA-build/_CPack_Packages/Linux/DEB/extra-0.1.1-Linux/bas +#missing file: .*/Tests/RunCMake/DEB.EXTRA/CPack/EXTRA-build/conffiles +CPack Warning: Adding file to tar: +#top level directory: .*/Tests/RunCMake/DEB.EXTRA/CPack/EXTRA-build/_CPack_Packages/Linux/DEB/extra-0.1.1-Linux/foo +#missing file: .*/Tests/RunCMake/DEB.EXTRA/CPack/EXTRA-build/conffiles -- cgit v0.12