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