summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2018-11-12 17:29:03 +0000
committerHéctor Orón Martínez <zumbi@debian.org>2019-09-01 01:59:08 +0200
commitd55f7891fb05b82ccc5b1d102df7753974848c56 (patch)
treea227c6621e421f5662e9e95a9166fbdad5644b82
parentf0339358fa82999cbb748ae35d91e6338b8f666d (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--Makefile12
-rwxr-xr-xbuild2
-rwxr-xr-xcommon_functions2
-rwxr-xr-xinit_buildsystem2
4 files changed, 17 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 41f73f3..7b2a5c9 100644
--- a/Makefile
+++ b/Makefile
@@ -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)
diff --git a/build b/build
index 3ecf7e8..8e7bb18 100755
--- a/build
+++ b/build
@@ -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