Chromium Code Reviews| Index: components/policy/tools/remove_localized_app_restrictions.py |
| diff --git a/components/policy/tools/remove_localized_app_restrictions.py b/components/policy/tools/remove_localized_app_restrictions.py |
| new file mode 100755 |
| index 0000000000000000000000000000000000000000..7a560e53715802fc7eba3332853f8f387fa1410e |
| --- /dev/null |
| +++ b/components/policy/tools/remove_localized_app_restrictions.py |
| @@ -0,0 +1,26 @@ |
| +#!/usr/bin/env python |
| +# Copyright (c) 2015 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. |
| + |
| +'''python %prog resources_dir |
| + |
| +resources_dir specifies the root directory of the localized app restrictions |
|
Bernhard Bauer
2015/04/08 10:24:18
Remove one space before "app"
knn
2015/04/08 10:40:50
Done.
|
| +resources to purge''' |
| + |
| +import re |
| +import os |
| +import sys |
| + |
| +def main(resources_dir): |
| + match = re.compile('^values-.*-v21$') |
| + for dir in os.listdir(resources_dir): |
| + if match.search(dir): |
| + path = os.path.join(resources_dir, dir) |
| + os.remove(os.path.join(path, 'restriction_values.xml')) |
| + os.rmdir(path) |
|
Bernhard Bauer
2015/04/08 10:24:18
What happens if this fails?
knn
2015/04/08 10:40:50
The stamp file will not be written and build will
Bernhard Bauer
2015/04/08 12:36:17
What I meant to ask was, what happens if e.g. the
knn
2015/04/08 12:52:54
If the directory is not empty, we are packing junk
Bernhard Bauer
2015/04/08 12:58:53
Okay... I'm just worried that someone might rightf
|
| + open(os.path.join(resources_dir, 'remove_localized_resources.d.stamp'), 'w') |
| + return 0 |
| + |
| +if __name__ == '__main__': |
| + sys.exit(main(sys.argv[1])) |