Skip to content

Commit

Permalink
build: Generate cc-collect script
Browse files Browse the repository at this point in the history
Create the cc-collect-data.sh script to allow it to display
the build version in its output.

Fixes clearcontainers#605.

Signed-off-by: James O. D. Hunt <[email protected]>
  • Loading branch information
jodh-intel committed Sep 25, 2017
1 parent ffe6ccf commit 1c7d20c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/cc-runtime
/coverage.html
/config-generated.go
/data/cc-collect-data.sh
/config/configuration.toml
/pause/pause
/pause/pause.o
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,12 @@ PAUSEDESTDIR := $(abspath $(DESTDIR)/$(PAUSEROOTPATH)/$(PAUSEBINRELPATH))
BASH_COMPLETIONS := data/completions/bash/cc-runtime
BASH_COMPLETIONSDIR := $(DESTSHAREDIR)/bash-completion/completions

SCRIPTS := data/cc-collect-data.sh
COLLECT_SCRIPT = data/cc-collect-data.sh
SCRIPTS += $(COLLECT_SCRIPT)
SCRIPTS_DIR := $(abspath $(DESTBINDIR))

GENERATED_FILES += $(COLLECT_SCRIPT)

# list of variables the user may wish to override
USER_VARS += BASH_COMPLETIONSDIR
USER_VARS += BINDIR
Expand Down
3 changes: 2 additions & 1 deletion data/cc-collect-data.sh → data/cc-collect-data.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

script_name=${0##*/}
runtime=$(which "cc-runtime")
script_version="@VERSION@ (commit @COMMIT@)"

die()
{
Expand Down Expand Up @@ -199,7 +200,7 @@ show_meta()
heading "Meta"

date=$(date '+%Y-%m-%d.%H:%M:%S.%N')
msg "Running \`$script_name\` at \`$date\`"
msg "Running \`$script_name\` version \`$script_version\` at \`$date\`."
}

main()
Expand Down

0 comments on commit 1c7d20c

Please sign in to comment.