public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/vcs/svn/, pym/repoman/, pym/repoman/modules/vcs/, ...
@ 2016-04-21 16:54 Brian Dolbec
  0 siblings, 0 replies; only message in thread
From: Brian Dolbec @ 2016-04-21 16:54 UTC (permalink / raw
  To: gentoo-commits

commit:     4f79b514fc5fdc5dd2230d8fa219d972c8c9b92a
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sun Feb  7 18:53:58 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=4f79b514

repoman: Migrate digest regeneration to the vcs modules

 pym/repoman/actions.py                 | 15 ++-------------
 pym/repoman/modules/vcs/bzr/changes.py | 14 ++++++++++++--
 pym/repoman/modules/vcs/changes.py     |  5 +++++
 pym/repoman/modules/vcs/cvs/changes.py | 13 +++++++++++--
 pym/repoman/modules/vcs/git/changes.py |  9 +++++++++
 pym/repoman/modules/vcs/hg/changes.py  |  9 +++++++++
 pym/repoman/modules/vcs/settings.py    |  6 ++++--
 pym/repoman/modules/vcs/svn/changes.py | 17 +++++++++++++++++
 8 files changed, 69 insertions(+), 19 deletions(-)

diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py
index 8ff658c..4d06555 100644
--- a/pym/repoman/actions.py
+++ b/pym/repoman/actions.py
@@ -6,7 +6,6 @@ import errno
 import io
 import logging
 import platform
-import re
 import signal
 import subprocess
 import sys
@@ -25,7 +24,6 @@ from portage.package.ebuild.digestgen import digestgen
 from portage.process import find_binary, spawn
 from portage.util import writemsg_level
 
-from repoman._subprocess import repoman_getstatusoutput
 from repoman.gpg import gpgsign, need_signature
 from repoman import utilities
 from repoman.modules.vcs.vcs import vcs_files_to_cps
@@ -160,17 +158,8 @@ class Actions(object):
 				"\"You're rather crazy... "
 				"doing the entire repository.\"\n")
 
-		if self.vcs_settings.vcs in ('cvs', 'svn') and (myupdates or myremoved):
-			for x in sorted(vcs_files_to_cps(
-				chain(myupdates, myremoved, mymanifests),
-				self.scanner.repolevel, self.scanner.reposplit, self.scanner.categories)):
-				self.repoman_settings["O"] = os.path.join(self.repo_settings.repodir, x)
-				digestgen(mysettings=self.repoman_settings, myportdb=self.repo_settings.portdb)
-
-		elif broken_changelog_manifests:
-			for x in broken_changelog_manifests:
-				self.repoman_settings["O"] = os.path.join(self.repo_settings.repodir, x)
-				digestgen(mysettings=self.repoman_settings, myportdb=self.repo_settings.portdb)
+		self.vcs_settings.changes.digest_regen(myupdates, myremoved, mymanifests,
+			self.scanner, broken_changelog_manifests)
 
 		if self.repo_settings.sign_manifests:
 			self.sign_manifest(myupdates, myremoved, mymanifests)

diff --git a/pym/repoman/modules/vcs/bzr/changes.py b/pym/repoman/modules/vcs/bzr/changes.py
index 9bd0646..81e7cf5 100644
--- a/pym/repoman/modules/vcs/bzr/changes.py
+++ b/pym/repoman/modules/vcs/bzr/changes.py
@@ -4,7 +4,9 @@ Bazaar module Changes class submodule
 
 from repoman.modules.vcs.changes import ChangesBase
 from repoman._subprocess import repoman_popen
-
+from repoman._portage import portage
+from portage import os
+from portage.package.ebuild.digestgen import digestgen
 
 class Changes(ChangesBase):
 	'''Class object to scan and hold the resultant data
@@ -36,6 +38,7 @@ class Changes(ChangesBase):
 			"./" + elem.split()[-3:-2][0].split('/')[-1:][0]
 			for elem in bzrstatus
 			if elem and (elem[1:2] == "K" or elem[0:1] == "R")]
+		self.bzrstatus = bzrstatus
 		# Bazaar expands nothing.
 
 	@property
@@ -45,6 +48,13 @@ class Changes(ChangesBase):
 			return self._unadded
 		self._unadded = [
 			"./" + elem.rstrip().split()[1].split('/')[-1:][0]
-			for elem in bzrstatus
+			for elem in self.bzrstatus
 			if elem.startswith("?") or elem[0:2] == " D"]
 		return self._unadded
+
+	def digest_regen(self, myupdates, myremoved, mymanifests, scanner, broken_changelog_manifests):
+		if broken_changelog_manifests:
+			for x in broken_changelog_manifests:
+				self.repoman_settings["O"] = os.path.join(self.repo_settings.repodir, x)
+				digestgen(mysettings=self.repoman_settings, myportdb=self.repo_settings.portdb)
+

diff --git a/pym/repoman/modules/vcs/changes.py b/pym/repoman/modules/vcs/changes.py
index 921e9b5..27b627f 100644
--- a/pym/repoman/modules/vcs/changes.py
+++ b/pym/repoman/modules/vcs/changes.py
@@ -76,6 +76,11 @@ class ChangesBase(object):
 		'''Create a thick manifest'''
 		pass
 
+	def digest_regen(self, myupdates, myremoved, mymanifests, scanner,
+					broken_changelog_manifests):
+		'''Regenerate manifests'''
+		pass
+
 	@staticmethod
 	def clear_attic(myheaders):
 		'''Old CVS leftover'''

diff --git a/pym/repoman/modules/vcs/cvs/changes.py b/pym/repoman/modules/vcs/cvs/changes.py
index 5fc9642..794e850 100644
--- a/pym/repoman/modules/vcs/cvs/changes.py
+++ b/pym/repoman/modules/vcs/cvs/changes.py
@@ -3,11 +3,12 @@ CVS module Changes class submodule
 '''
 
 import re
+from itertools import chain
 
 from repoman._portage import portage
 from repoman.modules.vcs.changes import ChangesBase
