mirror of https://github.com/krallin/tini.git
Merge pull request #13 from krallin/better-git-checks
Better git checks
This commit is contained in:
commit
f2e8ed2487
|
@ -5,7 +5,29 @@ project (tini C)
|
||||||
set (tini_VERSION_MAJOR 0)
|
set (tini_VERSION_MAJOR 0)
|
||||||
set (tini_VERSION_MINOR 6)
|
set (tini_VERSION_MINOR 6)
|
||||||
set (tini_VERSION_PATCH 0)
|
set (tini_VERSION_PATCH 0)
|
||||||
execute_process (COMMAND git log -n 1 --date=local --pretty=format:"%h" WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" OUTPUT_VARIABLE tini_VERSION_GIT)
|
|
||||||
|
# Extract git version and dirty-ness
|
||||||
|
execute_process (
|
||||||
|
COMMAND git log -n 1 --date=local --pretty=format:%h
|
||||||
|
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
|
||||||
|
RESULT_VARIABLE git_version_check_ret
|
||||||
|
OUTPUT_VARIABLE tini_VERSION_GIT
|
||||||
|
)
|
||||||
|
|
||||||
|
execute_process(
|
||||||
|
COMMAND git status --porcelain --untracked-files=no
|
||||||
|
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
|
||||||
|
OUTPUT_VARIABLE git_dirty_check_out
|
||||||
|
)
|
||||||
|
|
||||||
|
if("${git_version_check_ret}" EQUAL 0)
|
||||||
|
set(tini_VERSION_GIT " - git.${tini_VERSION_GIT}")
|
||||||
|
if(NOT "${git_dirty_check_out}" STREQUAL "")
|
||||||
|
set(tini_VERSION_GIT "${tini_VERSION_GIT}-dirty")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
set(tini_VERSION_GIT "")
|
||||||
|
endif()
|
||||||
|
|
||||||
# Flags
|
# Flags
|
||||||
add_definitions (-D_FORTIFY_SOURCE=2)
|
add_definitions (-D_FORTIFY_SOURCE=2)
|
||||||
|
|
2
ddist.sh
2
ddist.sh
|
@ -2,6 +2,8 @@
|
||||||
set -o errexit
|
set -o errexit
|
||||||
set -o nounset
|
set -o nounset
|
||||||
|
|
||||||
|
: ${FORCE_SUBREAPER:="1"}
|
||||||
|
|
||||||
REL_HERE=$(dirname "${BASH_SOURCE}")
|
REL_HERE=$(dirname "${BASH_SOURCE}")
|
||||||
HERE=$(cd "${REL_HERE}"; pwd)
|
HERE=$(cd "${REL_HERE}"; pwd)
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ int spawn(const sigset_t* const child_sigset_ptr, char* const argv[], int* const
|
||||||
|
|
||||||
|
|
||||||
void print_usage(char* const name, FILE* const file) {
|
void print_usage(char* const name, FILE* const file) {
|
||||||
fprintf(file, "%s (version %s - %s)\n", basename(name), TINI_VERSION, TINI_GIT);
|
fprintf(file, "%s (version %s%s)\n", basename(name), TINI_VERSION, TINI_GIT);
|
||||||
fprintf(file, "Usage: %s [OPTIONS] PROGRAM -- [ARGS]\n\n", basename(name));
|
fprintf(file, "Usage: %s [OPTIONS] PROGRAM -- [ARGS]\n\n", basename(name));
|
||||||
fprintf(file, "Execute a program under the supervision of a valid init process (%s)\n\n", basename(name));
|
fprintf(file, "Execute a program under the supervision of a valid init process (%s)\n\n", basename(name));
|
||||||
fprintf(file, " -h: Show this help message and exit.\n");
|
fprintf(file, " -h: Show this help message and exit.\n");
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
#define TINI_VERSION "@tini_VERSION_MAJOR@.@tini_VERSION_MINOR@.@tini_VERSION_PATCH@"
|
#define TINI_VERSION "@tini_VERSION_MAJOR@.@tini_VERSION_MINOR@.@tini_VERSION_PATCH@"
|
||||||
#define TINI_GIT @tini_VERSION_GIT@
|
#define TINI_GIT "@tini_VERSION_GIT@"
|
||||||
|
|
Loading…
Reference in New Issue