Commit 749c8170 authored by Leigh Stoller's avatar Leigh Stoller

For the GPO: Write the current git hash to /etc/emulab/version when

installing the clientside on an image.
parent 5737f95e
......@@ -43,7 +43,7 @@ endif
include $(TESTBED_SRCDIR)/GNUmakerules
client: client-subdirs
client-install: client client-mkdirs client-install-subdirs
client-install: client client-mkdirs client-install-subdirs client-setversion
control-install: control-install-subdirs
subboss: subboss-subdirs
subboss-install: client subboss-install-subdirs
......@@ -77,6 +77,13 @@ client-mkdirs:
-mkdir -p $(DESTDIR)$(CLIENT_BINDIR)
-mkdir -p $(DESTDIR)$(CLIENT_MANDIR)
#
# Attempt to find a git commit hash and stash in /etc/emulab.
#
client-setversion: setversion
@echo "Setting Version info"
@perl setversion
# How to recursively descend into subdirectories to make general
# targets such as `all'.
%.MAKE:
......
......@@ -4880,7 +4880,7 @@ done
# END Python detection.
outfiles="Makeconf GNUmakefile \
outfiles="Makeconf GNUmakefile setversion \
lib/GNUmakefile \
lib/libtb/GNUmakefile \
lib/tmcd/GNUmakefile \
......
......@@ -209,7 +209,7 @@ AC_CHECK_HEADERS([Python.h],
AC_SUBST(PYTHON_INCLUDE)
# END Python detection.
outfiles="Makeconf GNUmakefile \
outfiles="Makeconf GNUmakefile setversion \
lib/GNUmakefile \
lib/libtb/GNUmakefile \
lib/tmcd/GNUmakefile \
......
#!/usr/bin/perl -w
#
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
# This file is part of the Emulab network testbed software.
#
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
#
# This file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
# License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this file. If not, see <http://www.gnu.org/licenses/>.
#
# }}}
#
# Set the version and build info into the DB, at a toplevel install.
#
use English;
use Getopt::Std;
use POSIX qw(strftime);
#
# Configure variables
#
my $SRCDIR = "@top_srcdir@";
my $ETCEMULAB = "/etc/emulab";
my $VERSION = "$ETCEMULAB/version";
my $GITTHING = "tools/git/current_branch_head";
#
# Use the upper level tool to get the git hash, unless we were configured
# as part of the full emulab tree, in which case SRCDIR is already at
# the top of the tree.
#
my $path = (-e "$SRCDIR/$GITTHING" ? $SRCDIR : "$SRCDIR/..");
my $hash = `cd $path; $GITTHING`;
if ($?) {
print STDERR
"*** $0:\n".
" Unable to get commit hash for source tree\n";
exit(0);
}
else {
chomp($hash);
}
print "Hash is $hash\n";
if (-e "$ETCEMULAB") {
print "Writing to $VERSION\n";
system("echo '$hash' > $VERSION");
exit(1)
if ($?);
}
exit(0);
......@@ -7600,7 +7600,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
# this turned out to be a major headache. Instead, just duplicate the file
# lists here and in clientside.
#
outfiles="$outfiles clientside/GNUmakefile \
outfiles="$outfiles clientside/GNUmakefile clientside/setversion \
clientside/lib/GNUmakefile clientside/lib/libtb/GNUmakefile \
clientside/lib/tmcd/GNUmakefile \
clientside/GNUmakefile clientside/event/GNUmakefile \
......
......@@ -1228,7 +1228,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
# this turned out to be a major headache. Instead, just duplicate the file
# lists here and in clientside.
#
outfiles="$outfiles clientside/GNUmakefile \
outfiles="$outfiles clientside/GNUmakefile clientside/setversion \
clientside/lib/GNUmakefile clientside/lib/libtb/GNUmakefile \
clientside/lib/tmcd/GNUmakefile \
clientside/GNUmakefile clientside/event/GNUmakefile \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment