public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/vcs/, pym/repoman/, pym/repoman/modules/vcs/None/
@ 2016-03-07 21:53 Brian Dolbec
  0 siblings, 0 replies; 3+ messages in thread
From: Brian Dolbec @ 2016-03-07 21:53 UTC (permalink / raw
  To: gentoo-commits

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)


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/vcs/, pym/repoman/, pym/repoman/modules/vcs/None/
@ 2016-03-08  2:56 Brian Dolbec
  0 siblings, 0 replies; 3+ messages in thread
From: Brian Dolbec @ 2016-03-08  2:56 UTC (permalink / raw
  To: gentoo-commits

commit:     b04e18f2d700d822969a6a9f7e38d4d64a9a5835
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: 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)


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/vcs/, pym/repoman/, pym/repoman/modules/vcs/None/
@ 2016-04-21 16:54 Brian Dolbec
  0 siblings, 0 replies; 3+ messages in thread
From: Brian Dolbec @ 2016-04-21 16:54 UTC (permalink / raw
  To: gentoo-commits

commit:     c6249bb756c8f3eb4a7bff9b11fa1d767bf6cc37
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: Thu Apr 21 16:49:28 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c6249bb7

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 6c9de57..4032e04 100644
--- a/pym/repoman/actions.py
+++ b/pym/repoman/actions.py
@@ -422,30 +422,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)


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-21 16:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
  -- strict thread matches above, loose matches on Subject: below --
2016-04-21 16:54 Brian Dolbec
2016-03-07 21:53 Brian Dolbec

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox