Blame SOURCES/openpgm-04-py-version-gen.patch

d72c62
diff --git a/openpgm/pgm/version_generator.py b/openpgm/pgm/version_generator.py
d72c62
index e489aef..581eabe 100755
d72c62
--- a/openpgm/pgm/version_generator.py
d72c62
+++ b/openpgm/pgm/version_generator.py
d72c62
@@ -1,19 +1,25 @@
d72c62
-#!/usr/bin/python
d72c62
+#!/usr/bin/python3
d72c62
 
d72c62
 import os
d72c62
 import platform
d72c62
 import time
d72c62
 
d72c62
-build_date = time.strftime ("%Y-%m-%d")
d72c62
-build_time = time.strftime ("%H:%M:%S")
d72c62
-build_rev = filter (str.isdigit, "$Revision$")
d72c62
+timestamp = time.gmtime(int(os.environ.get('SOURCE_DATE_EPOCH', time.time())))
d72c62
+build_date = time.strftime ("%Y-%m-%d", timestamp)
d72c62
+build_time = time.strftime ("%H:%M:%S", timestamp)
d72c62
+build_rev = ''.join (list (filter (str.isdigit, "$Revision$")))
d72c62
+build_system = platform.system()
d72c62
+build_machine = platform.machine()
d72c62
+if 'SOURCE_DATE_EPOCH' in os.environ:
d72c62
+        build_system = 'BuildSystem'
d72c62
+        build_machine = 'BuildMachine'
d72c62
 
d72c62
-print """
d72c62
+print ("""
d72c62
 /* vim:ts=8:sts=8:sw=4:noai:noexpandtab
d72c62
  * 
d72c62
  * OpenPGM version.
d72c62
  *
d72c62
- * Copyright (c) 2006-2011 Miru Limited.
d72c62
+ * Copyright (c) 2006-2014 Miru Limited.
d72c62
  *
d72c62
  * This library is free software; you can redistribute it and/or
d72c62
  * modify it under the terms of the GNU Lesser General Public
d72c62
@@ -41,15 +47,16 @@
d72c62
 
d72c62
 const unsigned pgm_major_version = 5;
d72c62
 const unsigned pgm_minor_version = 2;
d72c62
 const unsigned pgm_micro_version = 122;
d72c62
-const char* pgm_build_date = "%s";
d72c62
-const char* pgm_build_time = "%s";
d72c62
-const char* pgm_build_system = "%s";
d72c62
-const char* pgm_build_machine = "%s";
d72c62
-const char* pgm_build_revision = "%s";
d72c62
+const char* pgm_build_date = "{0}";
d72c62
+const char* pgm_build_time = "{1}";
d72c62
+const char* pgm_build_system = "{2}";
d72c62
+const char* pgm_build_machine = "{3}";
d72c62
+const char* pgm_build_revision = "{4}";
d72c62
 
d72c62
 
d72c62
 /* eof */
d72c62
-"""%(build_date, build_time, platform.system(), platform.machine(), build_rev)
d72c62
+""".format (build_date, build_time, build_system, build_machine, build_rev))
d72c62
 
d72c62
 # end of file
d72c62
+