[Cmake-commits] CMake branch, master, updated. v3.9.3-910-g33eec57

Kitware Robot kwrobot at kitware.com
Fri Sep 22 10:15:14 EDT 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
       via  33eec572328847da74f87c99bde3c5f0eef992bb (commit)
       via  9c20ef95e01f97849e0a4008ac732c823a067ce5 (commit)
       via  a6f2ea6adae8ec1a15f2bb25f4fe12c2564577c5 (commit)
       via  00389afa345378244105c363d273f654d0ddd00a (commit)
       via  545d9a17e5f0605d3bbbf9e16baa427ef254a4ae (commit)
       via  74b7457f12c943abd2c33aebc8ada5b50e331f50 (commit)
       via  4c0edbd725976f947398f1513cef3f36ec05cc5f (commit)
       via  28d2c6ef7e807c53a8bee76c86525f254fc4c54c (commit)
       via  37d9387be37b5ad51b518d5df467b64e88f73350 (commit)
      from  583d8e55acf79f7f6e1e9c4fdae6f83561d0c7c1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=33eec572328847da74f87c99bde3c5f0eef992bb
commit 33eec572328847da74f87c99bde3c5f0eef992bb
Merge: 9c20ef9 74b7457
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 22 14:14:24 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Sep 22 10:14:49 2017 -0400

    Merge topic 'cpack-rpm-deb-version'
    
    74b7457f CPack RPM and DEB: improved package version handling
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1296


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9c20ef95e01f97849e0a4008ac732c823a067ce5
commit 9c20ef95e01f97849e0a4008ac732c823a067ce5
Merge: a6f2ea6 545d9a1
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 22 14:14:13 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Sep 22 10:14:23 2017 -0400

    Merge topic 'cpack-rpm-extend-exclude-from-auto-filelist'
    
    545d9a17 CPack/RPM: new CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST exclude paths
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1299


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a6f2ea6adae8ec1a15f2bb25f4fe12c2564577c5
commit a6f2ea6adae8ec1a15f2bb25f4fe12c2564577c5
Merge: 00389af 4c0edbd
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 22 14:12:34 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Sep 22 10:12:48 2017 -0400

    Merge topic 'variable_watch-modify-on-callback'
    
    4c0edbd7 variable_watch: Made it safe to add/remove watches in access callbacks
    28d2c6ef test: Added additional unit test to variable_watch
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1284


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=00389afa345378244105c363d273f654d0ddd00a
commit 00389afa345378244105c363d273f654d0ddd00a
Merge: 583d8e5 37d9387
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 22 14:10:55 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Sep 22 10:11:23 2017 -0400

    Merge topic 'string-empty'
    
    37d9387b Replace empty-string comparisons with checking against `empty()`.
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1275


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=545d9a17e5f0605d3bbbf9e16baa427ef254a4ae
commit 545d9a17e5f0605d3bbbf9e16baa427ef254a4ae
Author:     Domen Vrankar <domen.vrankar at gmail.com>
AuthorDate: Thu Sep 21 20:58:28 2017 +0200
Commit:     Domen Vrankar <domen.vrankar at gmail.com>
CommitDate: Thu Sep 21 20:59:13 2017 +0200

    CPack/RPM: new CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST exclude paths
    
    Patch adds `/usr/share/aclocal` path to exclude list and
    and documents `/usr/libx32` and `/usr/include` paths that
    were already on the list.
    
    Closes: #17056

diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index 3913494..a770f04 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -530,7 +530,9 @@
 #  list of path to be excluded.
 #
 #  * Mandatory : NO
-#  * Default   : /etc /etc/init.d /usr /usr/share /usr/share/doc /usr/bin /usr/lib /usr/lib64 /usr/include
+#  * Default   : /etc /etc/init.d /usr /usr/bin /usr/include /usr/lib
+#                /usr/libx32 /usr/lib64 /usr/share /usr/share/aclocal
+#                /usr/share/doc
 #
 #  May be used to exclude path (directories or files) from the auto-generated
 #  list of paths discovered by CPack RPM. The defaut value contains a
@@ -1083,7 +1085,9 @@ function(cpack_rpm_prepare_content_list)
   endif()
 
   if(NOT DEFINED CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST)
-    set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST /etc /etc/init.d /usr /usr/share /usr/share/doc /usr/bin /usr/lib /usr/lib64 /usr/libx32 /usr/include)
+    set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST /etc /etc/init.d /usr /usr/bin
+        /usr/include /usr/lib /usr/libx32 /usr/lib64
+        /usr/share /usr/share/aclocal /usr/share/doc )
     if(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION)
       if(CPACK_RPM_PACKAGE_DEBUG)
         message("CPackRPM:Debug: Adding ${CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION} to builtin omit list.")

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=74b7457f12c943abd2c33aebc8ada5b50e331f50
commit 74b7457f12c943abd2c33aebc8ada5b50e331f50
Author:     Domen Vrankar <domen.vrankar at gmail.com>
AuthorDate: Thu Sep 21 07:53:42 2017 +0200
Commit:     Domen Vrankar <domen.vrankar at gmail.com>
CommitDate: Thu Sep 21 19:54:17 2017 +0200

    CPack RPM and DEB: improved package version handling
    
    Adds support for epoch version to CPackRPM and
    CPackDeb packagers.
    Also adds better version checking to CPackDeb
    that complies with Debian rules.
    
    Fixes: #17057

diff --git a/Help/release/dev/cpack-rpm-deb-version.rst b/Help/release/dev/cpack-rpm-deb-version.rst
new file mode 100644
index 0000000..a64e8bd
--- /dev/null
+++ b/Help/release/dev/cpack-rpm-deb-version.rst
@@ -0,0 +1,14 @@
+cpack-rpm-deb-version
+---------------------
+
+* Modules :module:`CPackRPM` and :module:`CPackDeb` learned to set package epoch
+  version.
+  See :variable:`CPACK_RPM_PACKAGE_EPOCH` and
+  :variable:`CPACK_DEBIAN_PACKAGE_EPOCH` variables.
+
+* The :module:`CPackDeb` module learned to set package release version in
+  `Version` info property.
+  See :variable:`CPACK_DEBIAN_PACKAGE_RELEASE` variable.
+
+* The :module:`CPackDeb` module learned more strict package version checking
+  that complies with Debian rules.
diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake
index 85d564e..337bec8 100644
--- a/Modules/CPackDeb.cmake
+++ b/Modules/CPackDeb.cmake
@@ -88,6 +88,16 @@
 #    get overwritten and it is up to the packager to set the variables in a
 #    manner that will prevent such errors.
 #
