chrome/installer/mac/signing/pipeline.py
def _productbuild_distribution_path(app_paths, pkg_paths, dist_config,
                                    component_pkg_path):
    """Creates a distribution XML file for use by `productbuild`. This copies
    the OS and architecture requirements from the copy of Chrome being packaged.

    Args:
        app_paths: A |model.Paths| object for the app.
        pkg_paths: A |model.Paths| object for the pkg files.
        dist_config: The |config.CodeSignConfig| object.
        component_pkg_path: The path to the existing component .pkg file.

    Returns:
        The path to the distribution file.
    """
    distribution_path = os.path.join(pkg_paths.work,
                                     '{}.dist'.format(dist_config.app_product))

    app_binary_path = os.path.join(app_paths.work, dist_config.app_dir,
                                   'Contents', 'MacOS', dist_config.app_product)
    app_plist_path = os.path.join(app_paths.work, dist_config.app_dir,
                                  'Contents', 'Info.plist')
    with commands.PlistContext(app_plist_path) as app_plist:
        # For now, restrict installation to only the boot volume (the <domains/>
        # tag) to simplify the Keystone installation.
        distribution_xml = """<?xml version="1.0" encoding="utf-8"?>
<installer-gui-script minSpecVersion="2">

    <!-- Top-level info about the distribution. -->
    <title>{app_product}</title>
    <options customize="never" require-scripts="false" hostArchitectures="{host_architectures}"/>
    <domains enable_anywhere="false" enable_currentUserHome="false" enable_localSystem="true"/>
    <volume-check>
        <allowed-os-versions>
            <os-version min="{minimum_system}"/>
        </allowed-os-versions>
    </volume-check>

    <!-- The hierarchy of installation choices. -->
    <choices-outline>
        <line choice="default">
            <line choice="{bundle_id}"/>
        </line>
    </choices-outline>

    <!-- The individual choices. -->
    <choice id="default"/>
    <choice id="{bundle_id}" visible="false" title="{app_product}">
        <pkg-ref id="{bundle_id}">
            <must-close>
                <app id="{bundle_id}"/>
            </must-close>
        </pkg-ref>
    </choice>

    <!-- The lone component package. -->
    <pkg-ref id="{bundle_id}" version="{version}" onConclusion="none">{component_pkg_filename}</pkg-ref>

</installer-gui-script>""".format(
            app_product=dist_config.app_product,
            bundle_id=dist_config.base_bundle_id,
            host_architectures=_binary_architectures(app_binary_path),
            minimum_system=app_plist['LSMinimumSystemVersion'],
            component_pkg_filename=os.path.basename(component_pkg_path),
            version=dist_config.version)

        commands.write_file(distribution_path, distribution_xml)

    return distribution_path
Creates a distribution XML file for use by `productbuild`. This copies
    the OS and architecture requirements from the copy of Chrome being packaged.

    Args:
        app_paths: A |model.Paths| object for the app.
        pkg_paths: A |model.Paths| object for the pkg files.
        dist_config: The |config.CodeSignConfig| object.
        component_pkg_path: The path to the existing component .pkg file.

    Returns:
        The path to the distribution file.
    
Creates a distribution XML file for use by `productbuild`. This copies
the OS and architecture requirements from the copy of Chrome being packaged.
Creates a distribution XML file for use by ` productbuild ` . This copies the OS and architecture requirements from the copy of Chrome being packaged .
def _productbuild_distribution_path(app_paths, pkg_paths, dist_config,
                                    component_pkg_path):
    distribution_path = os.path.join(pkg_paths.work,
                                     '{}.dist'.format(dist_config.app_product))
    app_binary_path = os.path.join(app_paths.work, dist_config.app_dir,
                                   'Contents', 'MacOS', dist_config.app_product)
    app_plist_path = os.path.join(app_paths.work, dist_config.app_dir,
                                  'Contents', 'Info.plist')
    with commands.PlistContext(app_plist_path) as app_plist:
        distribution_xml = """<?xml version="1.0" encoding="utf-8"?>
<installer-gui-script minSpecVersion="2">
    <!-- Top-level info about the distribution. -->
    <title>{app_product}</title>
    <options customize="never" require-scripts="false" hostArchitectures="{host_architectures}"/>
    <domains enable_anywhere="false" enable_currentUserHome="false" enable_localSystem="true"/>
    <volume-check>
        <allowed-os-versions>
            <os-version min="{minimum_system}"/>
        </allowed-os-versions>
    </volume-check>
    <!-- The hierarchy of installation choices. -->
    <choices-outline>
        <line choice="default">
            <line choice="{bundle_id}"/>
        </line>
    </choices-outline>
    <!-- The individual choices. -->
    <choice id="default"/>
    <choice id="{bundle_id}" visible="false" title="{app_product}">
        <pkg-ref id="{bundle_id}">
            <must-close>
                <app id="{bundle_id}"/>
            </must-close>
        </pkg-ref>
    </choice>
    <!-- The lone component package. -->
    <pkg-ref id="{bundle_id}" version="{version}" onConclusion="none">{component_pkg_filename}</pkg-ref>
</installer-gui-script>""".format(
            app_product=dist_config.app_product,
            bundle_id=dist_config.base_bundle_id,
            host_architectures=_binary_architectures(app_binary_path),
            minimum_system=app_plist['LSMinimumSystemVersion'],
            component_pkg_filename=os.path.basename(component_pkg_path),
            version=dist_config.version)
        commands.write_file(distribution_path, distribution_xml)
    return distribution_path
