1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/toolkit/mozapps/installer/strip.py Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,23 @@ 1.4 +# This Source Code Form is subject to the terms of the Mozilla Public 1.5 +# License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 +# file, You can obtain one at http://mozilla.org/MPL/2.0/. 1.7 + 1.8 +''' 1.9 +Strip all files that can be stripped in the given directory. 1.10 +''' 1.11 + 1.12 +import sys 1.13 +from mozpack.files import FileFinder 1.14 +from mozpack.copier import FileCopier 1.15 + 1.16 +def strip(dir): 1.17 + copier = FileCopier() 1.18 + # The FileFinder will give use ExecutableFile instances for files 1.19 + # that can be stripped, and copying ExecutableFiles defaults to 1.20 + # stripping them unless buildconfig.substs['PKG_SKIP_STRIP'] is set. 1.21 + for p, f in FileFinder(dir): 1.22 + copier.add(p, f) 1.23 + copier.copy(dir) 1.24 + 1.25 +if __name__ == '__main__': 1.26 + strip(sys.argv[1])