OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
4 # for details. All rights reserved. Use of this source code is governed by a | 4 # for details. All rights reserved. Use of this source code is governed by a |
5 # BSD-style license that can be found in the LICENSE file. | 5 # BSD-style license that can be found in the LICENSE file. |
6 # | 6 # |
7 | 7 |
8 # Script to build a tarball of the Dart source. | 8 # Script to build a tarball of the Dart source. |
9 # | 9 # |
10 # The tarball includes all the source needed to build Dart. This | 10 # The tarball includes all the source needed to build Dart. This |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 105 |
106 def CreateTarball(): | 106 def CreateTarball(): |
107 global ignoredPaths # Used for adding the output directory. | 107 global ignoredPaths # Used for adding the output directory. |
108 # Generate the name of the tarfile | 108 # Generate the name of the tarfile |
109 version = utils.GetVersion() | 109 version = utils.GetVersion() |
110 global versiondir | 110 global versiondir |
111 versiondir = 'dart-%s' % version | 111 versiondir = 'dart-%s' % version |
112 tarname = '%s.tar.gz' % versiondir | 112 tarname = '%s.tar.gz' % versiondir |
113 debian_dir = 'tools/linux_dist_support/debian' | 113 debian_dir = 'tools/linux_dist_support/debian' |
114 # Create the tar file in the build directory. | 114 # Create the tar file in the build directory. |
115 tardir = join(DART_DIR, utils.GetBuildDir(HOST_OS, HOST_OS)) | 115 builddir = utils.GetBuildDir(HOST_OS, HOST_OS) |
116 # Don't include the build directory in the tarball. | 116 tardir = join(DART_DIR, builddir) |
117 ignoredPaths.append(tardir) | 117 # Don't include the build directory in the tarball (ignored paths |
| 118 # are relative to DART_DIR). |
| 119 ignoredPaths.append(builddir) |
118 if not exists(tardir): | 120 if not exists(tardir): |
119 makedirs(tardir) | 121 makedirs(tardir) |
120 tarfilename = join(tardir, tarname) | 122 tarfilename = join(tardir, tarname) |
121 print 'Creating tarball: %s' % tarfilename | 123 print 'Creating tarball: %s' % tarfilename |
122 with tarfile.open(tarfilename, mode='w:gz') as tar: | 124 with tarfile.open(tarfilename, mode='w:gz') as tar: |
123 for f in listdir(DART_DIR): | 125 for f in listdir(DART_DIR): |
124 tar.add(join(DART_DIR, f), filter=Filter) | 126 tar.add(join(DART_DIR, f), filter=Filter) |
125 for f in listdir(join(DART_DIR, debian_dir)): | 127 for f in listdir(join(DART_DIR, debian_dir)): |
126 tar.add(join(DART_DIR, debian_dir, f), | 128 tar.add(join(DART_DIR, debian_dir, f), |
127 arcname='%s/debian/%s' % (versiondir, f)) | 129 arcname='%s/debian/%s' % (versiondir, f)) |
(...skipping 24 matching lines...) Expand all Loading... |
152 parser = BuildOptions() | 154 parser = BuildOptions() |
153 (options, args) = parser.parse_args() | 155 (options, args) = parser.parse_args() |
154 if options.verbose: | 156 if options.verbose: |
155 global verbose | 157 global verbose |
156 verbose = True | 158 verbose = True |
157 | 159 |
158 CreateTarball() | 160 CreateTarball() |
159 | 161 |
160 if __name__ == '__main__': | 162 if __name__ == '__main__': |
161 sys.exit(Main()) | 163 sys.exit(Main()) |
OLD | NEW |