[evolution-ews] Add a helper script for a 'dist' target



commit b52f7503e7779a92d6037d79a4db079722141b55
Author: Milan Crha <mcrha redhat com>
Date:   Wed Oct 12 10:04:06 2016 +0200

    Add a helper script for a 'dist' target
    
    It verifies that the distribution tarball is created with all local
    changes, which requires them to be committed. If there are uncommitted
    changes, then it prints a warning on the console.

 cmake/modules/DistTargets.cmake |    1 +
 cmake/verify-pre-dist.sh        |   11 +++++++++++
 2 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/cmake/modules/DistTargets.cmake b/cmake/modules/DistTargets.cmake
index 2551d3a..2e6f037 100644
--- a/cmake/modules/DistTargets.cmake
+++ b/cmake/modules/DistTargets.cmake
@@ -18,6 +18,7 @@ set(ARCHIVE_BASE_NAME ${PROJECT_NAME}-${PROJECT_VERSION})
 set(ARCHIVE_FULL_NAME ${ARCHIVE_BASE_NAME}.tar.xz)
 
 add_custom_target(dist
+       COMMAND ${CMAKE_COMMAND} -E chdir . "${CMAKE_SOURCE_DIR}/cmake/verify-pre-dist.sh"
        COMMAND ${CMAKE_COMMAND} -E echo "Creating '${ARCHIVE_FULL_NAME}'..."
        COMMAND git archive --prefix=${ARCHIVE_BASE_NAME}/ HEAD | xz -z > 
${CMAKE_BINARY_DIR}/${ARCHIVE_FULL_NAME}
        COMMAND ${CMAKE_COMMAND} -E echo "Distribution tarball '${ARCHIVE_FULL_NAME}' created at 
${CMAKE_BINARY_DIR}"
diff --git a/cmake/verify-pre-dist.sh b/cmake/verify-pre-dist.sh
new file mode 100755
index 0000000..b311e72
--- /dev/null
+++ b/cmake/verify-pre-dist.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+git diff --no-patch --exit-code HEAD
+
+if [ ! $? -eq 0 ]; then
+       echo "" 1>&2
+       echo "***********************************************************************" 1>&2
+       echo "  There are uncommitted changes which will not be part of the tarball  " 1>&2
+       echo "***********************************************************************" 1>&2
+       echo "" 1>&2
+fi


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]