Skip to content

Commit

Permalink
dual compat
Browse files Browse the repository at this point in the history
  • Loading branch information
retorquere committed Mar 22, 2024
1 parent 6381c31 commit d95f1c7
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions setup/patch-compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
import json
import packaging.version
import subprocess
import shutil

print('patching support versions')
install = minidom.parse('build/install.rdf')
ta = install.getElementsByTagNameNS('*', 'targetApplication')[0]

Expand All @@ -28,10 +30,10 @@ def max_version(v1, v2):
listed = node.firstChild.nodeValue
supported = max_version(listed, version)
if supported == listed:
print('minimum overlay', client, 'version', supported)
print(' minimum overlay', client, 'version', supported)
else:
node.firstChild.replaceWholeText(supported)
print('minimum overlay', client, 'bumped from', listed, 'to', supported)
print(' minimum overlay', client, 'bumped from', listed, 'to', supported)
with open('build/install.rdf', 'w') as f:
install.writexml(f)

Expand All @@ -48,9 +50,17 @@ def max_version(v1, v2):
supported = '8.0'

if supported == listed:
print('minimum bootstrapped', client, 'version', supported)
print(' minimum bootstrapped', client, 'version', supported)
else:
manifest['applications'][client]['strict_min_version'] = supported
print('minimum bootstrapped', client, 'bumped from', listed, 'to', supported)
print(' minimum bootstrapped', client, 'bumped from', listed, 'to', supported)
with open('build/manifest.json', 'w') as f:
json.dump(manifest, f, indent=' ')

print(' updates.json')
with open('gen/updates.json') as f:
updates = json.load(f)
updates['addons']['[email protected]']['updates'][0]['applications']['gecko'] = { "strict_min_version": "60.9" }
with open('gen/updates.json', 'w') as f:
json.dump(updates, f, indent=' ')
shutil.copyfile('gen/updates.json', 'gen/update.rdf')

0 comments on commit d95f1c7

Please sign in to comment.