~jbicha/firefox/update-dependencies

« back to all changes in this revision

Viewing changes to debian/build/xpi-id.py

  • Committer: Rico Tzschichholz
  • Date: 2017-10-10 13:25:09 UTC
  • Revision ID: ricotz@ubuntu.com-20171010132509-f3ec1g57jwgs9g8e
* New upstream release from the beta channel (FIREFOX_57_0b7_BUILD1)
* Install watermark.svg from the onbording extension as symbolic icon
  - debian/firefox.install.in

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/python
2
2
 
3
3
import sys
4
 
import json
 
4
import xml.dom.minidom
5
5
import os
6
6
import zipfile
7
7
 
10
10
        print >> sys.stderr, "Must specify an xpi"
11
11
        exit(1)
12
12
 
13
 
    json_doc = json.loads(zipfile.ZipFile(sys.argv[1]).open('manifest.json').read().strip())
14
 
    gecko_id = json_doc["applications"]["gecko"]["id"]
15
 
 
16
 
    assert gecko_id
17
 
    print "%s" % gecko_id
 
13
    dom_doc = xml.dom.minidom.parseString(zipfile.ZipFile(sys.argv[1]).open('install.rdf').read().strip())
 
14
 
 
15
    try:
 
16
        attr = dom_doc.getElementsByTagName('RDF:Description')[0].attributes['em:id']
 
17
    except IndexError:
 
18
        attr = dom_doc.getElementsByTagName('Description')[0].attributes['em:id']
 
19
 
 
20
    assert attr.value
 
21
    print "%s" % attr.value
18
22
    exit(0)