From: "Brian Dolbec" <dolsen@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/vcs/, pym/repoman/, pym/repoman/modules/vcs/None/
Date: Mon, 7 Mar 2016 21:53:21 +0000 (UTC) [thread overview]
Message-ID: <1457385696.8ac28a818f6aa9edd23afd674086e154c70eeef9.dolsen@gentoo> (raw)
commit: 8ac28a818f6aa9edd23afd674086e154c70eeef9
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 10 18:08:55 2016 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Mar 7 21:21:36 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=8ac28a81
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..c2222dd 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.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)
next reply other threads:[~2016-03-07 21:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-07 21:53 Brian Dolbec [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-03-08 2:56 [gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/vcs/, pym/repoman/, pym/repoman/modules/vcs/None/ Brian Dolbec
2016-04-21 16:54 Brian Dolbec
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1457385696.8ac28a818f6aa9edd23afd674086e154c70eeef9.dolsen@gentoo \
--to=dolsen@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox