$(docpng) \
$(maninput) \
doc/install-quick.rst \
- doc/news.rst
+ doc/news.rst \
+ vcs-version
maintainer-clean-local:
rm -rf $(BUILDTIME_DIRS)
man/%.html: man/%.html.in $(REPLACE_VARS_SED)
sed -f $(REPLACE_VARS_SED) < $< > $@
-lib/_autoconf.py: Makefile stamp-directories
+vcs-version:
+ if test -d .git; then \
+ git describe > $@; \
+ elif test ! -f $@ ; then \
+ echo "Cannot auto-generate $@ file"; exit 1; \
+ fi
+
+.PHONY: regen-vcs-version
+regen-vcs-version:
set -e; \
+ cd $(srcdir); \
+ if test -d .git; then \
+ rm -f vcs-version; \
+ $(MAKE) vcs-version; \
+ fi
+
+lib/_autoconf.py: Makefile stamp-directories vcs-version
+ set -e; \
+ VCSVER=`cat $(abs_top_srcdir)/vcs-version`; \
{ echo '# This file is automatically generated, do not edit!'; \
echo '#'; \
echo ''; \
echo "DAEMONS_GROUP = '$(DAEMONS_GROUP)'"; \
echo "MASTERD_USER = '$(MASTERD_USER)'"; \
echo "RAPI_USER = '$(RAPI_USER)'"; \
+ echo "VCS_VERSION = '$$VCSVER'"; \
} > $@
$(REPLACE_VARS_SED): Makefile
@test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
$(PYLINT) $(LINT_OPTS) $(lint_python_code)
-# a dist hook rule for catching revision control directories
+# a dist hook rule for updating the vcs-version file; this is
+# hardcoded due to where it needs to build the file...
+dist-hook:
+ $(MAKE) regen-vcs-version && \
+ rm -f $(top_distdir)/vcs-version && \
+ cp -p $(srcdir)/vcs-version $(top_distdir)
+
+# a distcheck hook rule for catching revision control directories
distcheck-hook:
if find $(top_distdir) -name .svn -or -name .git | grep .; then \
echo "Found revision control files in final archive." 1>&2; \
#!/bin/bash
-# Copyright (C) 2006, 2007 Google Inc.
+# Copyright (C) 2006, 2007, 2008, 2009, 2010 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# This is a test script to ease development and testing on test clusters.
# It should not be used to update production environments.
-# Usage: upload.sh node-{1,2,3}
+# Usage: upload node-{1,2,3}
# it will upload the python libraries to
# $prefix/lib/python2.4/site-packages/ganeti and the command line utils to
# $prefix/sbin. It needs passwordless root login to the nodes.
set ${hosts}
+make regen-vcs-version
+
TXD=`mktemp -d`
trap 'rm -rf $TXD' EXIT
binary = argv[0].split("/")[-1]
if len(argv) > 1 and argv[1] == "--version":
- ToStdout("%s (ganeti) %s", binary, constants.RELEASE_VERSION)
+ ToStdout("%s (ganeti %s) %s", binary, constants.VCS_VERSION,
+ constants.RELEASE_VERSION)
# Quit right away. That way we don't have to care about this special
# argument. optparse.py does it the same.
sys.exit(0)
#
#
-# Copyright (C) 2006, 2007 Google Inc.
+# Copyright (C) 2006, 2007, 2008, 2009, 2010 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
OS_API_V15 = 15
OS_API_V20 = 20
OS_API_VERSIONS = frozenset([OS_API_V10, OS_API_V15, OS_API_V20])
+VCS_VERSION = _autoconf.VCS_VERSION
EXPORT_VERSION = 0
RAPI_VERSION = 2