+# .. variable:: CPACK_DEBIAN_PACKAGE_EPOCH
+#
+#  The Debian package epoch
+#
+#  * Mandatory : No
+#  * Default   : -
+#
+#  Optional number that should be incremented when changing versioning schemas
+#  or fixing mistakes in the version numbers of older packages.
+#
 # .. variable:: CPACK_DEBIAN_PACKAGE_VERSION
 #
 #  The Debian package version
@@ -95,12 +105,17 @@
 #  * Mandatory : YES
 #  * Default   : :variable:`CPACK_PACKAGE_VERSION`
 #
+#  This variable may contain only alphanumerics (A-Za-z0-9) and the characters
+#  . + - ~ (full stop, plus, hyphen, tilde) and should start with a digit. If
+#  :variable:`CPACK_DEBIAN_PACKAGE_RELEASE` is not set then hyphens are not
+#  allowed.
+#
 # .. variable:: CPACK_DEBIAN_PACKAGE_RELEASE
 #
 #  The Debian package release - Debian revision number.
 #
-#  * Mandatory : YES
-#  * Default   : 1
+#  * Mandatory : No
+#  * Default   : -
 #
 #  This is the numbering of the DEB package itself, i.e. the version of the
 #  packaging and not the version of the content (see
@@ -738,6 +753,32 @@ function(cpack_deb_prepare_package_vars)
     set(CPACK_DEBIAN_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
   endif()
 
+  if(NOT CPACK_DEBIAN_PACKAGE_VERSION MATCHES "^[0-9][A-Za-z0-9.+-~]*$")
+    message(FATAL_ERROR
+      "CPackDeb: Debian package version must confirm to \"^[0-9][A-Za-z0-9.+-~]*$\" regex!")
+  endif()
+
+  if(CPACK_DEBIAN_PACKAGE_RELEASE)
+    if(NOT CPACK_DEBIAN_PACKAGE_RELEASE MATCHES "^[A-Za-z0-9.+~]+$")
+      message(FATAL_ERROR
+        "CPackDeb: Debian package release must confirm to \"^[A-Za-z0-9.+~]+$\" regex!")
+    endif()
+    string(APPEND CPACK_DEBIAN_PACKAGE_VERSION
+      "-${CPACK_DEBIAN_PACKAGE_RELEASE}")
+  elseif(CPACK_DEBIAN_PACKAGE_VERSION MATCHES ".*-.*")
+    message(FATAL_ERROR
+      "CPackDeb: Debian package version must not contain hyphens when CPACK_DEBIAN_PACKAGE_RELEASE is not provided!")
+  endif()
+
+  if(CPACK_DEBIAN_PACKAGE_EPOCH)
+    if(NOT CPACK_DEBIAN_PACKAGE_EPOCH MATCHES "^[0-9]+$")
+      message(FATAL_ERROR
+        "CPackDeb: Debian package epoch must confirm to \"^[0-9]+$\" regex!")
+    endif()
+    set(CPACK_DEBIAN_PACKAGE_VERSION
+      "${CPACK_DEBIAN_PACKAGE_EPOCH}:${CPACK_DEBIAN_PACKAGE_VERSION}")
+  endif()
+
   # Architecture: (mandatory)
   if(CPACK_DEB_PACKAGE_COMPONENT AND CPACK_DEBIAN_${_local_component_name}_PACKAGE_ARCHITECTURE)
     set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "${CPACK_DEBIAN_${_local_component_name}_PACKAGE_ARCHITECTURE}")
@@ -961,11 +1002,6 @@ function(cpack_deb_prepare_package_vars)
     set(CPACK_DEBIAN_GENERATE_POSTRM 0)
   endif()
 
-  if(NOT CPACK_DEBIAN_PACKAGE_RELEASE)
-    set(CPACK_DEBIAN_PACKAGE_RELEASE 1)
-  endif()
-
-
   cpack_deb_variable_fallback("CPACK_DEBIAN_FILE_NAME"
     "CPACK_DEBIAN_${_local_component_name}_FILE_NAME"
     "CPACK_DEBIAN_FILE_NAME")
@@ -974,7 +1010,7 @@ function(cpack_deb_prepare_package_vars)
       # Patch package file name to be in corrent debian format:
       # <foo>_<VersionNumber>-<DebianRevisionNumber>_<DebianArchitecture>.deb
       set(CPACK_OUTPUT_FILE_NAME
-        "${CPACK_DEBIAN_PACKAGE_NAME}_${CPACK_DEBIAN_PACKAGE_VERSION}-${CPACK_DEBIAN_PACKAGE_RELEASE}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.deb")
+        "${CPACK_DEBIAN_PACKAGE_NAME}_${CPACK_DEBIAN_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.deb")
     else()
       cmake_policy(PUSH)
         cmake_policy(SET CMP0010 NEW)
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index 3913494..6cbf25a 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -106,6 +106,16 @@
 #  group rpm package is generated without component suffix in filename and
 #  package name.
 #
+# .. variable:: CPACK_RPM_PACKAGE_EPOCH
+#
+#  The RPM package epoch
+#
+#  * Mandatory : No
+#  * Default   : -
+#
+#  Optional number that should be incremented when changing versioning schemas
+#  or fixing mistakes in the version numbers of older packages.
+#
 # .. variable:: CPACK_RPM_PACKAGE_VERSION
 #
 #  The RPM package version.
@@ -1891,11 +1901,16 @@ function(cpack_rpm_generate_package)
     OUTPUT_STRIP_TRAILING_WHITESPACE)
   string(REPLACE "\n" ";" RPMBUILD_TAG_LIST "${RPMBUILD_TAG_LIST}")
 
+  if(CPACK_RPM_PACKAGE_EPOCH)
+    set(TMP_RPM_EPOCH "Epoch: ${CPACK_RPM_PACKAGE_EPOCH}")
+  endif()
+
   # Check if additional fields for RPM spec header are given
   # There may be some COMPONENT specific variables as well
   # If component specific var is not provided we use the global one
   # for each component
   foreach(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLICTS AUTOPROV AUTOREQ AUTOREQPROV REQUIRES_PRE REQUIRES_POST REQUIRES_PREUN REQUIRES_POSTUN)
+
     if(CPACK_RPM_PACKAGE_DEBUG)
       message("CPackRPM:Debug: processing ${_RPM_SPEC_HEADER}")
     endif()
@@ -2501,6 +2516,7 @@ Vendor:         \@CPACK_RPM_PACKAGE_VENDOR\@
 \@TMP_RPM_AUTOREQPROV\@
 \@TMP_RPM_BUILDARCH\@
 \@TMP_RPM_PREFIXES\@
