[gjs] Import release tools from g-i



commit f1873e72ab8ce80b17903d0d9472615829976043
Author: Colin Walters <walters verbum org>
Date:   Thu Mar 10 15:39:25 2011 -0500

    Import release tools from g-i

 Makefile.am        |   16 ++++++++++++++++
 configure.ac       |    7 ++++++-
 scripts/verbump.py |   46 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 68 insertions(+), 1 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index aecbdbe..38f9a74 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -130,3 +130,19 @@ install-exec-hook:
 	(cd $(DESTDIR)$(bindir) && ln -sf gjs-console$(EXEEXT) gjs$(EXEEXT))
 
 include Makefile-test.am
+
+prepare-release-tag:
+	@TAG=`echo $(VERSION)|sed s/\\\./_/g`;\
+	  echo "git tag $(PACKAGE)_$$TAG"; \
+          git tag -m "Tag $$VERSION" -a \
+              $(PACKAGE)_$$TAG
+
+prepare-minor-release: $(distdir).tar.bz2 prepare-release-tag
+	python $(top_srcdir)/scripts/verbump.py
+
+upload-release: $(distdir).tar.bz2
+	git log origin/master..master
+	@echo -n "Ok to push? [y/N] "; read ans; test x$$ans == xy || exit 1
+	git push --tags origin master:master
+	scp $(distdir).tar.bz2 gnome.org:
+	ssh gnome.org install-module $(distdir).tar.bz2
diff --git a/configure.ac b/configure.ac
index 0f2769b..ad9d436 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,8 +1,13 @@
 #                                               -*- Autoconf -*-
 # Process this file with autoconf to produce a configure script.
 
+m4_define(pkg_major_version, 0)
+m4_define(pkg_minor_version, 7)
+m4_define(pkg_micro_version, 12)
+m4_define(pkg_version, pkg_major_version.pkg_minor_version.pkg_micro_version)
+
 AC_PREREQ(2.61)
-AC_INIT([gjs], [0.7.12],[http://bugzilla.gnome.org/enter_bug.cgi?product=gjs])
+AC_INIT([gjs], pkg_version, [http://bugzilla.gnome.org/enter_bug.cgi?product=gjs])
 AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip])
 AC_CONFIG_SRCDIR([gjs/console.c])
 AC_CONFIG_HEADER([config.h])
diff --git a/scripts/verbump.py b/scripts/verbump.py
new file mode 100644
index 0000000..609498a
--- /dev/null
+++ b/scripts/verbump.py
@@ -0,0 +1,46 @@
+#!/usr/bin/env python
+# Automakes a release preparation for a post-release project
+# * Create a git tag
+# * Bump version in configure.ac and commit it
+
+import re
+import os
+import sys
+import subprocess
+
+micro_version_re = re.compile('m4_define.*pkg_micro_version, ([0-9]+)')
+micro_version_replace = 'm4_define(pkg_micro_version, %d)\n'
+
+def _extract_config_log_variable(name):
+    f = open('config.log')
+    keystart = name + '=\''
+    for line in f:
+        if line.startswith(keystart):
+            return line[len(keystart):-2]
+    f.close()
+    fatal("Failed to find '%s' in config.status" % (name, ))
+
+if not os.path.isfile('config.log'):
+    fatal("Couldn't find config.log; did you run configure?")
+package = _extract_config_log_variable('PACKAGE_TARNAME')
+version = _extract_config_log_variable('VERSION')
+
+f = open('configure.ac');
+newf = open('configure.ac.new', 'w')
+for line in f:
+  m = micro_version_re.match(line)
+  if not m:
+    newf.write(line)
+    continue
+  v = int(m.group(1))
+  newv = v+1
+  print "Will update micro version from %s to %s" % (v, newv)
+  newf.write(micro_version_replace % (newv, ))
+newf.close()
+
+os.rename('configure.ac.new', 'configure.ac')
+print "Successfully wrote new 'configure.ac' with post-release version bump"
+
+args=['git', 'commit', '-m', "configure: Post-release version bump", 'configure.ac']
+print "Running: %r" % (args, )
+subprocess.check_call(args)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]