-from portage import cvstree
-
+from portage import cvstree, os
+from portage.package.ebuild.digestgen import digestgen
 
 class Changes(ChangesBase):
 	'''Class object to scan and hold the resultant data
@@ -81,3 +82,11 @@ class Changes(ChangesBase):
 			"* Files with headers will"
 			" cause the manifests to be changed and committed separately.")
 
+	def digest_regen(self, myupdates, myremoved, mymanifests, scanner, broken_changelog_manifests):
+		if myupdates or myremoved:
+			for x in sorted(vcs_files_to_cps(
+				chain(myupdates, myremoved, mymanifests),
+				scanner.repolevel, scanner.reposplit, scanner.categories)):
+				self.repoman_settings["O"] = os.path.join(self.repo_settings.repodir, x)
+				digestgen(mysettings=self.repoman_settings, myportdb=self.repo_settings.portdb)
+

diff --git a/pym/repoman/modules/vcs/git/changes.py b/pym/repoman/modules/vcs/git/changes.py
index f159298..1970b3a 100644
--- a/pym/repoman/modules/vcs/git/changes.py
+++ b/pym/repoman/modules/vcs/git/changes.py
@@ -4,6 +4,9 @@ Git module Changes class submodule
 
 from repoman.modules.vcs.changes import ChangesBase
 from repoman._subprocess import repoman_popen
+from repoman._portage import portage
+from portage import os
+from portage.package.ebuild.digestgen import digestgen
 
 
 class Changes(ChangesBase):
@@ -54,3 +57,9 @@ class Changes(ChangesBase):
 		self._unadded = ["./" + elem[:-1] for elem in unadded]
 		del unadded
 		return self._unadded
+
+	def digest_regen(self, myupdates, myremoved, mymanifests, scanner, broken_changelog_manifests):
+		if broken_changelog_manifests:
+			for x in broken_changelog_manifests:
+				self.repoman_settings["O"] = os.path.join(self.repo_settings.repodir, x)
+				digestgen(mysettings=self.repoman_settings, myportdb=self.repo_settings.portdb)

diff --git a/pym/repoman/modules/vcs/hg/changes.py b/pym/repoman/modules/vcs/hg/changes.py
index 311ca12..2667829 100644
--- a/pym/repoman/modules/vcs/hg/changes.py
+++ b/pym/repoman/modules/vcs/hg/changes.py
@@ -4,6 +4,9 @@ Mercurial module Changes class submodule
 
 from repoman.modules.vcs.changes import ChangesBase
 from repoman._subprocess import repoman_popen
+from repoman._portage import portage
+from portage import os
+from portage.package.ebuild.digestgen import digestgen
 
 
 class Changes(ChangesBase):
@@ -62,3 +65,9 @@ class Changes(ChangesBase):
 		del deleted
 		return self._deleted
 
+
+	def digest_regen(self, myupdates, myremoved, mymanifests, scanner, broken_changelog_manifests):
+		if broken_changelog_manifests:
+			for x in broken_changelog_manifests:
+				self.repoman_settings["O"] = os.path.join(self.repo_settings.repodir, x)
+				digestgen(mysettings=self.repoman_settings, myportdb=self.repo_settings.portdb)

diff --git a/pym/repoman/modules/vcs/settings.py b/pym/repoman/modules/vcs/settings.py
index f51c3b2..9338a81 100644
--- a/pym/repoman/modules/vcs/settings.py
+++ b/pym/repoman/modules/vcs/settings.py
@@ -13,8 +13,10 @@ from repoman.qa_tracker import QATracker
 class VCSSettings(object):
 	'''Holds various VCS settings'''
 
-	def __init__(self, options=None, repoman_settings=None):
+	def __init__(self, options=None, repoman_settings=None, repo_settings=None):
 		self.options = options
+		self.repoman_settings = repoman_settings
+		self.repo_settings = repo_settings
 		if options.vcs:
 			if options.vcs in module_names:
 				self.vcs = options.vcs
@@ -89,5 +91,5 @@ class VCSSettings(object):
 	def changes(self):
 		if not self._changes:
 			changes = self.module_controller.get_class('%s_changes' % self.vcs)
-			self._changes = changes(self.options)
+			self._changes = changes(self.options, self.repo_settings)
 		return self._changes

diff --git a/pym/repoman/modules/vcs/svn/changes.py b/pym/repoman/modules/vcs/svn/changes.py
index ffe19c1..f22c97d 100644
--- a/pym/repoman/modules/vcs/svn/changes.py
+++ b/pym/repoman/modules/vcs/svn/changes.py
@@ -2,8 +2,16 @@
 Subversion module Changes class submodule
 '''
 
+from itertools import chain
+
 from repoman.modules.vcs.changes import ChangesBase
 from repoman._subprocess import repoman_popen
+from repoman._subprocess import repoman_getstatusoutput
+from repoman.modules.vcs.vcs import vcs_files_to_cps
+from repoman._portage import portage
+from portage import os
+from portage.output import green
+from portage.package.ebuild.digestgen import digestgen
 
 
 class Changes(ChangesBase):
@@ -106,3 +114,12 @@ class Changes(ChangesBase):
 			"* Files with headers will"
 			" cause the manifests to be changed and committed separately.")
 
+	def digest_regen(self, myupdates, myremoved, mymanifests, scanner, broken_changelog_manifests):
+		if myupdates or myremoved:
+			for x in sorted(vcs_files_to_cps(
+				chain(myupdates, myremoved, mymanifests),
+				scanner.repolevel, scanner.reposplit, scanner.categories)):
+				self.repoman_settings["O"] = os.path.join(self.repo_settings.repodir, x)
+				digestgen(mysettings=self.repoman_settings, myportdb=self.repo_settings.portdb)
+
+


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-04-21 16:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-21 16:54 [gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/vcs/svn/, pym/repoman/, pym/repoman/modules/vcs/, Brian Dolbec

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