changeset b2850bdcec07 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=b2850bdcec07
description:
Util: Do not style check symlinks
The style checker used to traverse symlinks if they pointed to files,
which can
result in style checker failure if the pointed-to file doesn't exist.
This
style check is actually unnecessary, since symlinks either point to
other files
that are already style checked, or files outside gem5, which shouldn't
be
checked. Skip symlinks.
diffstat:
util/style.py | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diffs (31 lines):
diff -r 79af6cc0384d -r b2850bdcec07 util/style.py
--- a/util/style.py Mon Jun 09 22:01:16 2014 -0500
+++ b/util/style.py Mon Jun 09 22:01:18 2014 -0500
@@ -149,6 +149,13 @@
return f
def skip(self, filename):
+ # We never want to handle symlinks, so always skip them: If the
location
+ # pointed to is a directory, skip it. If the location is a file inside
+ # the gem5 directory, it will be checked as a file, so symlink can be
+ # skipped. If the location is a file outside gem5, we don't want to
+ # check it anyway.
+ if os.path.islink(filename):
+ return True
return lang_type(filename) not in self.languages
def check(self, filename, regions=all_regions):
@@ -384,6 +391,13 @@
files = frozenset(files)
def skip(name):
+ # We never want to handle symlinks, so always skip them: If the
location
+ # pointed to is a directory, skip it. If the location is a file inside
+ # the gem5 directory, it will be checked as a file, so symlink can be
+ # skipped. If the location is a file outside gem5, we don't want to
+ # check it anyway.
+ if os.path.islink(name):
+ return True
return files and name in files
def prompt(name, func, regions=all_regions):
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev