fune/toolkit/mozapps/installer/strip.py
Mike Hommey dbdbf959b8 Bug 1335309 - Add explicit find_executables arguments to every use of FileFinder. r=mshal
And make it an error not to give it. While the default is True, we do
pass a value of False wherever it makes sense, which happens to be, in
most places.

This is an intermediate step to flip the default from True to False,
ensuring that we don't unwantedly switch some calls to False.

--HG--
extra : rebase_source : 432e03f032fef378af482581685583262e5d2661
2017-01-31 13:01:34 +09:00

23 lines
763 B
Python

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
'''
Strip all files that can be stripped in the given directory.
'''
import sys
from mozpack.files import FileFinder
from mozpack.copier import FileCopier
def strip(dir):
copier = FileCopier()
# The FileFinder will give use ExecutableFile instances for files
# that can be stripped, and copying ExecutableFiles defaults to
# stripping them unless buildconfig.substs['PKG_SKIP_STRIP'] is set.
for p, f in FileFinder(dir, find_executables=True):
copier.add(p, f)
copier.copy(dir)
if __name__ == '__main__':
strip(sys.argv[1])