chrome/installer/mac/signing/pipeline.py
def _create_pkgbuild_scripts(paths, dist_config):
    """Creates a directory filled with scripts for use by `pkgbuild`, and copies
    the postinstall script into this directory, customizing it along the way.

    Args:
        paths: A |model.Paths| object.
        dist_config: The |config.CodeSignConfig| object.

    Returns:
        The path to the scripts directory.
    """
    scripts_path = os.path.join(paths.work, 'scripts')
    commands.make_dir(scripts_path)

    packaging_dir = paths.packaging_dir(dist_config)

    def do_substitutions(script):
        substitutions = {
            '@APP_DIR@': dist_config.app_dir,
            '@APP_PRODUCT@': dist_config.app_product,
            '@BRAND_CODE@': dist_config.distribution.branding_code or '',
            '@FRAMEWORK_DIR@': dist_config.framework_dir
        }
        for key, value in substitutions.items():
            script = script.replace(key, value)

        return script

    postinstall_src_path = os.path.join(packaging_dir, 'pkg_postinstall.in')
    postinstall_dest_path = os.path.join(scripts_path, 'postinstall')

    postinstall = commands.read_file(postinstall_src_path)
    postinstall = do_substitutions(postinstall)
    commands.write_file(postinstall_dest_path, postinstall)
    commands.set_executable(postinstall_dest_path)

    return scripts_path
Creates a directory filled with scripts for use by `pkgbuild`, and copies
    the postinstall script into this directory, customizing it along the way.

    Args:
        paths: A |model.Paths| object.
        dist_config: The |config.CodeSignConfig| object.

    Returns:
        The path to the scripts directory.
    
Creates a directory filled with scripts for use by `pkgbuild`, and copies
the postinstall script into this directory, customizing it along the way.
Creates a directory filled with scripts for use by ` pkgbuild ` and copies the postinstall script into this directory customizing it along the way .
def _create_pkgbuild_scripts(paths, dist_config):
    scripts_path = os.path.join(paths.work, 'scripts')
    commands.make_dir(scripts_path)
    packaging_dir = paths.packaging_dir(dist_config)
    def do_substitutions(script):
        substitutions = {
            '@APP_DIR@': dist_config.app_dir,
            '@APP_PRODUCT@': dist_config.app_product,
            '@BRAND_CODE@': dist_config.distribution.branding_code or '',
            '@FRAMEWORK_DIR@': dist_config.framework_dir
        }
        for key, value in substitutions.items():
            script = script.replace(key, value)
        return script
    postinstall_src_path = os.path.join(packaging_dir, 'pkg_postinstall.in')
    postinstall_dest_path = os.path.join(scripts_path, 'postinstall')
    postinstall = commands.read_file(postinstall_src_path)
    postinstall = do_substitutions(postinstall)
    commands.write_file(postinstall_dest_path, postinstall)
    commands.set_executable(postinstall_dest_path)
    return scripts_path
def _create_pkgbuild_scripts ( paths , dist_config ) : scripts_path = os . path . join ( paths . work , 'scripts' ) commands . make_dir ( scripts_path ) packaging_dir = paths . packaging_dir ( dist_config ) def do_substitutions ( script ) : substitutions = { '@APP_DIR@' : dist_config . app_dir , '@APP_PRODUCT@' : dist_config . app_product , '@BRAND_CODE@' : dist_config . distribution . branding_code or '' , '@FRAMEWORK_DIR@' : dist_config . framework_dir } for key , value in substitutions . items ( ) : script = script . replace ( key , value ) return script postinstall_src_path = os . path . join ( packaging_dir , 'pkg_postinstall.in' ) postinstall_dest_path = os . path . join ( scripts_path , 'postinstall' ) postinstall = commands . read_file ( postinstall_src_path ) postinstall = do_substitutions ( postinstall ) commands . write_file ( postinstall_dest_path , postinstall ) commands . set_executable ( postinstall_dest_path ) return scripts_path
Creates a directory filled with scripts for use by `pkgbuild`, and copies
the postinstall script into this directory, customizing it along the way.
Creates a directory filled with scripts for use by ` pkgbuild ` and copies the postinstall script into this directory customizing it along the way .
"""Creates a directory filled with scripts for use by `pkgbuild`, and copies
    the postinstall script into this directory, customizing it along the way.

    Args:
        paths: A |model.Paths| object.
        dist_config: The |config.CodeSignConfig| object.

    Returns:
        The path to the scripts directory.
    """
The path to the scripts directory.
The path to the scripts directory .
paths
A |model.Paths| object.
A |model . Paths| object .
dist_config
The |config.CodeSignConfig| object.
The |config . CodeSignConfig| object .