diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-16 22:54:04 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-16 22:54:04 +0000 |
commit | 7a92ab95ee1bc4d2af9ef7b3e071e650fa795619 (patch) | |
tree | 435ca579a8b9fe4d1828dee3ec328bf1cd26c175 | |
parent | bfcb47ca9a55d9ac5eecb7a28a931e19e31a2089 (diff) | |
download | chromium_src-7a92ab95ee1bc4d2af9ef7b3e071e650fa795619.zip chromium_src-7a92ab95ee1bc4d2af9ef7b3e071e650fa795619.tar.gz chromium_src-7a92ab95ee1bc4d2af9ef7b3e071e650fa795619.tar.bz2 |
checkperms: update to handle autoconf more generally
Fixes recent libxml change. Simplifies code a bit.
Review URL: http://codereview.chromium.org/3028008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52768 0039d316-1c4b-4281-b951-d872f2087c98
-rwxr-xr-x | tools/checkperms/checkperms.py | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/tools/checkperms/checkperms.py b/tools/checkperms/checkperms.py index c7b3454..0a8e335 100755 --- a/tools/checkperms/checkperms.py +++ b/tools/checkperms/checkperms.py @@ -58,9 +58,6 @@ WHITELIST_FILES = [ '/o3d/build/gyp_o3d', '/o3d/gypbuild', '/o3d/installer/linux/debian.in/rules', - '/third_party/ffmpeg/patched-ffmpeg-mt/configure', - '/third_party/icu/source/configure', - '/third_party/icu/source/install-sh', '/third_party/icu/source/runconfigureicu', '/third_party/lcov/bin/gendesc', '/third_party/lcov/bin/genhtml', @@ -68,7 +65,7 @@ WHITELIST_FILES = [ '/third_party/lcov/bin/genpng', '/third_party/lcov/bin/lcov', '/third_party/lcov/bin/mcov', - '/third_party/libevent/configure', + '/third_party/libxml/chvalid.c', # It's +x upstream, who knows why. '/third_party/libxml/linux/xml2-config', '/third_party/lzma_sdk/executable/7za.exe', '/third_party/swig/linux/swig', @@ -77,6 +74,17 @@ WHITELIST_FILES = [ '/tools/git/post-merge', ] +# File names that are always whitelisted. (These are all autoconf spew.) +WHITELIST_FILENAMES = set(( + 'config.guess', + 'config.sub', + 'configure', + 'depcomp', + 'install-sh', + 'missing', + 'mkinstalldirs' +)) + # File paths that contain these regexps will be whitelisted as well. WHITELIST_REGEX = [ re.compile('/third_party/sqlite/'), @@ -114,18 +122,14 @@ IS_SVN = True EXECUTABLE_PERMISSION = stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH -def IsWhiteListedExtension(file_path): - """Returns True if file_path has an extension we want to ignore.""" - return WHITELIST_EXTENSIONS_REGEX.match(os.path.splitext(file_path)[1]) - - -def IsWhiteListedPath(file_path): - """Returns True if file_path ends with a path we want to ignore.""" - return WHITELIST_FILES_REGEX.search(file_path) - - -def IsWhiteListedRegex(file_path): - """Returns True if file_path match any of the whitelist regexps.""" +def IsWhiteListed(file_path): + """Returns True if file_path is in our whitelist of files to ignore.""" + if WHITELIST_EXTENSIONS_REGEX.match(os.path.splitext(file_path)[1]): + return True + if WHITELIST_FILES_REGEX.search(file_path): + return True + if os.path.basename(file_path) in WHITELIST_FILENAMES: + return True for regex in WHITELIST_REGEX: if regex.search(file_path): return True @@ -146,12 +150,7 @@ def CheckFile(file_path): print 'Checking file: ' + file_path file_path_lower = file_path.lower() - # Check to see if it's whitelisted. - if IsWhiteListedExtension(file_path_lower): - return None - if IsWhiteListedPath(file_path_lower): - return None - if IsWhiteListedRegex(file_path_lower): + if IsWhiteListed(file_path_lower): return None # Not whitelisted, stat the file and check permissions. |