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 1991259CA3 for ; Sat, 12 Mar 2016 18:10:47 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E22EB21C108; Sat, 12 Mar 2016 18:10:21 +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 500F921C104 for ; Sat, 12 Mar 2016 18:10:19 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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 A18F9340BCB for ; Sat, 12 Mar 2016 18:10:17 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id BC9D5240F for ; Sat, 12 Mar 2016 18:10:12 +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: <1457805460.34f2515b33ac1861da2f7e4f10ad0100ae2f155c.dolsen@gentoo> Subject: [gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/vcs/cvs/, pym/repoman/modules/vcs/, pym/repoman/ X-VCS-Repository: proj/portage X-VCS-Files: pym/repoman/actions.py pym/repoman/modules/vcs/changes.py pym/repoman/modules/vcs/cvs/changes.py X-VCS-Directories: pym/repoman/ pym/repoman/modules/vcs/ pym/repoman/modules/vcs/cvs/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 34f2515b33ac1861da2f7e4f10ad0100ae2f155c X-VCS-Branch: repoman Date: Sat, 12 Mar 2016 18:10:12 +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: e743b71c-ae0e-4a45-a8d0-768e233c97e0 X-Archives-Hash: 5077616f08717933ceeb489e0d01ef61 commit: 34f2515b33ac1861da2f7e4f10ad0100ae2f155c Author: Brian Dolbec gentoo org> AuthorDate: Sun Feb 7 18:46:27 2016 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Sat Mar 12 17:57:40 2016 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=34f2515b 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 f477aec..8ff658c 100644 --- a/pym/repoman/actions.py +++ b/pym/repoman/actions.py @@ -153,7 +153,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( @@ -582,28 +582,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).*\$'"