chrome/installer/mac/signing/pipeline.py
def sign_all(orig_paths,
             config,
             disable_packaging=False,
             do_notarization=True,
             skip_brands=[]):
    """For each distribution in |config|, performs customization, signing, and
    DMG packaging and places the resulting signed DMG in |orig_paths.output|.
    The |paths.input| must contain the products to customize and sign.

    Args:
        orig_paths: A |model.Paths| object.
        config: The |config.CodeSignConfig| object.
        disable_packaging: Whether all packaging is disabled. If True, the
            unpackaged signed app bundle will be copied to |paths.output|. If
            False, the packaging specified in the distribution will be
            performed.
        do_notarization: If True, the signed application bundle will be sent for
            notarization by Apple. The resulting notarization ticket will then
            be stapled. If |package_dmg| is also True, the stapled application
            will be packaged in the DMG and then the DMG itself will be
            notarized and stapled.
        skip_brands: A list of brand code strings. If a distribution has a brand
            code in this list, that distribution will be skipped.
    """
    with commands.WorkDirectory(orig_paths) as notary_paths:
        # First, sign all the distributions and optionally submit the
        # notarization requests.
        uuids_to_config = {}
        signed_frameworks = {}
        created_app_bundles = set()
        for dist in config.distributions:
            if dist.branding_code in skip_brands:
                continue

            with commands.WorkDirectory(orig_paths) as paths:
                dist_config = dist.to_config(config)
                do_packaging = (dist.package_as_dmg or
                                dist.package_as_pkg) and not disable_packaging

                # If not packaging and not notarizing, then simply drop the
                # signed bundle in the output directory when done signing.
                if not do_packaging and not do_notarization:
                    dest_dir = paths.output
                else:
                    dest_dir = notary_paths.work

                dest_dir = os.path.join(dest_dir,
                                        _intermediate_work_dir_name(dist))

                # Different distributions might share the same underlying app
                # bundle, and if they do, then the _intermediate_work_dir_name
                # function will return the same value. Skip creating another app
                # bundle if that is the case.
                if dest_dir in created_app_bundles:
                    continue
                created_app_bundles.add(dest_dir)

                _customize_and_sign_chrome(paths, dist_config, dest_dir,
                                           signed_frameworks)

                # If the build products are to be notarized, ZIP the app bundle
                # and submit it for notarization.
                if do_notarization:
                    zip_file = os.path.join(
                        notary_paths.work,
                        dist_config.packaging_basename + '.zip')
                    commands.run_command([
                        'zip', '--recurse-paths', '--symlinks', '--quiet',
                        zip_file, dist_config.app_dir
                    ],
                                         cwd=dest_dir)
                    uuid = notarize.submit(zip_file, dist_config)
                    uuids_to_config[uuid] = dist_config

        # Wait for app notarization results to come back, stapling as they do.
        if do_notarization:
            for result in notarize.wait_for_results(uuids_to_config.keys(),
                                                    config):
                dist_config = uuids_to_config[result]
                dest_dir = os.path.join(
                    notary_paths.work,
                    _intermediate_work_dir_name(dist_config.distribution))
                _staple_chrome(notary_paths.replace_work(dest_dir), dist_config)

        # After all apps are optionally notarized, package as required.
        if not disable_packaging:
            uuids_to_package_path = {}
            for dist in config.distributions:
                if dist.branding_code in skip_brands:
                    continue

                dist_config = dist.to_config(config)
                paths = orig_paths.replace_work(
                    os.path.join(
                        notary_paths.work,
                        _intermediate_work_dir_name(dist_config.distribution)))

                if dist.inflation_kilobytes:
                    inflation_path = os.path.join(
                        paths.packaging_dir(config), 'inflation.bin')
                    commands.run_command([
                        'dd', 'if=/dev/urandom', 'of=' + inflation_path,
                        'bs=1000', 'count={}'.format(dist.inflation_kilobytes)
                    ])

                if dist.package_as_dmg:
                    dmg_path = _package_and_sign_dmg(paths, dist_config)

                    if do_notarization:
                        uuid = notarize.submit(dmg_path, dist_config)
                        uuids_to_package_path[uuid] = dmg_path

                if dist.package_as_pkg:
                    pkg_path = _package_and_sign_pkg(paths, dist_config)

                    if do_notarization:
                        uuid = notarize.submit(pkg_path, dist_config)
                        uuids_to_package_path[uuid] = pkg_path

            # Wait for packaging notarization results to come back, stapling as
            # they do.
            if do_notarization:
                for result in notarize.wait_for_results(
                        uuids_to_package_path.keys(), config):
                    package_path = uuids_to_package_path[result]
                    notarize.staple(package_path)

    _package_installer_tools(orig_paths, config)
