| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2012, 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 import hashlib | 7 import hashlib |
| 8 import imp | 8 import imp |
| 9 import os | 9 import os |
| 10 import subprocess | 10 import subprocess |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 # Functions for quering complete gs:// filepaths | 92 # Functions for quering complete gs:// filepaths |
| 93 | 93 |
| 94 def version_filepath(self, revision): | 94 def version_filepath(self, revision): |
| 95 return '%s/channels/%s/%s/%s/VERSION' % (self.bucket, self.channel, | 95 return '%s/channels/%s/%s/%s/VERSION' % (self.bucket, self.channel, |
| 96 self.release_type, revision) | 96 self.release_type, revision) |
| 97 | 97 |
| 98 def editor_zipfilepath(self, revision, system, arch): | 98 def editor_zipfilepath(self, revision, system, arch): |
| 99 return '/'.join([self.editor_directory(revision), | 99 return '/'.join([self.editor_directory(revision), |
| 100 self.editor_zipfilename(system, arch)]) | 100 self.editor_zipfilename(system, arch)]) |
| 101 | 101 |
| 102 def editor_installer_zipfilepath(self, revision, system, arch, extension): | 102 def editor_installer_filepath(self, revision, system, arch, extension): |
| 103 return '/'.join([self.editor_directory(revision), | 103 return '/'.join([self.editor_directory(revision), |
| 104 self.editor_installer_zipfilename(system, arch, extension)]) | 104 self.editor_installer_filename(system, arch, extension)]) |
| 105 | 105 |
| 106 def sdk_zipfilepath(self, revision, system, arch, mode): | 106 def sdk_zipfilepath(self, revision, system, arch, mode): |
| 107 return '/'.join([self.sdk_directory(revision), | 107 return '/'.join([self.sdk_directory(revision), |
| 108 self.sdk_zipfilename(system, arch, mode)]) | 108 self.sdk_zipfilename(system, arch, mode)]) |
| 109 | 109 |
| 110 def dartium_variant_zipfilepath(self, revision, name, system, arch, mode): | 110 def dartium_variant_zipfilepath(self, revision, name, system, arch, mode): |
| 111 return '/'.join([self.dartium_directory(revision), | 111 return '/'.join([self.dartium_directory(revision), |
| 112 self.dartium_variant_zipfilename(name, system, arch, mode)]) | 112 self.dartium_variant_zipfilename(name, system, arch, mode)]) |
| 113 | 113 |
| 114 def apidocs_zipfilepath(self, revision): | 114 def apidocs_zipfilepath(self, revision): |
| (...skipping 26 matching lines...) Expand all Loading... |
| 141 | 141 |
| 142 # Functions for quering filenames | 142 # Functions for quering filenames |
| 143 | 143 |
| 144 def apidocs_zipfilename(self): | 144 def apidocs_zipfilename(self): |
| 145 return 'dart-api-docs.zip' | 145 return 'dart-api-docs.zip' |
| 146 | 146 |
| 147 def editor_zipfilename(self, system, arch): | 147 def editor_zipfilename(self, system, arch): |
| 148 return 'darteditor-%s-%s.zip' % ( | 148 return 'darteditor-%s-%s.zip' % ( |
| 149 SYSTEM_RENAMES[system], ARCH_RENAMES[arch]) | 149 SYSTEM_RENAMES[system], ARCH_RENAMES[arch]) |
| 150 | 150 |
| 151 def editor_installer_zipfilename(self, system, arch, extension): | 151 def editor_installer_filename(self, system, arch, extension): |
| 152 assert extension in ['dmg'] | 152 assert extension in ['dmg', 'msi'] |
| 153 return 'darteditor-installer-%s-%s.%s' % ( | 153 return 'darteditor-installer-%s-%s.%s' % ( |
| 154 SYSTEM_RENAMES[system], ARCH_RENAMES[arch], extension) | 154 SYSTEM_RENAMES[system], ARCH_RENAMES[arch], extension) |
| 155 | 155 |
| 156 def sdk_zipfilename(self, system, arch, mode): | 156 def sdk_zipfilename(self, system, arch, mode): |
| 157 assert mode in Mode.ALL_MODES | 157 assert mode in Mode.ALL_MODES |
| 158 return 'dartsdk-%s-%s-%s.zip' % ( | 158 return 'dartsdk-%s-%s-%s.zip' % ( |
| 159 SYSTEM_RENAMES[system], ARCH_RENAMES[arch], mode) | 159 SYSTEM_RENAMES[system], ARCH_RENAMES[arch], mode) |
| 160 | 160 |
| 161 def dartium_variant_zipfilename(self, name, system, arch, mode): | 161 def dartium_variant_zipfilename(self, name, system, arch, mode): |
| 162 assert name in ['chromedriver', 'dartium', 'content_shell'] | 162 assert name in ['chromedriver', 'dartium', 'content_shell'] |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 if not mangled_filename: | 259 if not mangled_filename: |
| 260 mangled_filename = os.path.basename(filename) | 260 mangled_filename = os.path.basename(filename) |
| 261 | 261 |
| 262 checksum = CalculateChecksum(filename) | 262 checksum = CalculateChecksum(filename) |
| 263 checksum_filename = '%s.md5sum' % filename | 263 checksum_filename = '%s.md5sum' % filename |
| 264 | 264 |
| 265 with open(checksum_filename, 'w') as f: | 265 with open(checksum_filename, 'w') as f: |
| 266 f.write('%s *%s' % (checksum, mangled_filename)) | 266 f.write('%s *%s' % (checksum, mangled_filename)) |
| 267 | 267 |
| 268 return checksum_filename | 268 return checksum_filename |
| OLD | NEW |