From 789eb276a69c16860e63b7896cde987db6e56689 Mon Sep 17 00:00:00 2001 From: Colin Clark Date: Sat, 6 Aug 2022 16:56:59 +0100 Subject: [PATCH] Fix #1017: Use source root and not build root to install Changelogs and readme from https://github.com/BestImageViewer/geeqie/pull/1017 Check for non-availability of git. --- gen_changelog.sh | 4 ++-- meson.build | 13 ++++++++----- version.sh | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/gen_changelog.sh b/gen_changelog.sh index b2b68e9a..23d064c3 100755 --- a/gen_changelog.sh +++ b/gen_changelog.sh @@ -14,8 +14,8 @@ builddir="$2" cd "$1" [ ! -e "ChangeLog.gqview" ] && exit 1 -[ ! -x "$(command -v git)" ] && exit 0 -[ ! -d ".git" ] && exit 0 +[ ! -x "$(command -v git)" ] && exit 1 +[ ! -d ".git" ] && exit 1 LC_ALL=C git log --no-merges --no-notes --encoding=UTF-8 --no-follow --use-mailmap 1b58572cf58e9d2d4a0305108395dab5c66d3a09..HEAD > "$builddir/ChangeLog.$$.new" && \ cat ChangeLog.gqview >> "$builddir/ChangeLog.$$.new" && \ diff --git a/meson.build b/meson.build index f9ee8ab3..e44cf8c3 100644 --- a/meson.build +++ b/meson.build @@ -476,22 +476,25 @@ subdir('src') subdir('doc') # Install other project files -run_command(find_program('gen_changelog.sh'), meson.source_root(), meson.build_root(), check : true) +res = run_command(find_program('gen_changelog.sh'), meson.source_root(), meson.build_root(), check : false) + +if res.returncode() == 0 + install_data(join_paths(meson.build_root(), 'ChangeLog'), join_paths(meson.build_root(), 'ChangeLog.html'), install_dir : helpdir) + summary({'ChangeLog' : ['ChangeLog, ChangeLog.html created:', true]}, section : 'Documentation', bool_yn : true) +else + summary({'ChangeLog' : ['ChangeLog, ChangeLog.html created:', false]}, section : 'Documentation', bool_yn : true) +endif pandoc = find_program('pandoc', required : false) if pandoc.found() run_command(find_program('gen_readme.sh'), meson.source_root(), meson.build_root(), check : false) install_data('README.md', 'COPYING', 'TODO', 'AUTHORS', - join_paths(meson.build_root(), 'ChangeLog'), join_paths(meson.build_root(), 'README.html'), - join_paths(meson.build_root(), 'ChangeLog.html'), install_dir : helpdir) summary({'README' : ['README.html created:', true]}, section : 'Documentation', bool_yn : true) else install_data('README.md', 'COPYING', 'TODO', 'AUTHORS', - join_paths(meson.build_root(), 'ChangeLog'), - join_paths(meson.build_root(), 'ChangeLog.html'), install_dir : helpdir) summary({'README' : ['pandoc not found - README.html created:', false]}, section : 'Documentation', bool_yn : true) endif diff --git a/version.sh b/version.sh index 6a5f9288..f6e1c5a3 100755 --- a/version.sh +++ b/version.sh @@ -18,7 +18,7 @@ ## Geeqie ## -if [ -d .git ] +if [ -d .git ] && [ -x "$(command -v git)" ] then branch=$(git rev-parse --abbrev-ref HEAD) -- 2.20.1