For each distribution in |config|, performs customization, signing, and
    DMG packaging and places the resulting signed DMG in |orig_paths.output|.
    The |paths.input| must contain the products to customize and sign.

    Args:
        orig_paths: A |model.Paths| object.
        config: The |config.CodeSignConfig| object.
        disable_packaging: Whether all packaging is disabled. If True, the
            unpackaged signed app bundle will be copied to |paths.output|. If
            False, the packaging specified in the distribution will be
            performed.
        do_notarization: If True, the signed application bundle will be sent for
            notarization by Apple. The resulting notarization ticket will then
            be stapled. If |package_dmg| is also True, the stapled application
            will be packaged in the DMG and then the DMG itself will be
            notarized and stapled.
        skip_brands: A list of brand code strings. If a distribution has a brand
            code in this list, that distribution will be skipped.
    
For each distribution in |config|, performs customization, signing, and
DMG packaging and places the resulting signed DMG in |orig_paths.output|.
The |paths.input| must contain the products to customize and sign.
For each distribution in |config| performs customization signing and DMG packaging and places the resulting signed DMG in |orig_paths . output| . The |paths . input| must contain the products to customize and sign .
def sign_all(orig_paths,
             config,
             disable_packaging=False,
             do_notarization=True,
             skip_brands=[]):
    with commands.WorkDirectory(orig_paths) as notary_paths:
        uuids_to_config = {}
        signed_frameworks = {}
        created_app_bundles = set()
        for dist in config.distributions:
            if dist.branding_code in skip_brands:
                continue
            with commands.WorkDirectory(orig_paths) as paths:
                dist_config = dist.to_config(config)
                do_packaging = (dist.package_as_dmg or
                                dist.package_as_pkg) and not disable_packaging
                if not do_packaging and not do_notarization:
                    dest_dir = paths.output
                else:
                    dest_dir = notary_paths.work
                dest_dir = os.path.join(dest_dir,
                                        _intermediate_work_dir_name(dist))
                if dest_dir in created_app_bundles:
                    continue
                created_app_bundles.add(dest_dir)
                _customize_and_sign_chrome(paths, dist_config, dest_dir,
                                           signed_frameworks)
                if do_notarization:
                    zip_file = os.path.join(
                        notary_paths.work,
                        dist_config.packaging_basename + '.zip')
                    commands.run_command([
                        'zip', '--recurse-paths', '--symlinks', '--quiet',
                        zip_file, dist_config.app_dir
                    ],
                                         cwd=dest_dir)
                    uuid = notarize.submit(zip_file, dist_config)
                    uuids_to_config[uuid] = dist_config
        if do_notarization:
            for result in notarize.wait_for_results(uuids_to_config.keys(),
                                                    config):
                dist_config = uuids_to_config[result]
                dest_dir = os.path.join(
                    notary_paths.work,
                    _intermediate_work_dir_name(dist_config.distribution))
                _staple_chrome(notary_paths.replace_work(dest_dir), dist_config)
        if not disable_packaging:
            uuids_to_package_path = {}
            for dist in config.distributions:
                if dist.branding_code in skip_brands:
                    continue
                dist_config = dist.to_config(config)
                paths = orig_paths.replace_work(
                    os.path.join(
                        notary_paths.work,
                        _intermediate_work_dir_name(dist_config.distribution)))
                if dist.inflation_kilobytes:
                    inflation_path = os.path.join(
                        paths.packaging_dir(config), 'inflation.bin')
                    commands.run_command([
                        'dd', 'if=/dev/urandom', 'of=' + inflation_path,
                        'bs=1000', 'count={}'.format(dist.inflation_kilobytes)
                    ])
                if dist.package_as_dmg:
                    dmg_path = _package_and_sign_dmg(paths, dist_config)
                    if do_notarization:
                        uuid = notarize.submit(dmg_path, dist_config)
                        uuids_to_package_path[uuid] = dmg_path
                if dist.package_as_pkg:
                    pkg_path = _package_and_sign_pkg(paths, dist_config)
                    if do_notarization:
                        uuid = notarize.submit(pkg_path, dist_config)
                        uuids_to_package_path[uuid] = pkg_path
            if do_notarization:
                for result in notarize.wait_for_results(
                        uuids_to_package_path.keys(), config):
                    package_path = uuids_to_package_path[result]
                    notarize.staple(package_path)
    _package_installer_tools(orig_paths, config)
