summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-03-17 12:48:30 -0700
committerZac Medico <zmedico@gentoo.org>2012-03-17 12:48:30 -0700
commit237427dbf5eadf1e7b7bf2962b2ccbb352e527ab (patch)
treedecf4d3e46aba7b58e5139302887968cc2f9b851 /bin
parent2dac56fa282645031eb29860abc403e983a04b2d (diff)
downloadportage-237427dbf5eadf1e7b7bf2962b2ccbb352e527ab.tar.gz
portage-237427dbf5eadf1e7b7bf2962b2ccbb352e527ab.tar.bz2
portage-237427dbf5eadf1e7b7bf2962b2ccbb352e527ab.zip
repoman: ignore temp files, bug #406877
If the file isn't in the VCS new or changed set, then assume that it's an irrelevant temporary file. This relies on commit 2dac56fa282645031eb29860abc403e983a04b2d to guarantee that Manifest entries are not generated for file names containing prohibited characters.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/repoman22
1 files changed, 22 insertions, 0 deletions
diff --git a/bin/repoman b/bin/repoman
index ffedf2e21..80fcde29f 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1170,6 +1170,12 @@ if vcs:
modified_changelogs.update(x for x in chain(mychanged, mynew) \
if os.path.basename(x) == "ChangeLog")
+def vcs_new_changed(relative_path):
+ for x in chain(mychanged, mynew):
+ if x == relative_path:
+ return True
+ return False
+
have_pmasked = False
have_dev_keywords = False
dofail = 0
@@ -1361,6 +1367,14 @@ for x in effective_scanlist:
for y in checkdirlist:
m = disallowed_filename_chars_re.search(y.strip(os.sep))
if m is not None:
+ y_relative = os.path.join(checkdir_relative, y)
+ if vcs is not None and not vcs_new_changed(y_relative):
+ # If the file isn't in the VCS new or changed set, then
+ # assume that it's an irrelevant temporary file (Manifest
+ # entries are not generated for file names containing
+ # prohibited characters). See bug #406877.
+ m = None
+ if m is not None:
stats["file.name"] += 1
fails["file.name"].append("%s/%s: char '%s'" % \
(checkdir, y, m.group(0)))
@@ -1529,6 +1543,14 @@ for x in effective_scanlist:
m = disallowed_filename_chars_re.search(
os.path.basename(y.rstrip(os.sep)))
if m is not None:
+ y_relative = os.path.join(checkdir_relative, "files", y)
+ if vcs is not None and not vcs_new_changed(y_relative):
+ # If the file isn't in the VCS new or changed set, then
+ # assume that it's an irrelevant temporary file (Manifest
+ # entries are not generated for file names containing
+ # prohibited characters). See bug #406877.
+ m = None
+ if m is not None:
stats["file.name"] += 1
fails["file.name"].append("%s/files/%s: char '%s'" % \
(checkdir, y, m.group(0)))