summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-10-27 09:04:50 -0700
committerZac Medico <zmedico@gentoo.org>2010-10-27 09:04:50 -0700
commit2167ded8772eee4ea18a1e77ee35b11291524cf5 (patch)
treef57cbb930472e77ea915616566a5b03eec48bda9
parent9bb5fb831e41c2d61d92e100d509c2348285c5f9 (diff)
downloadportage-2167ded8772eee4ea18a1e77ee35b11291524cf5.tar.gz
portage-2167ded8772eee4ea18a1e77ee35b11291524cf5.tar.bz2
portage-2167ded8772eee4ea18a1e77ee35b11291524cf5.zip
repoman: optimize svn keywords handling
-rwxr-xr-xbin/repoman11
1 files changed, 7 insertions, 4 deletions
diff --git a/bin/repoman b/bin/repoman
index dd903370b..d24907310 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2220,7 +2220,8 @@ else:
if vcs == 'cvs':
headerstring = "'\$(Header|Id).*\$'"
elif vcs == "svn":
- svn_keywords = ["Rev",
+ svn_keywords = dict((k.lower(), k) for k in [
+ "Rev",
"Revision",
"LastChangedRevision",
"Date",
@@ -2230,7 +2231,8 @@ else:
"URL",
"HeadURL",
"Id",
- "Header"]
+ "Header",
+ ])
for myfile in myupdates:
@@ -2246,8 +2248,9 @@ else:
# Subversion keywords are case-insensitive in svn:keywords properties, but case-sensitive in contents of files.
enabled_keywords = []
- for keyword in svn_keywords:
- if keyword.lower() in (k.lower() for k in expansion[myfile]):
+ for k in expansion[myfile]:
+ keyword = svn_keywords.get(k.lower())
+ if keyword is not None:
enabled_keywords.append(keyword)
headerstring = "'\$(%s).*\$'" % "|".join(enabled_keywords)