jhbuild r2162 - in trunk: . jhbuild/commands jhbuild/utils jhbuild/versioncontrol
- From: fpeters svn gnome org
- To: svn-commits-list gnome org
- Subject: jhbuild r2162 - in trunk: . jhbuild/commands jhbuild/utils jhbuild/versioncontrol
- Date: Thu, 3 Jul 2008 15:30:25 +0000 (UTC)
Author: fpeters
Date: Thu Jul 3 15:30:25 2008
New Revision: 2162
URL: http://svn.gnome.org/viewvc/jhbuild?rev=2162&view=rev
Log:
* jhbuild/commands/sanitycheck.py, jhbuild/utils/cmds.py,
jhbuild/versioncontrol/svn.py: added workaround against new default
interactive behaviour of subversion 1.5.
Modified:
trunk/ChangeLog
trunk/jhbuild/commands/sanitycheck.py
trunk/jhbuild/utils/cmds.py
trunk/jhbuild/versioncontrol/svn.py
Modified: trunk/jhbuild/commands/sanitycheck.py
==============================================================================
--- trunk/jhbuild/commands/sanitycheck.py (original)
+++ trunk/jhbuild/commands/sanitycheck.py Thu Jul 3 15:30:25 2008
@@ -22,34 +22,9 @@
import re
from jhbuild.commands import Command, register_command
-from jhbuild.utils.cmds import get_output
+from jhbuild.utils.cmds import get_output, check_version
from jhbuild.errors import UsageError, FatalError
-def check_version(cmd, regexp, minver):
- try:
- data = get_output(cmd)
- except:
- return False
- match = re.match(regexp, data, re.MULTILINE)
- if not match: return False
- version = match.group(1)
-
- version = version.split('.')
- for i, ver in enumerate(version):
- part = re.sub(r'^[^\d]*(\d+).*$', r'\1', ver)
- if not part:
- version[i] = None
- else:
- version[i] = int(part)
- minver = minver.split('.')
- for i, ver in enumerate(minver):
- part = re.sub(r'^[^\d]*(\d+).*$', r'\1', ver)
- if not part:
- minver[i] = None
- else:
- minver[i] = int(part)
- return version >= minver
-
def get_aclocal_path(version):
data = get_output(['aclocal-%s' % version, '--print-ac-dir'])
path = [data[:-1]]
Modified: trunk/jhbuild/utils/cmds.py
==============================================================================
--- trunk/jhbuild/utils/cmds.py (original)
+++ trunk/jhbuild/utils/cmds.py Thu Jul 3 15:30:25 2008
@@ -18,6 +18,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import os
+import re
import select
import subprocess
from signal import SIGINT
@@ -213,3 +214,28 @@
return True
return False
+def check_version(cmd, regexp, minver):
+ try:
+ data = get_output(cmd)
+ except:
+ return False
+ match = re.match(regexp, data, re.MULTILINE)
+ if not match:
+ return False
+ version = match.group(1)
+
+ version = version.split('.')
+ for i, ver in enumerate(version):
+ part = re.sub(r'^[^\d]*(\d+).*$', r'\1', ver)
+ if not part:
+ version[i] = None
+ else:
+ version[i] = int(part)
+ minver = minver.split('.')
+ for i, ver in enumerate(minver):
+ part = re.sub(r'^[^\d]*(\d+).*$', r'\1', ver)
+ if not part:
+ minver[i] = None
+ else:
+ minver[i] = int(part)
+ return version >= minver
Modified: trunk/jhbuild/versioncontrol/svn.py
==============================================================================
--- trunk/jhbuild/versioncontrol/svn.py (original)
+++ trunk/jhbuild/versioncontrol/svn.py Thu Jul 3 15:30:25 2008
@@ -25,11 +25,13 @@
import subprocess
from jhbuild.errors import CommandError, BuildStateError
-from jhbuild.utils.cmds import get_output
+from jhbuild.utils.cmds import get_output, check_version
from jhbuild.versioncontrol import Repository, Branch, register_repo_type
import bzr, git
+svn_one_five = None # is this svn 1.5
+
def _make_uri(repo, path):
if repo[-1] != '/':
return '%s/%s' % (repo, path)
@@ -220,6 +222,15 @@
elif self.config.sticky_date:
opt.extend(['-r', '{%s}' % self.config.sticky_date])
+ # Subversion 1.5 has interactive behaviour on conflicts; check version
+ # and add appropriate flags to get back 1.4 behaviour.
+ global svn_one_five
+ if svn_one_five is None:
+ svn_one_five = check_version(['svn', '--version'], r'svn, version ([\d.]+)', '1.5')
+
+ if svn_one_five is True:
+ opt.extend(['--accept', 'postpone'])
+
uri = get_uri(outputdir)
if urlparse.urlparse(uri)[:2] != urlparse.urlparse(self.module)[:2]:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]