def _productbuild_distribution_path ( app_paths , pkg_paths , dist_config , component_pkg_path ) : distribution_path = os . path . join ( pkg_paths . work , '{}.dist' . format ( dist_config . app_product ) ) app_binary_path = os . path . join ( app_paths . work , dist_config . app_dir , 'Contents' , 'MacOS' , dist_config . app_product ) app_plist_path = os . path . join ( app_paths . work , dist_config . app_dir , 'Contents' , 'Info.plist' ) with commands . PlistContext ( app_plist_path ) as app_plist : distribution_xml = """<?xml version="1.0" encoding="utf-8"?>
<installer-gui-script minSpecVersion="2">

    <!-- Top-level info about the distribution. -->
    <title>{app_product}</title>
    <options customize="never" require-scripts="false" hostArchitectures="{host_architectures}"/>
    <domains enable_anywhere="false" enable_currentUserHome="false" enable_localSystem="true"/>
    <volume-check>
        <allowed-os-versions>
            <os-version min="{minimum_system}"/>
        </allowed-os-versions>
    </volume-check>

    <!-- The hierarchy of installation choices. -->
    <choices-outline>
        <line choice="default">
            <line choice="{bundle_id}"/>
        </line>
    </choices-outline>

    <!-- The individual choices. -->
    <choice id="default"/>
    <choice id="{bundle_id}" visible="false" title="{app_product}">
        <pkg-ref id="{bundle_id}">
            <must-close>
                <app id="{bundle_id}"/>
            </must-close>
        </pkg-ref>
    </choice>

    <!-- The lone component package. -->
    <pkg-ref id="{bundle_id}" version="{version}" onConclusion="none">{component_pkg_filename}</pkg-ref>

</installer-gui-script>""" . format ( app_product = dist_config . app_product , bundle_id = dist_config . base_bundle_id , host_architectures = _binary_architectures ( app_binary_path ) , minimum_system = app_plist [ 'LSMinimumSystemVersion' ] , component_pkg_filename = os . path . basename ( component_pkg_path ) , version = dist_config . version ) commands . write_file ( distribution_path , distribution_xml ) return distribution_path
Creates a distribution XML file for use by `productbuild`.
Creates a distribution XML file for use by ` productbuild ` .
"""Creates a distribution XML file for use by `productbuild`. This copies
    the OS and architecture requirements from the copy of Chrome being packaged.

    Args:
        app_paths: A |model.Paths| object for the app.
        pkg_paths: A |model.Paths| object for the pkg files.
        dist_config: The |config.CodeSignConfig| object.
        component_pkg_path: The path to the existing component .pkg file.

    Returns:
        The path to the distribution file.
    """ # For now, restrict installation to only the boot volume (the <domains/> # tag) to simplify the Keystone installation.
The path to the distribution file.
The path to the distribution file .
app_paths
A |model.Paths| object for the app.
A |model . Paths| object for the app .
pkg_paths
A |model.Paths| object for the pkg files.
A |model . Paths| object for the pkg files .
dist_config
The |config.CodeSignConfig| object.
The |config . CodeSignConfig| object .
component_pkg_path
The path to the existing component .pkg file.
The path to the existing component . pkg file .