+\@TMP_RPM_EPOCH\@
 
 %description -n \@CPACK_RPM_PACKAGE_NAME\@
 \@CPACK_RPM_PACKAGE_DESCRIPTION\@
@@ -2560,6 +2576,7 @@ Vendor:         \@CPACK_RPM_PACKAGE_VENDOR\@
 \@TMP_RPM_AUTOREQPROV\@
 \@TMP_RPM_BUILDARCH\@
 \@TMP_RPM_PREFIXES\@
+\@TMP_RPM_EPOCH\@
 
 \@TMP_RPM_DEBUGINFO\@
 
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake
index 70d6edf..73fd0ab 100644
--- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake
@@ -6,7 +6,7 @@ include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
 
 
 # expected results
-set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2-1_*.deb")
+set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2_*.deb")
 set(expected_count 3)
 
 
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake
index 415d536..81dbbc5 100644
--- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake
@@ -6,7 +6,7 @@ include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
 
 
 # expected results
-set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2-1_*.deb")
+set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2_*.deb")
 set(expected_count 3)
 
 set(config_verbose -V)
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake
index 337cc16..ad52f56 100644
--- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake
@@ -6,7 +6,7 @@ include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
 
 
 # expected results
-set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2-1_*.deb")
+set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2_*.deb")
 set(expected_count 3)
 
 
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake
index 35ca74c..af27c51 100644
--- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake
@@ -7,7 +7,7 @@ include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
 
 
 # expected results
-set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2-1_*.deb")
+set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2_*.deb")
 set(expected_count 3)
 
 
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake
index f1391cd..1fe9258 100644
--- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake
@@ -5,7 +5,7 @@ endif()
 include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
 
 # TODO: currently debian doens't produce lower cased names
-set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2-1_*.deb")
+set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2_*.deb")
 set(expected_count 3)
 
 
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-shlibdeps1.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-shlibdeps1.cmake
index fcfc7ea..e57488c 100644
--- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-shlibdeps1.cmake
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-shlibdeps1.cmake
@@ -9,7 +9,7 @@ include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
 # requirements
 
 # debian now produces lower case names
-set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2-1_*.deb")
+set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2_*.deb")
 set(expected_count 3)
 
 
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake
index 351bf21..5ee057a 100644
--- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake
@@ -6,7 +6,7 @@ include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
 
 
 # expected results
-set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2-1_*.deb")
+set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2_*.deb")
 set(expected_count 3)
 
 set(config_verbose -V)
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake
index c97ecb0..13a626a 100644
--- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake
@@ -5,7 +5,7 @@ endif()
 include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
 
 # TODO: currently debian doens't produce lower cased names
-set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib_1.0.2-1_*.deb")
+set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib_1.0.2_*.deb")
 set(expected_count 1)
 
 set(actual_output)
diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
index a5b38fd..2c3a849 100644
--- a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
+++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
@@ -60,7 +60,7 @@ elseif (CPackGen MATCHES "RPM")
         set(expected_count 1)
     endif ()
 elseif (CPackGen MATCHES "DEB")
-    set(expected_file_mask "${CPackComponentsForAll_BINARY_DIR}/mylib*_1.0.2-1_*.deb")
+    set(expected_file_mask "${CPackComponentsForAll_BINARY_DIR}/mylib*_1.0.2_*.deb")
     if (${CPackComponentWay} STREQUAL "default")
         set(expected_count 1)
     elseif (${CPackComponentWay} STREQUAL "OnePackPerGroup")
