1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- # HG changeset patch
- # User Mac Tosh <mac198442@yahoo.com>
- # Date 1672226897 0
- Bug 1807834 - Respect DMG_TOOL, HFS_TOOL and MKFSHFS environment variables.
- diff --git a/python/mozbuild/mozbuild/action/make_dmg.py b/python/mozbuild/mozbuild/action/make_dmg.py
- --- a/python/mozbuild/mozbuild/action/make_dmg.py
- +++ b/python/mozbuild/mozbuild/action/make_dmg.py
- @@ -1,15 +1,18 @@
- # This Source Code Form is subject to the terms of the Mozilla Public
- # License, v. 2.0. If a copy of the MPL was not distributed with this
- # file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
- import argparse
- import platform
- import sys
- +
- +import buildconfig
- +
- from pathlib import Path
-
- from mozpack import dmg
-
- from mozbuild.bootstrap import bootstrap_toolchain
- from mozbuild.repackaging.application_ini import get_application_ini_value
-
- is_linux = platform.system() == "Linux"
- @@ -41,19 +44,25 @@ def main(args):
- if options.volume_name:
- volume_name = options.volume_name
- else:
- volume_name = get_application_ini_value(
- options.inpath, "App", "CodeName", fallback="Name"
- )
-
- # Resolve required tools
- - dmg_tool = bootstrap_toolchain("dmg/dmg")
- - hfs_tool = bootstrap_toolchain("dmg/hfsplus")
- - mkfshfs_tool = bootstrap_toolchain("hfsplus/newfs_hfs")
- + dmg_tool = buildconfig.substs.get("DMG_TOOL")
- + if not dmg_tool:
- + dmg_tool = bootstrap_toolchain("dmg/dmg")
- + hfs_tool = buildconfig.substs.get("HFS_TOOL")
- + if not hfs_tool:
- + hfs_tool = bootstrap_toolchain("dmg/hfsplus")
- + mkfshfs_tool= buildconfig.substs.get("MKFSHFS")
- + if not mkfshfs_tool:
- + mkfshfs_tool = bootstrap_toolchain("hfsplus/newfs_hfs")
-
- dmg.create_dmg(
- source_directory=Path(options.inpath),
- output_dmg=Path(options.dmgfile),
- volume_name=volume_name,
- extra_files=extra_files,
- dmg_tool=dmg_tool,
- hfs_tool=hfs_tool,
|