Diffstat (limited to 'tools/patch-wrangler.py')
1 files changed, 72 insertions, 0 deletions
diff --git a/tools/patch-wrangler.py b/tools/patch-wrangler.py
new file mode 100644
@@ -0,0 +1,72 @@
+# 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.
+# 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'
+ print 'Specify patch number'
+patchnum = sys.argv
+patchdir = posixpath.expanduser('~/patch/%s/%s' % (program, patchnum))
+if os.system("svn co svn+ssh://svn.gnome.org/svn/%s/trunk ." % (program))!=0:
+ print "Checkout failed."
+if os.system("wget http://bugzilla.gnome.org/attachment.cgi?id=%s -O - -q|patch -p 0" % (patchnum))!=0:
+ print "Patch failed."
+ print "Autogen failed."
+ print "Make failed."
+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."
+shell = '/bin/sh'
+ shell = os.environ['SHELL']
+ print "Couldn't launch the shell, though."