summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorJohn (J5) Palmieri <johnp@redhat.com>2006-07-21 16:42:54 -0400
committerJohn Palmieri <johnp@remedyz.boston.redhat.com>2006-07-21 16:42:54 -0400
commit163206f228efad53051677a08d3813fcc5d0ab97 (patch)
treed02d92740a13f1b22a3a6f35e29f3bf804d2ef15 /setup.py
parentf262d88279991faba06578dde48d0c607ce4b0b8 (diff)
* Automate building of ChangeLog
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/setup.py b/setup.py
index 8a04f99..e86c4d8 100644
--- a/setup.py
+++ b/setup.py
@@ -24,6 +24,7 @@ class full_clean(clean):
remove("dbus/dbus_bindings.pxd")
remove("dbus/dbus_bindings.c")
remove("dbus/dbus_glib_bindings.c")
+ remove("ChangeLog")
includedirs_flag = ['-I.']
dbus_includes = ['.']
@@ -51,6 +52,23 @@ if error:
includedirs_flag.extend(output.split())
dbus_glib_includes.extend([ x.replace("-I", "") for x in output.split() ])
+#create ChangeLog only if this is a git repo
+if os.path.exists(".git"):
+ pipe = os.popen3("git-log --stat")
+ output = pipe[1].read().strip()
+ error = pipe[2].read().strip()
+
+ for p in pipe:
+ p.close()
+
+ if error:
+ print "ERROR: running git-log (%s)" % (error)
+ raise SystemExit
+
+ file = open("ChangeLog", "w")
+ file.writelines(output)
+ file.close()
+
output = open("dbus/dbus_bindings.pxd", 'w')
includedirs_flag.append('-Idbus/')
extract.main("dbus/dbus_bindings.pxd.in", includedirs_flag, output)