projects
/
portage.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4dd5fc4
)
_update_copyright_year: optimize no-match case
author
Zac Medico
<zmedico@gentoo.org>
Fri, 21 Oct 2011 07:19:48 +0000
(
00:19
-0700)
committer
Zac Medico
<zmedico@gentoo.org>
Fri, 21 Oct 2011 07:19:48 +0000
(
00:19
-0700)
pym/repoman/utilities.py
patch
|
blob
|
history
diff --git
a/pym/repoman/utilities.py
b/pym/repoman/utilities.py
index 9be69011b043c38430e4465b3ab9781b12e07823..eecd46ffa7f7523bfd4185cc446950c528fb80f0 100644
(file)
--- a/
pym/repoman/utilities.py
+++ b/
pym/repoman/utilities.py
@@
-546,9
+546,16
@@
def _update_copyright_year(year, line):
1999 here (in order to be more generic).
"""
is_bytes = isinstance(line, bytes)
+ if is_bytes:
+ if not line.startswith(b'# Copyright '):
+ return line
+ else:
+ if not line.startswith('# Copyright '):
+ return line
+
year = _unicode_encode(year)
line = _unicode_encode(line)
-
+
line = _copyright_re1.sub(br'\1-' + year + b' ', line)
line = _copyright_re2.sub(_copyright_repl(year), line)
if not is_bytes: