public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Brian Dolbec" <dolsen@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/vcs/cvs/, pym/repoman/modules/vcs/, pym/repoman/
Date: Sun,  7 Feb 2016 18:55:28 +0000 (UTC)	[thread overview]
Message-ID: <1454870787.d521c64172b6da67aabb8752f2b0a8b2bea9e5d3.dolsen@gentoo> (raw)

commit:     d521c64172b6da67aabb8752f2b0a8b2bea9e5d3
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sun Feb  7 18:46:27 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sun Feb  7 18:46:27 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=d521c641

repoman:  Move clear_attic() code to the modules

 pym/repoman/actions.py                 | 24 +-----------------------
 pym/repoman/modules/vcs/changes.py     |  4 ++++
 pym/repoman/modules/vcs/cvs/changes.py | 21 +++++++++++++++++++++
 3 files changed, 26 insertions(+), 23 deletions(-)

diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py
index 20116db..e045295 100644
--- a/pym/repoman/actions.py
+++ b/pym/repoman/actions.py
@@ -152,7 +152,7 @@ class Actions(object):
 		# inside the $Header path. This code detects the problem and corrects it
 		# so that the Manifest will generate correctly. See bug #169500.
 		# Use binary mode in order to avoid potential character encoding issues.
-		self.clear_attic(myheaders)
+		self.vcs_settings.changes.clear_attic(myheaders)
 
 		if self.scanner.repolevel == 1:
 			utilities.repoman_sez(
@@ -571,28 +571,6 @@ class Actions(object):
 				pass
 
 
-
-
-	def clear_attic(self, myheaders):
-		cvs_header_re = re.compile(br'^#\s*\$Header.*\$$')
-		attic_str = b'/Attic/'
-		attic_replace = b'/'
-		for x in myheaders:
-			f = open(
-				_unicode_encode(x, encoding=_encodings['fs'], errors='strict'),
-				mode='rb')
-			mylines = f.readlines()
-			f.close()
-			modified = False
-			for i, line in enumerate(mylines):
-				if cvs_header_re.match(line) is not None and \
-					attic_str in line:
-					mylines[i] = line.replace(attic_str, attic_replace)
-					modified = True
-			if modified:
-				portage.util.write_atomic(x, b''.join(mylines), mode='wb')
-
-
 	def sign_manifest(self, myupdates, myremoved, mymanifests):
 		try:
 			for x in sorted(vcs_files_to_cps(

diff --git a/pym/repoman/modules/vcs/changes.py b/pym/repoman/modules/vcs/changes.py
index 77d7dc1..1745a65 100644
--- a/pym/repoman/modules/vcs/changes.py
+++ b/pym/repoman/modules/vcs/changes.py
@@ -74,3 +74,7 @@ class ChangesBase(object):
 		'''Create a thick manifest'''
 		pass
 
+	@staticmethod
+	def clear_attic(myheaders):
+		'''Old CVS leftover'''
+		pass

diff --git a/pym/repoman/modules/vcs/cvs/changes.py b/pym/repoman/modules/vcs/cvs/changes.py
index 6accd4a..061486f 100644
--- a/pym/repoman/modules/vcs/cvs/changes.py
+++ b/pym/repoman/modules/vcs/cvs/changes.py
@@ -41,6 +41,27 @@ class Changes(ChangesBase):
 			return self._unadded
 		self._unadded = portage.cvstree.findunadded(self._tree, recursive=1, basedir="./")
 		return self._unadded
+
+	@staticmethod
+	def clear_attic(myheaders):
+		cvs_header_re = re.compile(br'^#\s*\$Header.*\$$')
+		attic_str = b'/Attic/'
+		attic_replace = b'/'
+		for x in myheaders:
+			f = open(
+				_unicode_encode(x, encoding=_encodings['fs'], errors='strict'),
+				mode='rb')
+			mylines = f.readlines()
+			f.close()
+			modified = False
+			for i, line in enumerate(mylines):
+				if cvs_header_re.match(line) is not None and \
+					attic_str in line:
+					mylines[i] = line.replace(attic_str, attic_replace)
+					modified = True
+			if modified:
+				portage.util.write_atomic(x, b''.join(mylines), mode='wb')
+
 	def thick_manifest(self, myupdates, myheaders, no_expansion, expansion):
 		headerstring = "'\$(Header|Id).*\$'"
 


             reply	other threads:[~2016-02-07 18:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-07 18:55 Brian Dolbec [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-03-11  0:41 [gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/vcs/cvs/, pym/repoman/modules/vcs/, pym/repoman/ Brian Dolbec
2016-03-12 18:10 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=1454870787.d521c64172b6da67aabb8752f2b0a8b2bea9e5d3.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