diff --git a/Tests/RunCMake/CPack/DEB/Helpers.cmake b/Tests/RunCMake/CPack/DEB/Helpers.cmake
index ad1b47b..6d8e84a 100644
--- a/Tests/RunCMake/CPack/DEB/Helpers.cmake
+++ b/Tests/RunCMake/CPack/DEB/Helpers.cmake
@@ -23,7 +23,7 @@ function(getPackageNameGlobexpr NAME COMPONENT VERSION REVISION FILE_NO RESULT_V
   endif()
 
   if(GENERATOR_SPECIFIC_FORMAT)
-    set(${RESULT_VAR} "${NAME}${COMPONENT}_${VERSION}-${REVISION}_*.deb" PARENT_SCOPE)
+    set(${RESULT_VAR} "${NAME}${COMPONENT}_${VERSION}_*.deb" PARENT_SCOPE)
   else()
     set(${RESULT_VAR} "${NAME}-${VERSION}-*${COMPONENT}.deb" PARENT_SCOPE)
   endif()
diff --git a/Tests/RunCMake/CPack/RPM/Helpers.cmake b/Tests/RunCMake/CPack/RPM/Helpers.cmake
index d8012b1..88fc231 100644
--- a/Tests/RunCMake/CPack/RPM/Helpers.cmake
+++ b/Tests/RunCMake/CPack/RPM/Helpers.cmake
@@ -23,6 +23,9 @@ function(getPackageNameGlobexpr NAME COMPONENT VERSION REVISION FILE_NO RESULT_V
   endif()
 
   if(GENERATOR_SPECIFIC_FORMAT)
+    if(NOT REVISION)
+      set(REVISION "1")
+    endif()
     set(${RESULT_VAR} "${NAME}${COMPONENT}-${VERSION}-${REVISION}.*.rpm" PARENT_SCOPE)
   else()
     set(${RESULT_VAR} "${NAME}-${VERSION}-*${COMPONENT}.rpm" PARENT_SCOPE)
diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake
index faf151a..5718191 100644
--- a/Tests/RunCMake/CPack/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake
@@ -10,6 +10,7 @@ run_cpack_test(DEBUGINFO "RPM" true "COMPONENT")
 run_cpack_test(DEPENDENCIES "RPM;DEB" true "COMPONENT")
 run_cpack_test(DIST "RPM" false "MONOLITHIC")
 run_cpack_test(EMPTY_DIR "RPM;DEB;TGZ" true "MONOLITHIC;COMPONENT")
+run_cpack_test(VERSION "RPM;DEB" false "MONOLITHIC;COMPONENT")
 run_cpack_test(EXTRA "DEB" false "COMPONENT")
 run_cpack_test(GENERATE_SHLIBS "DEB" true "COMPONENT")
 run_cpack_test(GENERATE_SHLIBS_LDCONFIG "DEB" true "COMPONENT")
diff --git a/Tests/RunCMake/CPack/VerifyResult.cmake b/Tests/RunCMake/CPack/VerifyResult.cmake
index 470ebf7..1f5ab87 100644
--- a/Tests/RunCMake/CPack/VerifyResult.cmake
+++ b/Tests/RunCMake/CPack/VerifyResult.cmake
@@ -8,9 +8,7 @@ function(findExpectedFile FILE_NO RESULT_VAR GLOBING_EXPR_VAR)
     endif()
     if(NOT DEFINED EXPECTED_FILE_${FILE_NO}_VERSION)
       set(EXPECTED_FILE_${FILE_NO}_VERSION "0.1.1")
-    endif()
-    if(NOT DEFINED EXPECTED_FILE_${FILE_NO}_REVISION)
-      set(EXPECTED_FILE_${FILE_NO}_REVISION "1")
+      set(EXPECTED_FILE_${FILE_NO}_VERSION "0.1.1" PARENT_SCOPE)
     endif()
 
     getPackageNameGlobexpr("${EXPECTED_FILE_${FILE_NO}_NAME}"
diff --git a/Tests/RunCMake/CPack/tests/VERSION/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/VERSION/ExpectedFiles.cmake
new file mode 100644
index 0000000..85c571c
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/VERSION/ExpectedFiles.cmake
@@ -0,0 +1,3 @@
+set(EXPECTED_FILES_COUNT "1")
+set(EXPECTED_FILE_CONTENT_1_LIST "/usr;/usr/foo;/usr/foo/CMakeLists.txt")
+set(EXPECTED_FILE_1_REVISION "1")
diff --git a/Tests/RunCMake/CPack/tests/VERSION/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/VERSION/VerifyResult.cmake
new file mode 100644
index 0000000..eed9696
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/VERSION/VerifyResult.cmake
@@ -0,0 +1,17 @@
+function(checkPackageInfo_ TYPE FILE REGEX)
+  getPackageInfo("${FILE}" "FILE_INFO_")
+  if(NOT FILE_INFO_ MATCHES "${REGEX}")
+    message(FATAL_ERROR "Unexpected ${TYPE} in '${FILE}' ${EXPECTED_FILE_1_VERSION} ${EXPECTED_FILE_1_REVISION}; file info: '${FILE_INFO_}'")
+  endif()
+endfunction()
+
+set(whitespaces_ "[\t\n\r ]*")
+
+if(GENERATOR_TYPE STREQUAL "RPM")
+  checkPackageInfo_("package version" "${FOUND_FILE_1}" "Version${whitespaces_}:${whitespaces_}${EXPECTED_FILE_1_VERSION}")
+  checkPackageInfo_("package revision" "${FOUND_FILE_1}" "Release${whitespaces_}:${whitespaces_}${EXPECTED_FILE_1_REVISION}")
+  checkPackageInfo_("epoch version" "${FOUND_FILE_1}" "Epoch${whitespaces_}:${whitespaces_}3")
+else() # DEB
+  checkPackageInfo_("version" "${FOUND_FILE_1}"
+    ".*Version${whitespaces_}:${whitespaces_}3:${EXPECTED_FILE_1_VERSION}-${EXPECTED_FILE_1_REVISION}")
+endif()
diff --git a/Tests/RunCMake/CPack/tests/VERSION/test.cmake b/Tests/RunCMake/CPack/tests/VERSION/test.cmake
new file mode 100644
index 0000000..301ab61
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/VERSION/test.cmake
@@ -0,0 +1,14 @@
+install(FILES CMakeLists.txt DESTINATION foo COMPONENT test)
+
+if(GENERATOR_TYPE STREQUAL "DEB")
+  set(package_type_ "DEBIAN")
+  set(CPACK_DEBIAN_PACKAGE_RELEASE "1")
+else()
+  set(package_type_ "${GENERATOR_TYPE}")
+endif()
+
+set(CPACK_${package_type_}_PACKAGE_EPOCH "3")
+
+if(PACKAGING_TYPE STREQUAL "COMPONENT")
+  set(CPACK_COMPONENTS_ALL test)
+endif()

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4c0edbd725976f947398f1513cef3f36ec05cc5f
commit 4c0edbd725976f947398f1513cef3f36ec05cc5f
Author:     Justin Berger <j.david.berger at gmail.com>
AuthorDate: Sat Jul 22 17:23:11 2017 -0600
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Sep 21 11:50:57 2017 -0400

    variable_watch: Made it safe to add/remove watches in access callbacks

diff --git a/Source/cmVariableWatch.cxx b/Source/cmVariableWatch.cxx
index 0e072b8..bd5d19c 100644
--- a/Source/cmVariableWatch.cxx
+++ b/Source/cmVariableWatch.cxx
@@ -2,11 +2,9 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmVariableWatch.h"
 
-#include "cmAlgorithms.h"
-
-#include "cm_auto_ptr.hxx"
-#include <algorithm>
+#include <memory>
 #include <utility>
+#include <vector>
 
 static const char* const cmVariableWatchAccessStrings[] = {
   "READ_ACCESS",     "UNKNOWN_READ_ACCESS", "UNKNOWN_DEFINED_ACCESS",
@@ -25,35 +23,27 @@ cmVariableWatch::cmVariableWatch()
 {
 }
 
-template <typename C>
-void deleteAllSecond(typename C::value_type it)
-{
-  cmDeleteAll(it.second);
-}
-
 cmVariableWatch::~cmVariableWatch()
 {
-  std::for_each(this->WatchMap.begin(), this->WatchMap.end(),
-                deleteAllSecond<cmVariableWatch::StringToVectorOfPairs>);
 }
 
 bool cmVariableWatch::AddWatch(const std::string& variable, WatchMethod method,
                                void* client_data /*=0*/,
                                DeleteData delete_data /*=0*/)
 {
-  CM_AUTO_PTR<cmVariableWatch::Pair> p(new cmVariableWatch::Pair);
+  auto p = std::make_shared<cmVariableWatch::Pair>();
   p->Method = method;
   p->ClientData = client_data;
   p->DeleteDataCall = delete_data;
   cmVariableWatch::VectorOfPairs& vp = this->WatchMap[variable];
-  for (cmVariableWatch::Pair* pair : vp) {
+  for (auto& pair : vp) {
     if (pair->Method == method && client_data &&
         client_data == pair->ClientData) {
       // Callback already exists
       return false;
     }
   }
-  vp.push_back(p.release());
+  vp.push_back(std::move(p));
   return true;
 }
 
@@ -70,7 +60,6 @@ void cmVariableWatch::RemoveWatch(const std::string& variable,
         // If client_data is NULL, we want to disconnect all watches against
         // the given method; otherwise match ClientData as well.
         (!client_data || (client_data == (*it)->ClientData))) {
-      delete *it;
       vp->erase(it);
       return;
     }
@@ -84,9 +73,17 @@ bool cmVariableWatch::VariableAccessed(const std::string& variable,
   cmVariableWatch::StringToVectorOfPairs::const_iterator mit =
     this->WatchMap.find(variable);
   if (mit != this->WatchMap.end()) {
-    const cmVariableWatch::VectorOfPairs* vp = &mit->second;
-    for (cmVariableWatch::Pair* it : *vp) {
-      it->Method(variable, access_type, it->ClientData, newValue, mf);
+    // The strategy here is to copy the list of callbacks, and ignore
+    // new callbacks that existing ones may add.
+    std::vector<std::weak_ptr<Pair>> vp(mit->second.begin(),
+                                        mit->second.end());
+    for (auto& weak_it : vp) {
+      // In the case where a callback was removed, the weak_ptr will not be
+      // lockable, and so this ensures we don't attempt to call into freed
+      // memory
+      if (auto it = weak_it.lock()) {
+        it->Method(variable, access_type, it->ClientData, newValue, mf);
+      }
     }
     return true;
   }
diff --git a/Source/cmVariableWatch.h b/Source/cmVariableWatch.h
index 05a0a56..27d1b12 100644
--- a/Source/cmVariableWatch.h
+++ b/Source/cmVariableWatch.h
@@ -6,6 +6,7 @@
 #include "cmConfigure.h" // IWYU pragma: keep
 
 #include <map>
+#include <memory> // IWYU pragma: keep
 #include <string>
 #include <vector>
 
@@ -79,7 +80,7 @@ protected:
     }
   };
 
-  typedef std::vector<Pair*> VectorOfPairs;
+  typedef std::vector<std::shared_ptr<Pair>> VectorOfPairs;
   typedef std::map<std::string, VectorOfPairs> StringToVectorOfPairs;
 
   StringToVectorOfPairs WatchMap;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=28d2c6ef7e807c53a8bee76c86525f254fc4c54c
commit 28d2c6ef7e807c53a8bee76c86525f254fc4c54c
Author:     Justin Berger <j.david.berger at gmail.com>
AuthorDate: Mon Sep 18 17:28:21 2017 -0600
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Sep 21 11:09:24 2017 -0400

    test: Added additional unit test to variable_watch
    
    This tests adding a variable_watch inside the callback to an existing
    callback

diff --git a/Tests/RunCMake/variable_watch/ModifyWatchInCallback.cmake b/Tests/RunCMake/variable_watch/ModifyWatchInCallback.cmake
new file mode 100644
index 0000000..1dee837
--- /dev/null
+++ b/Tests/RunCMake/variable_watch/ModifyWatchInCallback.cmake
@@ -0,0 +1,17 @@
+function (watch2)
+
+endfunction ()
+
+function (watch1)
+  variable_watch(watched watch2)
+  variable_watch(watched watch2)
+  variable_watch(watched watch2)
+  variable_watch(watched watch2)
+  variable_watch(watched watch2)
+  variable_watch(watched watch2)
+endfunction ()
+
+variable_watch(watched watch1)
+variable_watch(watched watch2)
+
+set(access "${watched}")
diff --git a/Tests/RunCMake/variable_watch/RunCMakeTest.cmake b/Tests/RunCMake/variable_watch/RunCMakeTest.cmake
index 9becb4c..2fa6275 100644
--- a/Tests/RunCMake/variable_watch/RunCMakeTest.cmake
+++ b/Tests/RunCMake/variable_watch/RunCMakeTest.cmake
@@ -3,3 +3,4 @@ include(RunCMake)
 run_cmake(ModifiedAccess)
 run_cmake(NoWatcher)
 run_cmake(WatchTwice)
+run_cmake(ModifyWatchInCallback)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=37d9387be37b5ad51b518d5df467b64e88f73350
commit 37d9387be37b5ad51b518d5df467b64e88f73350
Author:     Pavel Solodovnikov <hellyeahdominate at gmail.com>
AuthorDate: Sat Sep 16 01:42:59 2017 +0300
Commit:     Pavel Solodovnikov <hellyeahdominate at gmail.com>
CommitDate: Thu Sep 21 11:23:19 2017 +0300

    Replace empty-string comparisons with checking against `empty()`.

diff --git a/Source/CPack/IFW/cmCPackIFWRepository.cxx b/Source/CPack/IFW/cmCPackIFWRepository.cxx
index 87e7089..a01fc4e 100644
--- a/Source/CPack/IFW/cmCPackIFWRepository.cxx
+++ b/Source/CPack/IFW/cmCPackIFWRepository.cxx
@@ -162,7 +162,7 @@ protected:
   void CharacterDataHandler(const char* data, int length) override
   {
     std::string content(data, data + length);
-    if (content == "" || content == " " || content == "  " ||
+    if (content.empty() || content == " " || content == "  " ||
         content == "\n") {
       return;
     }
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index 28fc113..1da42d4 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -260,11 +260,11 @@ std::string cmCTestBuildHandler::GetMakeCommand()
                      "MakeCommand:" << makeCommand << "\n", this->Quiet);
 
   std::string configType = this->CTest->GetConfigType();
-  if (configType == "") {
+  if (configType.empty()) {
     configType =
       this->CTest->GetCTestConfiguration("DefaultCTestConfigurationType");
   }
-  if (configType == "") {
+  if (configType.empty()) {
     configType = "Release";
   }
 
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index c853373..6a7bdc0 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -491,7 +491,7 @@ void cmCTestMultiProcessHandler::ReadCostData()
     }
     // Next part of the file is the failed tests
     while (std::getline(fin, line)) {
-      if (line != "") {
+      if (!line.empty()) {
         this->LastTestsFailed.push_back(line);
       }
     }
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index 56a9cb8..abdb643 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -494,7 +494,7 @@ bool cmCTestRunTest::StartTest(size_t total)
     }
   }
   // log and return if we did not find the executable
-  if (this->ActualCommand == "") {
+  if (this->ActualCommand.empty()) {
     // if the command was not found create a TestResult object
     // that has that information
     this->TestProcess = new cmProcess;
@@ -595,7 +595,7 @@ double cmCTestRunTest::ResolveTimeout()
 {
   double timeout = this->TestProperties->Timeout;
 
-  if (this->CTest->GetStopTime() == "") {
+  if (this->CTest->GetStopTime().empty()) {
     return timeout;
   }
   struct tm* lctime;
diff --git a/Source/CTest/cmCTestSVN.cxx b/Source/CTest/cmCTestSVN.cxx
index 087eb38..ce96224 100644
--- a/Source/CTest/cmCTestSVN.cxx
+++ b/Source/CTest/cmCTestSVN.cxx
@@ -410,7 +410,7 @@ void cmCTestSVN::DoRevisionSVN(Revision const& revision,
 
   // Ignore changes in the old revision for external repositories
   if (revision.Rev == revision.SVNInfo->OldRevision &&
-      revision.SVNInfo->LocalPath != "") {
+      !revision.SVNInfo->LocalPath.empty()) {
     return;
   }
 
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index 137cea9..e51e168 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -496,11 +496,11 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
           ? ""
           : this->GetOption("RetryCount");
 
-        int delay = retryDelay == ""
+        int delay = retryDelay.empty()
           ? atoi(this->CTest->GetCTestConfiguration("CTestSubmitRetryDelay")
                    .c_str())
           : atoi(retryDelay.c_str());
-        int count = retryCount == ""
+        int count = retryCount.empty()
           ? atoi(this->CTest->GetCTestConfiguration("CTestSubmitRetryCount")
                    .c_str())
           : atoi(retryCount.c_str());
@@ -1032,14 +1032,14 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
     ? ""
     : this->GetOption("RetryCount");
   unsigned long retryDelay = 0;
-  if (retryDelayString != "") {
+  if (!retryDelayString.empty()) {
     if (!cmSystemTools::StringToULong(retryDelayString.c_str(), &retryDelay)) {
       cmCTestLog(this->CTest, WARNING, "Invalid value for 'RETRY_DELAY' : "
                    << retryDelayString << std::endl);
     }
   }
   unsigned long retryCount = 0;
-  if (retryCountString != "") {
+  if (!retryCountString.empty()) {
     if (!cmSystemTools::StringToULong(retryCountString.c_str(), &retryCount)) {
       cmCTestLog(this->CTest, WARNING, "Invalid value for 'RETRY_DELAY' : "
                    << retryCountString << std::endl);
@@ -1361,7 +1361,7 @@ int cmCTestSubmitHandler::ProcessHandler()
 
   std::string dropMethod(this->CTest->GetCTestConfiguration("DropMethod"));
 
-  if (dropMethod == "" || dropMethod == "ftp") {
+  if (dropMethod.empty() || dropMethod == "ftp") {
     ofs << "Using drop method: FTP" << std::endl;
     cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
                        "   Using FTP submit method" << std::endl
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index f3404a5..5896014 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -1596,7 +1596,7 @@ std::string cmCTestTestHandler::FindExecutable(
   // wasn't specified
   if (fullPath.empty() && filepath.empty()) {
     std::string const path = cmSystemTools::FindProgram(filename.c_str());
-    if (path != "") {
+    if (!path.empty()) {
       resultingConfig.clear();
       return path;
     }
@@ -1802,7 +1802,7 @@ void cmCTestTestHandler::ExpandTestsToRunInformationForRerunFailed()
     if (fileNameSubstring != pattern) {
       continue;
     }
-    if (logName == "") {
+    if (logName.empty()) {
       logName = fileName;
     } else {
       // if multiple matching logs were found we use the most recently
diff --git a/Source/CTest/cmParseCoberturaCoverage.cxx b/Source/CTest/cmParseCoberturaCoverage.cxx
index 3e85339..61ce7d4 100644
--- a/Source/CTest/cmParseCoberturaCoverage.cxx
+++ b/Source/CTest/cmParseCoberturaCoverage.cxx
@@ -78,7 +78,7 @@ protected:
             }
           }
 
-          if (this->CurFileName == "") {
+          if (this->CurFileName.empty()) {
             // Check if this is a path that is relative to our source or
             // binary directories.
             for (std::string const& filePath : FilePaths) {
@@ -91,7 +91,7 @@ protected:
           }
 
           cmsys::ifstream fin(this->CurFileName.c_str());
-          if (this->CurFileName == "" || !fin) {
+          if (this->CurFileName.empty() || !fin) {
             this->CurFileName =
               this->Coverage.BinaryDir + "/" + atts[tagCount + 1];
             fin.open(this->CurFileName.c_str());
diff --git a/Source/CTest/cmParseDelphiCoverage.cxx b/Source/CTest/cmParseDelphiCoverage.cxx
index 4b781a6..6d82cb2 100644
--- a/Source/CTest/cmParseDelphiCoverage.cxx
+++ b/Source/CTest/cmParseDelphiCoverage.cxx
@@ -71,7 +71,8 @@ public:
         }
       }
       // Based up what was found, add a line to the coverageVector
-      if (!beginSet.empty() && line != "" && !blockComFlag && !lineComFlag) {
+      if (!beginSet.empty() && !line.empty() && !blockComFlag &&
+          !lineComFlag) {
         coverageVector.push_back(0);
       } else {
         coverageVector.push_back(-1);
diff --git a/Source/CTest/cmParseJacocoCoverage.cxx b/Source/CTest/cmParseJacocoCoverage.cxx
index 56d07e7..7acb5ca 100644
--- a/Source/CTest/cmParseJacocoCoverage.cxx
+++ b/Source/CTest/cmParseJacocoCoverage.cxx
@@ -36,7 +36,7 @@ protected:
     } else if (name == "sourcefile") {
       std::string fileName = atts[1];
 
-      if (this->PackagePath == "") {
+      if (this->PackagePath.empty()) {
         if (!this->FindPackagePath(fileName)) {
           cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot find file: "
                        << this->PackageName << "/" << fileName << std::endl);
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index d60ce55..ba50986 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -147,7 +147,7 @@ std::string cmCTest::CurrentTime()
 std::string cmCTest::GetCostDataFile()
 {
   std::string fname = this->GetCTestConfiguration("CostDataFile");
-  if (fname == "") {
+  if (fname.empty()) {
     fname = this->GetBinaryDir() + "/Testing/Temporary/CTestCostData.txt";
   }
   return fname;
@@ -1235,7 +1235,7 @@ std::string cmCTest::SafeBuildIdField(const std::string& value)
 {
   std::string safevalue(value);
 
-  if (safevalue != "") {
+  if (!safevalue.empty()) {
     // Disallow non-filename and non-space whitespace characters.
     // If they occur, replace them with ""
     //
@@ -1254,7 +1254,7 @@ std::string cmCTest::SafeBuildIdField(const std::string& value)
     }
   }
 
-  if (safevalue == "") {
+  if (safevalue.empty()) {
     safevalue = "(empty)";
   }
 
diff --git a/Source/cmDependsJavaParserHelper.cxx b/Source/cmDependsJavaParserHelper.cxx
index 85dfc7d..f227cf2 100644
--- a/Source/cmDependsJavaParserHelper.cxx
+++ b/Source/cmDependsJavaParserHelper.cxx
@@ -310,7 +310,7 @@ void cmDependsJavaParserHelper::Error(const char* str)
 void cmDependsJavaParserHelper::UpdateCombine(const char* str1,
                                               const char* str2)
 {
-  if (this->CurrentCombine == "" && str1 != nullptr) {
+  if (this->CurrentCombine.empty() && str1 != nullptr) {
     this->CurrentCombine = str1;
   }
   this->CurrentCombine += ".";
diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx
index 09a9648..b8b51ba 100644
--- a/Source/cmFindLibraryCommand.cxx
+++ b/Source/cmFindLibraryCommand.cxx
@@ -68,8 +68,8 @@ bool cmFindLibraryCommand::InitialPass(std::vector<std::string> const& argsIn,
     this->AddArchitecturePaths("x32");
   }
 
-  std::string library = this->FindLibrary();
-  if (library != "") {
+  std::string const library = this->FindLibrary();
+  if (!library.empty()) {
     // Save the value in the cache
     this->Makefile->AddCacheDefinition(this->VariableName, library.c_str(),
                                        this->VariableDocumentation.c_str(),
diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx
index a5dc1c6..2059b3d 100644
--- a/Source/cmFindProgramCommand.cxx
+++ b/Source/cmFindProgramCommand.cxx
@@ -97,8 +97,8 @@ bool cmFindProgramCommand::InitialPass(std::vector<std::string> const& argsIn,
     return true;
   }
 
-  std::string result = FindProgram();
-  if (result != "") {
+  std::string const result = FindProgram();
+  if (!result.empty()) {
     // Save the value in the cache
     this->Makefile->AddCacheDefinition(this->VariableName, result.c_str(),
                                        this->VariableDocumentation.c_str(),
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 15ddeff..be40126 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -230,7 +230,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainMakefile2()
 
   // The all and preinstall rules might never have any dependencies
   // added to them.
-  if (this->EmptyRuleHackDepends != "") {
+  if (!this->EmptyRuleHackDepends.empty()) {
     depends.push_back(this->EmptyRuleHackDepends);
   }
 
@@ -438,7 +438,7 @@ void cmGlobalUnixMakefileGenerator3::WriteDirectoryRule2(
 
   // Work-around for makes that drop rules that have no dependencies
   // or commands.
-  if (depends.empty() && this->EmptyRuleHackDepends != "") {
+  if (depends.empty() && !this->EmptyRuleHackDepends.empty()) {
     depends.push_back(this->EmptyRuleHackDepends);
   }
 
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index ece2a77..0651536 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -150,7 +150,7 @@ void cmGlobalVisualStudioGenerator::ConfigureCMakeVisualStudioMacros()
 {
   std::string dir = this->GetUserMacrosDirectory();
 
-  if (dir != "") {
+  if (!dir.empty()) {
     std::string src = cmSystemTools::GetCMakeRoot();
     src += "/Templates/" CMAKE_VSMACROS_FILENAME;
 
@@ -190,7 +190,7 @@ void cmGlobalVisualStudioGenerator::CallVisualStudioMacro(
   //  - the CMake vsmacros file is registered
   //  - there were .sln/.vcproj files changed during generation
   //
-  if (dir != "") {
+  if (!dir.empty()) {
     std::string macrosFile = dir + "/CMakeMacros/" CMAKE_VSMACROS_FILENAME;
     std::string nextSubkeyName;
     if (cmSystemTools::FileExists(macrosFile.c_str()) &&
diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx
index 2850032..6bfac17 100644
--- a/Source/cmLoadCommandCommand.cxx
+++ b/Source/cmLoadCommandCommand.cxx
@@ -197,7 +197,7 @@ bool cmLoadCommandCommand::InitialPass(std::vector<std::string> const& args,
 
   // Try to find the program.
   std::string fullPath = cmSystemTools::FindFile(moduleName, path);
-  if (fullPath == "") {
+  if (fullPath.empty()) {
     std::ostringstream e;
     e << "Attempt to load command failed from file \"" << moduleName << "\"";
     this->SetError(e.str());
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index e1662ac..1a088ea 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1410,7 +1410,7 @@ bool cmLocalGenerator::GetRealDependency(const std::string& inName,
 
   // If the input name is the empty string, there is no real
   // dependency. Short-circuit the other checks:
-  if (name == "") {
+  if (name.empty()) {
     return false;
   }
 
@@ -2096,7 +2096,7 @@ void cmLocalGenerator::GenerateTargetInstallRules(
     }
 
     // Install this target if a destination is given.
-    if (l->Target->GetInstallPath() != "") {
+    if (!l->Target->GetInstallPath().empty()) {
       // Compute the full install destination.  Note that converting
       // to unix slashes also removes any trailing slash.
       // We also skip over the leading slash given by the user.
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index c978936..a1771ee 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -1591,7 +1591,7 @@ bool cmLocalVisualStudio7Generator::WriteGroup(
 
   // If the group has a name, write the header.
   std::string name = sg->GetName();
-  if (name != "") {
+  if (!name.empty()) {
     this->WriteVCProjBeginGroup(fout, name.c_str(), "");
   }
 
@@ -1709,7 +1709,7 @@ bool cmLocalVisualStudio7Generator::WriteGroup(
   }
 
   // If the group has a name, write the footer.
-  if (name != "") {
+  if (!name.empty()) {
     this->WriteVCProjEndGroup(fout);
   }
 
@@ -2006,7 +2006,7 @@ void cmLocalVisualStudio7Generator::WriteVCProjFooter(
        i != props.end(); ++i) {
     if (i->find("VS_GLOBAL_") == 0) {
       std::string name = i->substr(10);
-      if (name != "") {
+      if (!name.empty()) {
         /* clang-format off */
         fout << "\t\t<Global\n"
              << "\t\t\tName=\"" << name << "\"\n"
diff --git a/Source/cmOutputRequiredFilesCommand.cxx b/Source/cmOutputRequiredFilesCommand.cxx
index c430298..cde9037 100644
--- a/Source/cmOutputRequiredFilesCommand.cxx
+++ b/Source/cmOutputRequiredFilesCommand.cxx
@@ -510,7 +510,7 @@ void cmOutputRequiredFilesCommand::ListDependencies(
   // now recurse with info's dependencies
   for (cmDependInformation* d : info->DependencySet) {
     if (visited->find(d) == visited->end()) {
-      if (info->FullPath != "") {
+      if (!info->FullPath.empty()) {
         std::string tmp = d->FullPath;
         std::string::size_type pos = tmp.rfind('.');
         if (pos != std::string::npos && (tmp.substr(pos) != ".h")) {
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index a1f346a..e7d1b72 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -140,7 +140,7 @@ static bool GetPolicyDefault(cmMakefile* mf, std::string const& policy,
     *defaultSetting = cmPolicies::NEW;
   } else if (defaultValue == "OLD") {
     *defaultSetting = cmPolicies::OLD;
-  } else if (defaultValue == "") {
+  } else if (defaultValue.empty()) {
     *defaultSetting = cmPolicies::WARN;
   } else {
     std::ostringstream e;
diff --git a/Source/cmServer.cxx b/Source/cmServer.cxx
index 30d0f51..e923c22 100644
--- a/Source/cmServer.cxx
+++ b/Source/cmServer.cxx
@@ -84,7 +84,7 @@ void cmServer::ProcessRequest(cmConnection* connection,
   const cmServerRequest request(this, connection, value[kTYPE_KEY].asString(),
                                 value[kCOOKIE_KEY].asString(), value);
 
-  if (request.Type == "") {
+  if (request.Type.empty()) {
     cmServerResponse response(request);
     response.SetError("No type given in request.");
     this->WriteResponse(connection, response, nullptr);
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 5f2737d..58adc43 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -1375,7 +1375,7 @@ std::string cmSystemTools::CollapseCombinedPath(std::string const& dir,
   if (fileComponents.empty()) {
     return dir;
   }
-  if (fileComponents[0] != "") {
+  if (!fileComponents[0].empty()) {
     // File is not a relative path.
     return file;
   }
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 99b9bce..8dce028 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -407,7 +407,7 @@ void cmVisualStudio10TargetGenerator::Generate()
       continue;
     std::string globalKey = keyIt->substr(strlen(prefix));
     // Skip invalid or separately-handled properties.
-    if (globalKey == "" || globalKey == "PROJECT_TYPES" ||
+    if (globalKey.empty() || globalKey == "PROJECT_TYPES" ||
         globalKey == "ROOTNAMESPACE" || globalKey == "KEYWORD") {
       continue;
     }
@@ -614,7 +614,7 @@ void cmVisualStudio10TargetGenerator::WriteDotNetReferences()
        ++i) {
     if (i->first.find("VS_DOTNET_REFERENCE_") == 0) {
       std::string name = i->first.substr(20);
-      if (name != "") {
+      if (!name.empty()) {
         std::string path = i->second.GetValue();
         if (!cmsys::SystemTools::FileIsFullPath(path)) {
           path = std::string(this->GeneratorTarget->Target->GetMakefile()

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

Summary of changes:
 Help/release/dev/cpack-rpm-deb-version.rst         |   14 ++++++
 Modules/CPackDeb.cmake                             |   52 +++++++++++++++++---
 Modules/CPackRPM.cmake                             |   25 +++++++++-
 Source/CPack/IFW/cmCPackIFWRepository.cxx          |    2 +-
 Source/CTest/cmCTestBuildHandler.cxx               |    4 +-
 Source/CTest/cmCTestMultiProcessHandler.cxx        |    2 +-
 Source/CTest/cmCTestRunTest.cxx                    |    4 +-
 Source/CTest/cmCTestSVN.cxx                        |    2 +-
 Source/CTest/cmCTestSubmitHandler.cxx              |   10 ++--
 Source/CTest/cmCTestTestHandler.cxx                |    4 +-
 Source/CTest/cmParseCoberturaCoverage.cxx          |    4 +-
 Source/CTest/cmParseDelphiCoverage.cxx             |    3 +-
 Source/CTest/cmParseJacocoCoverage.cxx             |    2 +-
 Source/cmCTest.cxx                                 |    6 +--
 Source/cmDependsJavaParserHelper.cxx               |    2 +-
 Source/cmFindLibraryCommand.cxx                    |    4 +-
 Source/cmFindProgramCommand.cxx                    |    4 +-
 Source/cmGlobalUnixMakefileGenerator3.cxx          |    4 +-
 Source/cmGlobalVisualStudioGenerator.cxx           |    4 +-
 Source/cmLoadCommandCommand.cxx                    |    2 +-
 Source/cmLocalGenerator.cxx                        |    4 +-
 Source/cmLocalVisualStudio7Generator.cxx           |    6 +--
 Source/cmOutputRequiredFilesCommand.cxx            |    2 +-
 Source/cmPolicies.cxx                              |    2 +-
 Source/cmServer.cxx                                |    2 +-
 Source/cmSystemTools.cxx                           |    2 +-
 Source/cmVariableWatch.cxx                         |   35 ++++++-------
 Source/cmVariableWatch.h                           |    3 +-
 Source/cmVisualStudio10TargetGenerator.cxx         |    4 +-
 .../RunCPackVerifyResult-components-depend1.cmake  |    2 +-
 .../RunCPackVerifyResult-components-depend2.cmake  |    2 +-
 ...CPackVerifyResult-components-description1.cmake |    2 +-
 ...CPackVerifyResult-components-description2.cmake |    2 +-
 ...yResult-components-lintian-dpkgdeb-checks.cmake |    2 +-
 ...unCPackVerifyResult-components-shlibdeps1.cmake |    2 +-
 .../RunCPackVerifyResult-components-source.cmake   |    2 +-
 .../RunCPackVerifyResult-compression.cmake         |    2 +-
 .../RunCPackVerifyResult.cmake                     |    2 +-
 Tests/RunCMake/CPack/DEB/Helpers.cmake             |    2 +-
 Tests/RunCMake/CPack/RPM/Helpers.cmake             |    3 ++
 Tests/RunCMake/CPack/RunCMakeTest.cmake            |    1 +
 Tests/RunCMake/CPack/VerifyResult.cmake            |    4 +-
 .../tests/{MINIMAL => VERSION}/ExpectedFiles.cmake |    1 +
 .../CPack/tests/VERSION/VerifyResult.cmake         |   17 +++++++
 Tests/RunCMake/CPack/tests/VERSION/test.cmake      |   14 ++++++
 .../variable_watch/ModifyWatchInCallback.cmake     |   17 +++++++
 Tests/RunCMake/variable_watch/RunCMakeTest.cmake   |    1 +
 47 files changed, 207 insertions(+), 85 deletions(-)
 create mode 100644 Help/release/dev/cpack-rpm-deb-version.rst
 copy Tests/RunCMake/CPack/tests/{MINIMAL => VERSION}/ExpectedFiles.cmake (75%)
 create mode 100644 Tests/RunCMake/CPack/tests/VERSION/VerifyResult.cmake
 create mode 100644 Tests/RunCMake/CPack/tests/VERSION/test.cmake
 create mode 100644 Tests/RunCMake/variable_watch/ModifyWatchInCallback.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list