diff options
author | Simon McVittie <smcv@collabora.com> | 2018-11-12 17:29:03 +0000 |
---|---|---|
committer | Héctor Orón Martínez <zumbi@debian.org> | 2019-09-01 01:59:08 +0200 |
commit | d55f7891fb05b82ccc5b1d102df7753974848c56 (patch) | |
tree | a227c6621e421f5662e9e95a9166fbdad5644b82 | |
parent | f0339358fa82999cbb748ae35d91e6338b8f666d (diff) |
Log the version number during startup
When testing OBS behaviour changes, it's useful to be able to look
at a build log and see which code was running.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Forwarded: https://github.com/openSUSE/obs-build/pull/497
Gbp-Pq: Name Log-the-version-number-during-startup.patch
-rw-r--r-- | Makefile | 12 | ||||
-rwxr-xr-x | build | 2 | ||||
-rwxr-xr-x | common_functions | 2 | ||||
-rwxr-xr-x | init_buildsystem | 2 |
4 files changed, 17 insertions, 1 deletions
@@ -20,13 +20,22 @@ sysconfdir=/etc DESTDIR= all: +ifeq ($(SCM),svn) + echo $(VERSION)$(SVNVER) > version +else +ifeq ($(SCM),git) + echo $(VERSION)_git$(DATE) > version +else + echo $(VERSION) > version +endif +endif .PHONY: test test: PERL5LIB=. prove -v -install: +install: all install -m755 -d \ $(DESTDIR)$(pkglibdir)/configs \ $(DESTDIR)$(pkglibdir)/baselibs_configs \ @@ -83,6 +92,7 @@ install: install -m644 build-recipe build-recipe-* $(DESTDIR)$(pkglibdir) install -m644 build-pkg build-pkg-* $(DESTDIR)$(pkglibdir) install -m644 *.pm lxc.conf $(DESTDIR)$(pkglibdir) + install -m644 version $(DESTDIR)$(pkglibdir) install -m644 configs/* $(DESTDIR)$(pkglibdir)/configs install -m644 baselibs_configs/* $(DESTDIR)$(pkglibdir)/baselibs_configs install -d $(DESTDIR)$(man1dir) @@ -121,6 +121,7 @@ umask 022 echo_help () { cat << EOT +build version: $BUILD_VERSION Some comments for build ----------------------- @@ -1185,6 +1186,7 @@ for RECIPEFILE in "${RECIPEFILES[@]}" ; do if test -z "$RUNNING_IN_VM" ; then echo echo "$HOST started \"build $RECIPEFILE\" at `date --utc`." + echo "build version: $BUILD_VERSION" echo test -n "$REASON" && echo "$REASON" echo diff --git a/common_functions b/common_functions index 45f970b..e225c38 100755 --- a/common_functions +++ b/common_functions @@ -20,6 +20,8 @@ # ################################################################ +BUILD_VERSION="$(cat "$BUILD_DIR/version")" + build_host_arch() { : ${BUILD_HOST_ARCH:=`uname -m`} # the linux kernel only knows armv7l, armv7hl is a userland definition diff --git a/init_buildsystem b/init_buildsystem index 23e1c40..d83296d 100755 --- a/init_buildsystem +++ b/init_buildsystem @@ -461,6 +461,8 @@ getcachedir() { done } +echo "init_buildsystem version: $BUILD_VERSION" + set_build_arch trap fail_exit EXIT |