mozbuild.repackaging package

Submodules

mozbuild.repackaging.application_ini module

mozbuild.repackaging.application_ini.get_application_ini_value(finder_or_application_directory, section, value, fallback=None)

Find string with given section and value in any application.ini under given directory or finder.

If string is not found and fallback is given, find string with given section and fallback instead.

Raises an Exception if no string is found.

mozbuild.repackaging.application_ini.get_application_ini_values(finder_or_application_directory, *args)

Find multiple strings for given section and value pairs. Additional args should be dictionaries with keys section, value, and optional fallback. Returns an iterable of strings, one for each dictionary provided.

fallback is treated as with get_application_ini_value.

Raises an Exception if any string is not found.

mozbuild.repackaging.deb module

exception mozbuild.repackaging.deb.HgServerError(msg)

Bases: Exception

Raised when Hg responds with an error code that is not 404 (i.e. when there is an outage)

exception mozbuild.repackaging.deb.NoDebPackageFound(deb_file_path)

Bases: Exception

Raised when no .deb is found after calling dpkg-buildpackage

mozbuild.repackaging.deb.repackage_deb(log, infile, output, template_dir, arch, version, build_number, release_product, release_type, fluent_localization, fluent_resource_loader)
mozbuild.repackaging.deb.repackage_deb_l10n(input_xpi_file, input_tar_file, output, template_dir, version, build_number, release_product)

mozbuild.repackaging.desktop_file module

exception mozbuild.repackaging.desktop_file.RemoteVCSError(msg)

Bases: Exception

Raised when vcs server (e.g., hg or git) responds with an error code that is not 404 (i.e. when there is an outage)

mozbuild.repackaging.desktop_file.generate_browser_desktop_entry(log, build_variables, release_product, release_type, fluent_localization, fluent_resource_loader)
mozbuild.repackaging.desktop_file.generate_browser_desktop_entry_file_text(log, build_variables, release_product, release_type, fluent_localization, fluent_resource_loader)

mozbuild.repackaging.dmg module

mozbuild.repackaging.dmg.repackage_dmg(infile, output, attribution_sentinel=None)

mozbuild.repackaging.installer module

mozbuild.repackaging.installer.repackage_installer(topsrcdir, tag, setupexe, package, output, package_name, sfx_stub, use_upx)

mozbuild.repackaging.mar module

mozbuild.repackaging.mar.repackage_mar(topsrcdir, package, mar, output, arch=None, mar_channel_id=None)

mozbuild.repackaging.msi module

mozbuild.repackaging.msi.repackage_msi(topsrcdir, wsx, version, locale, arch, setupexe, candle, light, output)
mozbuild.repackaging.msi.update_wsx(wfile, pvalues)

mozbuild.repackaging.msix module

Repackage ZIP archives (or directories) into MSIX App Packages.

# Known issues

  • The icons in the Start Menu have a solid colour tile behind them. I think this is an issue with plating.

mozbuild.repackaging.msix.find_sdk_tool(binary, log=None)
mozbuild.repackaging.msix.get_appconstants_sys_mjs_values(finder, *args)

Extract values, such as the display version like MOZ_APP_VERSION_DISPLAY: “…”;, from the omnijar. This allows to determine the beta number, like X.YbW, where the regular beta version is only X.Y. Takes a list of names and returns an iterator of the unique such value found for each name. Raises an exception if a name is not found or if multiple values are found.

mozbuild.repackaging.msix.get_branding(use_official, topsrcdir, build_app, finder, log=None)

Figure out which branding directory to use.

mozbuild.repackaging.msix.get_embedded_version(version, buildid)

Turn a display version into “dotted quad” notation.

N.b.: some parts of the MSIX packaging ecosystem require the final part of the dotted quad to be identically 0, so we enforce that here.

mozbuild.repackaging.msix.log_copy_result(log, elapsed, destdir, result)
mozbuild.repackaging.msix.repackage_msix(dir_or_package, topsrcdir, channel=None, distribution_dirs=[], version=None, vendor=None, displayname=None, app_name=None, identity=None, publisher=None, publisher_display_name='Mozilla Corporation', arch=None, output=None, force=False, log=None, verbose=False, makeappx=None)
mozbuild.repackaging.msix.sdk_tool_search_path()
mozbuild.repackaging.msix.sign_msix(output, force=False, log=None, verbose=False)

Sign an MSIX with a locally generated self-signed certificate.

mozbuild.repackaging.msix.unpack_msix(input_msix, output, log=None, verbose=False)

Unpack the given MSIX to the given output directory.

MSIX packages are ZIP files, but they are Zip64/version 4.5 ZIP files, so mozjar.py doesn’t yet handle. Unpack using unzip{.exe} for simplicity.

In addition, file names inside the MSIX package are URL quoted. URL unquote here.

mozbuild.repackaging.pkg module

mozbuild.repackaging.pkg.repackage_pkg(infile, output)

mozbuild.repackaging.snap module

mozbuild.repackaging.snap.missing_connections(app_name)

Parsing the output of snap connections e.g.,

$ snap connections firefox Interface Connecteur Prise Notes alsa firefox:alsa - - audio-playback firefox:audio-playback :audio-playback - audio-record firefox:audio-record :audio-record - avahi-observe firefox:avahi-observe :avahi-observe -

mozbuild.repackaging.snap.repackage_snap(log, srcdir, objdir, snapdir, snapcraft, appname, reponame='canonical/firefox-snap', branchname='nightly', arch='amd64', dry_run=False)
mozbuild.repackaging.snap.unpack_tarball(package, destdir)

mozbuild.repackaging.snapcraft_transform module

class mozbuild.repackaging.snapcraft_transform.SnapDesktopFile(log, appname, branchname)

Bases: object

repack()
class mozbuild.repackaging.snapcraft_transform.SnapcraftTransform(source_file, appname, version, buildno)

Bases: object

EXPECTED_PARTS = ['rust', 'cbindgen', 'clang', 'dump-syms', 'hunspell', 'wasi-sdk', 'nodejs', 'mozconfig', 'firefox', 'firefox-langpacks', 'launcher', 'distribution', 'ffmpeg', 'apikeys', 'debug-symbols']
PARTS_TO_KEEP = ['hunspell', 'firefox-langpacks', 'launcher', 'distribution', 'ffmpeg']
add_firefox_repack(removed)
assert_parts(snap)

Make sure we have the expected parts

change_name(name)
change_version(version, build)
keep_non_build_parts()
parse(inp)
repack()
mozbuild.repackaging.snapcraft_transform.repr_str(dumper, data)

Module contents