summaryrefslogtreecommitdiffstats
path: root/pym/repoman
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-06-15 10:53:36 -0700
committerZac Medico <zmedico@gentoo.org>2010-06-15 10:53:36 -0700
commit04cdd7c9ecb92caacada00d78d80a9b159d7390c (patch)
tree870b1f5459d88ab8eb5f50ccf21090e86bf4418c /pym/repoman
parent1a716a5f949b84cd8a84871ad7caa9d985fe91fc (diff)
downloadportage-04cdd7c9ecb92caacada00d78d80a9b159d7390c.tar.gz
portage-04cdd7c9ecb92caacada00d78d80a9b159d7390c.tar.bz2
portage-04cdd7c9ecb92caacada00d78d80a9b159d7390c.zip
Bug #324075 - Avoid erroneous 'Invalid Gentoo Copyright' warnings when
the vcs (git) does not support mtime preservation. Also, fix the same check to work for ebuilds wiht copyrigh beginning in 2011 and later.
Diffstat (limited to 'pym/repoman')
-rw-r--r--pym/repoman/checks.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 23f1267d9..4d12b07fd 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -67,14 +67,17 @@ class EbuildHeader(LineCheck):
repoman_check_name = 'ebuild.badheader'
- gentoo_copyright = r'^# Copyright ((1999|200\d)-)?%s Gentoo Foundation$'
+ gentoo_copyright = r'^# Copyright ((1999|2\d\d\d)-)?%s Gentoo Foundation$'
# Why a regex here, use a string match
# gentoo_license = re.compile(r'^# Distributed under the terms of the GNU General Public License v2$')
gentoo_license = r'# Distributed under the terms of the GNU General Public License v2'
cvs_header = re.compile(r'^#\s*\$Header.*\$$')
def new(self, pkg):
- self.modification_year = str(time.gmtime(pkg.mtime)[0])
+ if pkg.mtime is None:
+ self.modification_year = r'2\d\d\d'
+ else:
+ self.modification_year = str(time.gmtime(pkg.mtime)[0])
self.gentoo_copyright_re = re.compile(
self.gentoo_copyright % self.modification_year)