From afadf3ea3fc4109f55f2f76bdb0e01327acef7b3 Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Mon, 26 Jun 2017 19:23:58 +0100 Subject: [PATCH 1/2] Revert "Use double quoting in get_version.sh" Fixed symptom not the underlying problem. This reverts commit e39a841f6edcc5cbd7aed8d3f733d40f57b524c6. --- get_version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/get_version.sh b/get_version.sh index 2b73fd3..6923362 100755 --- a/get_version.sh +++ b/get_version.sh @@ -34,7 +34,7 @@ then VERSION=$(git describe --exact-match 2>/dev/null || echo "$MAJOR-git$(git show -s --pretty=format:%ci | cut -d ' ' -f 1 | tr -d '-').$(git show -s --pretty=format:%h)")$DIRTY else VERSION=$( (head -n 1 ChangeLog || head -n 1 ../ChangeLog) | cut -d ' ' -f 2) - if [ "$VERSION" = "master" ] + if [ $VERSION = "master" ] then VERSION=$VERSION-$( (head -n 1 ChangeLog || head -n 1 ../ChangeLog) | cut -d ' ' -f 1) fi From 7a350a5e834e4b67478f778841cd1d9383c79707 Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Mon, 26 Jun 2017 19:23:58 +0100 Subject: [PATCH 2/2] Fix finding ChangeLog when building Keep the first optional argument of get_version.sh as "--strict" and make the second the PROJECT_SOURCE_DIR plus trailing slash from CMakeLists.txt --- CMakeLists.txt | 2 +- get_version.sh | 4 ++-- packaging/make_ubuntu.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f11f632..2346226 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -217,7 +217,7 @@ else() SET(ASAN_L_FLAGS "") endif() -add_custom_target( version ALL "${PROJECT_SOURCE_DIR}/get_version.sh" "\"${PROJECT_SOURCE_DIR}\"" ) +add_custom_target( version ALL "${PROJECT_SOURCE_DIR}/get_version.sh" -- "\"${PROJECT_SOURCE_DIR}/\"" ) link_directories( ${X11_LIBRARY_DIRS} ${PANGOCAIRO_LIBRARY_DIRS} diff --git a/get_version.sh b/get_version.sh index 6923362..0b50561 100755 --- a/get_version.sh +++ b/get_version.sh @@ -33,10 +33,10 @@ then fi VERSION=$(git describe --exact-match 2>/dev/null || echo "$MAJOR-git$(git show -s --pretty=format:%ci | cut -d ' ' -f 1 | tr -d '-').$(git show -s --pretty=format:%h)")$DIRTY else - VERSION=$( (head -n 1 ChangeLog || head -n 1 ../ChangeLog) | cut -d ' ' -f 2) + VERSION=$(head -n 1 ${2}ChangeLog | cut -d ' ' -f 2) if [ $VERSION = "master" ] then - VERSION=$VERSION-$( (head -n 1 ChangeLog || head -n 1 ../ChangeLog) | cut -d ' ' -f 1) + VERSION=$VERSION-$(head -n 1 ${2}ChangeLog | cut -d ' ' -f 1) fi fi diff --git a/packaging/make_ubuntu.sh b/packaging/make_ubuntu.sh index 4603cdc..60f8f26 100755 --- a/packaging/make_ubuntu.sh +++ b/packaging/make_ubuntu.sh @@ -14,7 +14,7 @@ else fi # Get version (and check that the repository is clean) -VERSION=$(../get_version.sh --strict) +VERSION=$(../get_version.sh --strict ../) if [ ! $? -eq 0 ] then echo >&2 "Error: get_version.sh failed!"