]> hydra-www.ietfng.org Git - dyna2/commitdiff
Makefile maintains a VERSION file from which `./dyna --version` will obtain version...
authorTim Vieira <tim.f.vieira@gmail.com>
Thu, 25 Jul 2013 18:42:32 +0000 (14:42 -0400)
committerTim Vieira <tim.f.vieira@gmail.com>
Thu, 25 Jul 2013 18:42:32 +0000 (14:42 -0400)
Makefile
src/Dyna/Backend/Python/main.py

index 552f643162d4dd6f0c609a63e42087dda1a3fd8f..0dc5467c928b27e06adf8b02dc1df7f053934ca0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,11 @@
 # -*-  indent-tabs-mode:t;  -*-
 
-all: deps build sphinxbuild
+all: deps build sphinxbuild version
+
+version:
+       echo "Version: Dyna 0.4 pre-release" `git describe --all` > VERSION
+       echo "Build date:" `date` >> VERSION
+       echo "Commit: https://github.com/nwf/dyna/commit/"`git rev-parse HEAD` >> VERSION
 
 upstream:
        git submodule init
@@ -10,8 +15,8 @@ upstream:
        # cabal install --user external/ekmett-parsers external/ekmett-trifecta
 
 deps:
-       alex --version >/dev/null || cabal install alex
-       happy --version >/dev/null || cabal install happy
+       alex --version 2>/dev/null >/dev/null || cabal install alex
+       happy --version 2>/dev/null >/dev/null || cabal install happy
        cabal install --user --enable-tests --only-dependencies .
 
 build:
index 940a2cbc0c4ac472e2aaba71564b37c3e97c7700..83bae425be86428a309a67b7768b0a3f9d8ca296 100644 (file)
@@ -29,10 +29,9 @@ def main():
     if args.version:
         import subprocess
         try:
-            subprocess.Popen("cd %s ; grep '^Version' dyna.cabal" % dynahome, shell=True)
-            subprocess.Popen("cd %s ; git log -n 1 |grep '^Date' " % dynahome, shell=True)
-            subprocess.Popen("cd %s ; git log -n 1 |grep '^commit' " % dynahome, shell=True)
-        except OSError:
+            print (dynahome / 'VERSION').text()
+
+        except IOError:
             print 'failed to obtain version info.'
         exit(0)