summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorThomas Thurman <tthurman@gnome.org>2008-02-04 00:04:05 +0000
committerThomas James Alexander Thurman <tthurman@src.gnome.org>2008-02-04 00:04:05 +0000
commita9a69ac80700aefeae8a8e7f42696bc4acd549dc (patch)
treecc312d38281b4c5a9680f5defdd2ce0b9d224fb7 /tools
parent8e7fe42b5eb7d01c50662d1f92f594d65815ac6e (diff)
downloadmetacity-a9a69ac80700aefeae8a8e7f42696bc4acd549dc.tar.gz
another program I use for maintenance which other people might find useful
2008-02-03 Thomas Thurman <tthurman@gnome.org> * tools/patch-wrangler.py: another program I use for maintenance which other people might find useful and which should probably be in svn. Also not very polished. svn path=/trunk/; revision=3549
Diffstat (limited to 'tools')
-rw-r--r--tools/patch-wrangler.py72
1 files changed, 72 insertions, 0 deletions
diff --git a/tools/patch-wrangler.py b/tools/patch-wrangler.py
new file mode 100644
index 00000000..f1bb65b0
--- /dev/null
+++ b/tools/patch-wrangler.py
@@ -0,0 +1,72 @@
+#!/usr/bin/python
+
+# Little script to grab a patch, compile it, and make it.
+
+# Copyright (C) 2008 Thomas Thurman
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+
+import os
+import sys
+import posixpath
+
+# FIXME: What would be lovely is an Epiphany extension to call this from Bugzilla pages
+
+# FIXME: Should be possible (but currently isn't) to get this from the patch number
+program = 'metacity'
+
+if len(sys.argv)<2:
+ print 'Specify patch number'
+ sys.exit(255)
+
+patchnum = sys.argv[1]
+
+patchdir = posixpath.expanduser('~/patch/%s/%s' % (program, patchnum))
+
+os.makedirs(patchdir)
+os.chdir(patchdir)
+
+if os.system("svn co svn+ssh://svn.gnome.org/svn/%s/trunk ." % (program))!=0:
+ print "Checkout failed."
+ sys.exit(255)
+
+if os.system("wget http://bugzilla.gnome.org/attachment.cgi?id=%s -O - -q|patch -p 0" % (patchnum))!=0:
+ print "Patch failed."
+ sys.exit(255)
+
+if os.system("./autogen.sh")!=0:
+ print "Autogen failed."
+ sys.exit(255)
+
+if os.system("make")!=0:
+ print "Make failed."
+ sys.exit(255)
+
+print
+print "It all seems to have worked. Don't look so surprised."
+print "Dropping you into a new shell now so you're in the right"
+print "directory; this does mean you'll have to exit twice when"
+print "you're finished."
+print
+
+shell = '/bin/sh'
+if os.environ.has_key('SHELL'):
+ shell = os.environ['SHELL']
+
+if os.system(shell):
+ print "Couldn't launch the shell, though."
+ sys.exit(255)