From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 18FA41393EA for ; Mon, 10 Mar 2014 03:18:22 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 00E26E0A5E; Mon, 10 Mar 2014 03:18:20 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 6E422E0A72 for ; Mon, 10 Mar 2014 03:18:19 +0000 (UTC) Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 96EE333FC5F for ; Mon, 10 Mar 2014 03:18:18 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id 09920183B3 for ; Mon, 10 Mar 2014 03:18:16 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1394421418.8f96019f53b570163ddcf255551595fedca42bf4.dol-sen@gentoo> Subject: [gentoo-commits] proj/layman:master commit in: layman/overlays/ X-VCS-Repository: proj/layman X-VCS-Files: layman/overlays/svn.py X-VCS-Directories: layman/overlays/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 8f96019f53b570163ddcf255551595fedca42bf4 X-VCS-Branch: master Date: Mon, 10 Mar 2014 03:18:16 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 9efcb6e5-933c-4b20-aad8-c656eefe88d0 X-Archives-Hash: be83264ca5bb68e3751006f472fe8409 commit: 8f96019f53b570163ddcf255551595fedca42bf4 Author: Brian Dolbec gentoo org> AuthorDate: Tue Jan 7 06:01:12 2014 +0000 Commit: Brian Dolbec gmail com> CommitDate: Mon Mar 10 03:16:58 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/layman.git;a=commit;h=8f96019f Update svn's check_upgrade() for newer svn versions. Add stderr=PIPE to silence any error messages from less than svn ver. 1.8. zzzd --- layman/overlays/svn.py | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/layman/overlays/svn.py b/layman/overlays/svn.py index 4804925..20c09fb 100644 --- a/layman/overlays/svn.py +++ b/layman/overlays/svn.py @@ -131,27 +131,19 @@ class SvnOverlay(OverlaySource): return def check_upgrade(self, target): - '''Code to check the installed svn version and - run "svn upgrade" if needed.''' + '''Code to run "svn upgrade" it only takes longer + than checking if it does need an upgrade if it is + actually needed. + ''' file_to_run = _resolve_command(self.command(), self.output.error)[1] - args = file_to_run + ' -q --version' - pipe = Popen(args, shell=True, stdout=PIPE) + args = " ".join([file_to_run, " upgrade", target]) + pipe = Popen(args, shell=True, stdout=PIPE, stderr=PIPE) if pipe: - self.output.debug("SVN: check_upgrade()... have a valid pipe", 4) - version = pipe.stdout.readline().strip('\n') - self.output.debug("SVN: check_upgrade()... svn version found: %s" - % version, 4) + self.output.debug("SVN: check_upgrade()... have a valid pipe, " + "running upgrade", 4) + upgrade_output = pipe.stdout.readline().strip('\n') + if upgrade_output: + self.output.debug(" output: %s" % upgrade_output, 4) + self.output.debug("SVN: check_upgrade()... svn upgrade done", 4) pipe.terminate() - if version >= '1.7.0': - self.output.debug("SVN: check_upgrade()... svn upgrade maybe", - 4) - _path = path([target,'.svn/wc.db']) - if not os.path.exists(_path): - self.output.info("An svn upgrade needs to be run...", - 2) - args = ["upgrade"] - return self.run_command(self.command(), args, - cwd=target, cmd="svn upgrade") - return - else: - return + return