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 7F0F659CA3 for ; Tue, 8 Mar 2016 02:56:14 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4589421C018; Tue, 8 Mar 2016 02:56:13 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 869FF21C021 for ; Tue, 8 Mar 2016 02:56:12 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1CC65340A69 for ; Tue, 8 Mar 2016 02:56:11 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8EDB22099 for ; Tue, 8 Mar 2016 02:56:07 +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: <1457405687.b04e18f2d700d822969a6a9f7e38d4d64a9a5835.dolsen@gentoo> Subject: [gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/vcs/, pym/repoman/, pym/repoman/modules/vcs/None/ X-VCS-Repository: proj/portage X-VCS-Files: pym/repoman/actions.py pym/repoman/modules/vcs/None/changes.py pym/repoman/modules/vcs/changes.py X-VCS-Directories: pym/repoman/modules/vcs/None/ pym/repoman/modules/vcs/ pym/repoman/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: b04e18f2d700d822969a6a9f7e38d4d64a9a5835 X-VCS-Branch: repoman Date: Tue, 8 Mar 2016 02:56:07 +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: bef79286-186d-4585-a492-1b95cbd1066d X-Archives-Hash: bb715a735a0db25b39b180a6cb2973f6 commit: b04e18f2d700d822969a6a9f7e38d4d64a9a5835 Author: Brian Dolbec gentoo org> AuthorDate: Wed Feb 10 18:08:55 2016 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Tue Mar 8 02:54:47 2016 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=b04e18f2 repoman: Migrate add items to the vcs modules pym/repoman/actions.py | 25 +------------------------ pym/repoman/modules/vcs/None/changes.py | 4 ++++ pym/repoman/modules/vcs/changes.py | 20 ++++++++++++++++++++ 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py index 4209d13..d2e4fc1 100644 --- a/pym/repoman/actions.py +++ b/pym/repoman/actions.py @@ -411,30 +411,7 @@ class Actions(object): if myautoadd: print(">>> Auto-Adding missing Manifest/ChangeLog file(s)...") - add_cmd = [self.vcs_settings.vcs, "add"] - add_cmd += myautoadd - if self.options.pretend: - portage.writemsg_stdout( - "(%s)\n" % " ".join(add_cmd), - noiselevel=-1) - else: - - if sys.hexversion < 0x3020000 and sys.hexversion >= 0x3000000 and \ - not os.path.isabs(add_cmd[0]): - # Python 3.1 _execvp throws TypeError for non-absolute executable - # path passed as bytes (see http://bugs.python.org/issue8513). - fullname = find_binary(add_cmd[0]) - if fullname is None: - raise portage.exception.CommandNotFound(add_cmd[0]) - add_cmd[0] = fullname - - add_cmd = [_unicode_encode(arg) for arg in add_cmd] - retcode = subprocess.call(add_cmd) - if retcode != os.EX_OK: - logging.error( - "Exiting on %s error code: %s\n" % (self.vcs_settings.vcs, retcode)) - sys.exit(retcode) - + self.vcs_settings.changes.add_items(myautoadd) myupdates += myautoadd return myupdates, broken_changelog_manifests diff --git a/pym/repoman/modules/vcs/None/changes.py b/pym/repoman/modules/vcs/None/changes.py index 37693ad..98beedb 100644 --- a/pym/repoman/modules/vcs/None/changes.py +++ b/pym/repoman/modules/vcs/None/changes.py @@ -22,3 +22,7 @@ class Changes(ChangesBase): def scan(self): '''VCS type scan function, looks for all detectable changes''' pass + + def add_items(self, myautoadd): + '''Nothing to add them to''' + pass diff --git a/pym/repoman/modules/vcs/changes.py b/pym/repoman/modules/vcs/changes.py index 948407c..ee94217 100644 --- a/pym/repoman/modules/vcs/changes.py +++ b/pym/repoman/modules/vcs/changes.py @@ -2,9 +2,14 @@ Base Changes class ''' +import logging import os +import subprocess +import sys from itertools import chain +from repoman._portage import portage +from portage import _unicode_encode class ChangesBase(object): '''Base Class object to scan and hold the resultant data @@ -89,3 +94,18 @@ class ChangesBase(object): def update_index(self, mymanifests, myupdates): '''Update the vcs's modified index if it is needed''' pass + + def add_items(self, myautoadd): + add_cmd = [self.vcs, "add"] + add_cmd += myautoadd + if self.options.pretend: + portage.writemsg_stdout( + "(%s)\n" % " ".join(add_cmd), + noiselevel=-1) + else: + add_cmd = [_unicode_encode(arg) for arg in add_cmd] + retcode = subprocess.call(add_cmd) + if retcode != os.EX_OK: + logging.error( + "Exiting on %s error code: %s\n" % (self.vcs_settings.vcs, retcode)) + sys.exit(retcode)