1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 # Generate updater.ini by doing some light substitution on the localized updater.ini input,
6 # and appending the contents of updater_ini_append on Windows.
15 def main(output
, ini
, ini_append
=None, locale
=None):
16 fixup_re
= re
.compile("^(Info|Title)Text=")
17 # Input INI is always utf-8.
18 with codecs
.open(ini
, "rb", "utf_8") as f
:
20 line
= fixup_re
.sub(r
"\1=", line
)
22 "%MOZ_APP_DISPLAYNAME%", buildconfig
.substs
["MOZ_APP_DISPLAYNAME"]
25 if ini_append
and buildconfig
.substs
["OS_TARGET"] == "WINNT":
26 # Also append the contents of `ini_append`.
27 with codecs
.open(ini_append
, "rb", "utf_8") as f
:
28 shutil
.copyfileobj(f
, output
)