Index: packager.py |
diff --git a/packager.py b/packager.py |
index 49f0af2b8826dc8c07f0e150c6bd1c393c7eaf20..06ea732acb71191ef28a0ac2ac27220d56e7d85b 100644 |
--- a/packager.py |
+++ b/packager.py |
@@ -16,11 +16,32 @@ from chainedconfigparser import ChainedConfigParser |
import buildtools |
+EXTENSIONS = { |
+ 'edge': 'appx', |
+ 'gecko': 'xpi', |
+ 'chrome': {'unsigned': 'zip', 'signed': 'crx'}, |
+} |
+ |
def getDefaultFileName(metadata, version, ext): |
return '%s-%s.%s' % (metadata.get('general', 'basename'), version, ext) |
+def get_extension(platform, has_key_file=False): |
+ extension = EXTENSIONS[platform] |
+ |
+ try: |
+ if has_key_file: |
+ key = 'signed' |
+ else: |
+ key = 'unsigned' |
+ extension = extension[key] |
+ except (KeyError, TypeError): |
+ pass |
+ |
+ return extension |
+ |
+ |
def getMetadataPath(baseDir, type): |
return os.path.join(baseDir, 'metadata.%s' % type) |