def sign_all ( orig_paths , config , disable_packaging = False , do_notarization = True , skip_brands = [ ] ) : with commands . WorkDirectory ( orig_paths ) as notary_paths : uuids_to_config = { } signed_frameworks = { } created_app_bundles = set ( ) for dist in config . distributions : if dist . branding_code in skip_brands : continue with commands . WorkDirectory ( orig_paths ) as paths : dist_config = dist . to_config ( config ) do_packaging = ( dist . package_as_dmg or dist . package_as_pkg ) and not disable_packaging if not do_packaging and not do_notarization : dest_dir = paths . output else : dest_dir = notary_paths . work dest_dir = os . path . join ( dest_dir , _intermediate_work_dir_name ( dist ) ) if dest_dir in created_app_bundles : continue created_app_bundles . add ( dest_dir ) _customize_and_sign_chrome ( paths , dist_config , dest_dir , signed_frameworks ) if do_notarization : zip_file = os . path . join ( notary_paths . work , dist_config . packaging_basename + '.zip' ) commands . run_command ( [ 'zip' , '--recurse-paths' , '--symlinks' , '--quiet' , zip_file , dist_config . app_dir ] , cwd = dest_dir ) uuid = notarize . submit ( zip_file , dist_config ) uuids_to_config [ uuid ] = dist_config if do_notarization : for result in notarize . wait_for_results ( uuids_to_config . keys ( ) , config ) : dist_config = uuids_to_config [ result ] dest_dir = os . path . join ( notary_paths . work , _intermediate_work_dir_name ( dist_config . distribution ) ) _staple_chrome ( notary_paths . replace_work ( dest_dir ) , dist_config ) if not disable_packaging : uuids_to_package_path = { } for dist in config . distributions : if dist . branding_code in skip_brands : continue dist_config = dist . to_config ( config ) paths = orig_paths . replace_work ( os . path . join ( notary_paths . work , _intermediate_work_dir_name ( dist_config . distribution ) ) ) if dist . inflation_kilobytes : inflation_path = os . path . join ( paths . packaging_dir ( config ) , 'inflation.bin' ) commands . run_command ( [ 'dd' , 'if=/dev/urandom' , 'of=' + inflation_path , 'bs=1000' , 'count={}' . format ( dist . inflation_kilobytes ) ] ) if dist . package_as_dmg : dmg_path = _package_and_sign_dmg ( paths , dist_config ) if do_notarization : uuid = notarize . submit ( dmg_path , dist_config ) uuids_to_package_path [ uuid ] = dmg_path if dist . package_as_pkg : pkg_path = _package_and_sign_pkg ( paths , dist_config ) if do_notarization : uuid = notarize . submit ( pkg_path , dist_config ) uuids_to_package_path [ uuid ] = pkg_path if do_notarization : for result in notarize . wait_for_results ( uuids_to_package_path . keys ( ) , config ) : package_path = uuids_to_package_path [ result ] notarize . staple ( package_path ) _package_installer_tools ( orig_paths , config )
For each distribution in |config|, performs customization, signing, and
DMG packaging and places the resulting signed DMG in |orig_paths.output|.
For each distribution in |config| performs customization signing and DMG packaging and places the resulting signed DMG in |orig_paths . output| .
"""For each distribution in |config|, performs customization, signing, and
    DMG packaging and places the resulting signed DMG in |orig_paths.output|.
    The |paths.input| must contain the products to customize and sign.

    Args:
        orig_paths: A |model.Paths| object.
        config: The |config.CodeSignConfig| object.
        disable_packaging: Whether all packaging is disabled. If True, the
            unpackaged signed app bundle will be copied to |paths.output|. If
            False, the packaging specified in the distribution will be
            performed.
        do_notarization: If True, the signed application bundle will be sent for
            notarization by Apple. The resulting notarization ticket will then
            be stapled. If |package_dmg| is also True, the stapled application
            will be packaged in the DMG and then the DMG itself will be
            notarized and stapled.
        skip_brands: A list of brand code strings. If a distribution has a brand
            code in this list, that distribution will be skipped.
    """ # First, sign all the distributions and optionally submit the # notarization requests. # If not packaging and not notarizing, then simply drop the # signed bundle in the output directory when done signing. # Different distributions might share the same underlying app # bundle, and if they do, then the _intermediate_work_dir_name # function will return the same value. Skip creating another app # bundle if that is the case. # If the build products are to be notarized, ZIP the app bundle # and submit it for notarization. # Wait for app notarization results to come back, stapling as they do. # After all apps are optionally notarized, package as required. # Wait for packaging notarization results to come back, stapling as # they do.
orig_paths
A |model.Paths| object.
A |model . Paths| object .
config
The |config.CodeSignConfig| object.
The |config . CodeSignConfig| object .
disable_packaging
Whether all packaging is disabled. If True, the
unpackaged signed app bundle will be copied to |paths.output|. If
False, the packaging specified in the distribution will be
performed.
Whether all packaging is disabled . If True the unpackaged signed app bundle will be copied to |paths . output| . If False the packaging specified in the distribution will be performed .
do_notarization
If True, the signed application bundle will be sent for
notarization by Apple. The resulting notarization ticket will then
be stapled. If |package_dmg| is also True, the stapled application
will be packaged in the DMG and then the DMG itself will be
notarized and stapled.
If True the signed application bundle will be sent for notarization by Apple . The resulting notarization ticket will then be stapled . If |package_dmg| is also True the stapled application will be packaged in the DMG and then the DMG itself will be notarized and stapled .
skip_brands
A list of brand code strings. If a distribution has a brand
code in this list, that distribution will be skipped.
A list of brand code strings . If a distribution has a brand code in this list that distribution will be skipped .