~mozillateam/firefox/firefox-beta.xenial

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/python3

import sys
import json
import os
import zipfile

if __name__ == '__main__':
    if not len(sys.argv) == 2:
        print("Must specify an xpi", file=sys.stderr)
        exit(1)

    json_doc = json.loads(zipfile.ZipFile(sys.argv[1]).open('manifest.json').read().decode('utf-8').strip())
    gecko_id = json_doc["browser_specific_settings"]["gecko"]["id"]

    assert gecko_id
    print("%s" % gecko_id)
    exit(0)