summaryrefslogtreecommitdiffstats
path: root/build/android
diff options
context:
space:
mode:
authorfeng@chromium.org <feng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-21 12:39:56 +0000
committerfeng@chromium.org <feng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-21 12:39:56 +0000
commit7cd58be7b084710c7785cd856fd18e04c17c390a (patch)
tree54e7b9646e8be047ab93e649141b1d624fc2c887 /build/android
parent4bf7283e0b24061f5c254d0c443198b2346bfe4a (diff)
downloadchromium_src-7cd58be7b084710c7785cd856fd18e04c17c390a.zip
chromium_src-7cd58be7b084710c7785cd856fd18e04c17c390a.tar.gz
chromium_src-7cd58be7b084710c7785cd856fd18e04c17c390a.tar.bz2
[Android] Workaround of an android platform bug.
On some Android devices (e.g., Sony Xperia), package manager may fail to extract native libraries when updating Chrome. The change tries alleviate the situation by: 1) name libchrome with version number; 2) when failed to load library, try to extract native libraies and load them. BUG=311644 Review URL: https://codereview.chromium.org/200753002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@258546 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/android')
-rwxr-xr-xbuild/android/gyp/delete_files.py45
1 files changed, 45 insertions, 0 deletions
diff --git a/build/android/gyp/delete_files.py b/build/android/gyp/delete_files.py
new file mode 100755
index 0000000..802824d
--- /dev/null
+++ b/build/android/gyp/delete_files.py
@@ -0,0 +1,45 @@
+#!/usr/bin/env python
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Delete files in directories matching a pattern.
+"""
+
+import glob
+import optparse
+import os
+import sys
+
+def main():
+ parser = optparse.OptionParser()
+ parser.add_option(
+ '--pattern',
+ help='Pattern for matching Files to delete.')
+ parser.add_option(
+ '--keep',
+ help='Files to keep even if they matches the pattern.')
+
+ options, args = parser.parse_args()
+
+ if not options.pattern or not args:
+ print 'No --pattern or target directories given'
+ return
+
+ for target_dir in args:
+ target_pattern = os.path.join(target_dir, options.pattern)
+ matching_files = glob.glob(target_pattern)
+
+ keep_pattern = os.path.join(target_dir, options.keep)
+ files_to_keep = glob.glob(keep_pattern)
+
+ for target_file in matching_files:
+ if target_file in files_to_keep:
+ continue
+
+ if os.path.isfile(target_file):
+ os.remove(target_file)
+
+if __name__ == '__main__':
+ sys.exit(main())
+