Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Side by Side Diff: tools/export_tarball/export_tarball.py

Issue 8678023: Fix python scripts in src/tools/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/env python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """ 6 """
7 This tool creates a tarball with all the sources, but without .svn directories. 7 This tool creates a tarball with all the sources, but without .svn directories.
8 8
9 It can also remove files which are not strictly required for build, so that 9 It can also remove files which are not strictly required for build, so that
10 the resulting tarball can be reasonably small (last time it was ~110 MB). 10 the resulting tarball can be reasonably small (last time it was ~110 MB).
11 11
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 'third_party/yasm/source/patched-yasm/modules/objfmts/rdf/tests', 49 'third_party/yasm/source/patched-yasm/modules/objfmts/rdf/tests',
50 'third_party/yasm/source/patched-yasm/modules/objfmts/win32/tests', 50 'third_party/yasm/source/patched-yasm/modules/objfmts/win32/tests',
51 'third_party/yasm/source/patched-yasm/modules/objfmts/win64/tests', 51 'third_party/yasm/source/patched-yasm/modules/objfmts/win64/tests',
52 'third_party/yasm/source/patched-yasm/modules/objfmts/xdf/tests', 52 'third_party/yasm/source/patched-yasm/modules/objfmts/xdf/tests',
53 'third_party/WebKit/Source/JavaScriptCore/tests', 53 'third_party/WebKit/Source/JavaScriptCore/tests',
54 'third_party/WebKit/LayoutTests', 54 'third_party/WebKit/LayoutTests',
55 'v8/test', 55 'v8/test',
56 'webkit/data/layout_tests', 56 'webkit/data/layout_tests',
57 'webkit/tools/test/reference_build', 57 'webkit/tools/test/reference_build',
58 ) 58 )
59 59
Alexander Potapenko 2011/11/24 07:53:02 2 blank lines here and below
60 def GetSourceDirectory(): 60 def GetSourceDirectory():
61 return os.path.realpath( 61 return os.path.realpath(
62 os.path.join(os.path.dirname(__file__), '..', '..', '..', 'src')) 62 os.path.join(os.path.dirname(__file__), '..', '..', '..', 'src'))
63 63
64 # Workaround lack of the exclude parameter in add method in python-2.4. 64 # Workaround lack of the exclude parameter in add method in python-2.4.
65 # TODO(phajdan.jr): remove the workaround when it's not needed on the bot. 65 # TODO(phajdan.jr): remove the workaround when it's not needed on the bot.
66 class MyTarFile(tarfile.TarFile): 66 class MyTarFile(tarfile.TarFile):
67 def set_remove_nonessential_files(self, remove): 67 def set_remove_nonessential_files(self, remove):
68 self.__remove_nonessential_files = remove 68 self.__remove_nonessential_files = remove
69 69
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 archive.set_remove_nonessential_files(options.remove_nonessential_files) 104 archive.set_remove_nonessential_files(options.remove_nonessential_files)
105 try: 105 try:
106 archive.add(GetSourceDirectory(), arcname=output_basename) 106 archive.add(GetSourceDirectory(), arcname=output_basename)
107 finally: 107 finally:
108 archive.close() 108 archive.close()
109 109
110 return 0 110 return 0
111 111
112 if __name__ == "__main__": 112 if __name__ == "__main__":
113 sys.exit(main(sys.argv[1:])) 113 sys.exit(main(sys.argv[1:]))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698