summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2016-10-12 10:04:06 +0200
committerMilan Crha <mcrha@redhat.com>2016-10-12 10:04:06 +0200
commit8d5d7c3402d25a7a70cd1eb5dce0a4bc4f9a0eb5 (patch)
tree0b96ec31af037c55b05795cfc20bea0ad1ce89da /cmake
parentd17f923f928a7622053bb520728c2c37746ef7b8 (diff)
downloadevolution-8d5d7c3402d25a7a70cd1eb5dce0a4bc4f9a0eb5.tar.gz
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.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/DistTargets.cmake1
-rwxr-xr-xcmake/verify-pre-dist.sh11
2 files changed, 12 insertions, 0 deletions
diff --git a/cmake/modules/DistTargets.cmake b/cmake/modules/DistTargets.cmake
index 2551d3aa25..2e6f037bf1 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 0000000000..b311e72695
--- /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