Added auto-generated version info. (be --version)
authorW. Trevor King <wking@drexel.edu>
Thu, 25 Jun 2009 17:31:31 +0000 (13:31 -0400)
committerW. Trevor King <wking@drexel.edu>
Thu, 25 Jun 2009 17:31:31 +0000 (13:31 -0400)
Makefile
be

index 47fbbfdcdd4b6b38f47855f839522602ac8938bb..f9246080e8ab03587e972f692cf5518a105523fb 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -27,6 +27,9 @@ MODULES += ${DOC_DIR}
 
 RM = rm
 
+PREFIX = ${HOME}
+INSTALL_OPTIONS = "--prefix=${PREFIX}"
+
 \f
 .PHONY: all
 all: build
@@ -36,12 +39,18 @@ include $(patsubst %,%/module.mk,${MODULES})
 
 \f
 .PHONY: build
-build:
+build: libbe/_version.py
+       python setup.py build
 
 .PHONY: install
-install:
+install: doc build
+       python setup.py install ${INSTALL_OPTIONS}
+       cp -v xml/* ${PREFIX}/bin
 
 \f
 .PHONY: clean
 clean:
        $(RM) -rf ${GENERATED_FILES}
+
+libbe/_version.py:
+       bzr version-info --format python > $@
diff --git a/be b/be
index 35dab69c0c4ddd7452a38f37449eefe2a5e92e44..fbe964fbd8bc6a7ff4b6f827745587d8717573af 100755 (executable)
--- a/be
+++ b/be
@@ -18,7 +18,7 @@
 
 
 import sys
-from libbe import cmdutil
+from libbe import cmdutil, _version
 
 __doc__ == cmdutil.help()
 
@@ -28,6 +28,8 @@ elif sys.argv[1] == '--complete':
     for command, module in cmdutil.iter_commands():
         print command
     print '\n'.join(["--help","--complete","--options"])
+elif sys.argv[1] == '--version':
+    print _version.version_info["revision_id"]
 else:
     try:
         try: