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 575521387B1 for ; Mon, 21 Sep 2015 23:51:37 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A590B21C048; Mon, 21 Sep 2015 23:51:27 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id CC5DD21C048 for ; Mon, 21 Sep 2015 23:51:26 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2DAFF3409FE for ; Mon, 21 Sep 2015 23:51:26 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id CFAD8250 for ; Mon, 21 Sep 2015 23:51:19 +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: <1442878967.a0849ae0b37956da75b517b8d0b38c839261f4ba.dolsen@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/repoman/ X-VCS-Repository: proj/portage X-VCS-Files: pym/repoman/actions.py X-VCS-Directories: pym/repoman/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: a0849ae0b37956da75b517b8d0b38c839261f4ba X-VCS-Branch: master Date: Mon, 21 Sep 2015 23:51:19 +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: a4c00f7c-8303-4ea4-9927-3dea3a58bb55 X-Archives-Hash: 2facff45163b09477974b53c9205e4f1 commit: a0849ae0b37956da75b517b8d0b38c839261f4ba Author: Brian Dolbec gentoo org> AuthorDate: Sat Sep 19 04:26:39 2015 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Mon Sep 21 23:42:47 2015 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=a0849ae0 repoman/actions.py: Splitout clear_attic() pym/repoman/actions.py | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py index 974de62..5b55ff8 100644 --- a/pym/repoman/actions.py +++ b/pym/repoman/actions.py @@ -166,23 +166,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. - 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') + self.clear_attic(myheaders) if self.scanner.repolevel == 1: utilities.repoman_sez( @@ -817,3 +801,23 @@ class Actions(object): print( "* Files with headers will" " cause the manifests to be changed and committed separately.") + + + 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') 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 086E01387B1 for ; Mon, 21 Sep 2015 23:48:29 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9901121C050; Mon, 21 Sep 2015 23:48:07 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id EBED221C050 for ; Mon, 21 Sep 2015 23:48:01 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 3FC7F3409F1 for ; Mon, 21 Sep 2015 23:48:01 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id E03C7250 for ; Mon, 21 Sep 2015 23:47:56 +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: <1442878967.a0849ae0b37956da75b517b8d0b38c839261f4ba.dolsen@gentoo> Subject: [gentoo-commits] proj/portage:repoman commit in: pym/repoman/ X-VCS-Repository: proj/portage X-VCS-Files: pym/repoman/actions.py X-VCS-Directories: pym/repoman/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: a0849ae0b37956da75b517b8d0b38c839261f4ba X-VCS-Branch: repoman Date: Mon, 21 Sep 2015 23:47:56 +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: 900be41b-90ee-4fe0-a100-dbf108ec4228 X-Archives-Hash: 43487870ec742e43e27ba369e2de94ab Message-ID: <20150921234756.HNodHujjNhDHQN8ePHnEUuY-IYhpHFgf8BGwedndPqk@z> commit: a0849ae0b37956da75b517b8d0b38c839261f4ba Author: Brian Dolbec gentoo org> AuthorDate: Sat Sep 19 04:26:39 2015 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Mon Sep 21 23:42:47 2015 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=a0849ae0 repoman/actions.py: Splitout clear_attic() pym/repoman/actions.py | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py index 974de62..5b55ff8 100644 --- a/pym/repoman/actions.py +++ b/pym/repoman/actions.py @@ -166,23 +166,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. - 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') + self.clear_attic(myheaders) if self.scanner.repolevel == 1: utilities.repoman_sez( @@ -817,3 +801,23 @@ class Actions(object): print( "* Files with headers will" " cause the manifests to be changed and committed separately.") + + + 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')