chrome/installer/mac/signing/pipeline.py
def _package_dmg(paths, dist, config):
    """Packages a Chrome application bundle into a DMG.

    Args:
        paths: A |model.Paths| object.
        dist: The |model.Distribution| for which the product was customized.
        config: The |config.CodeSignConfig| object.

    Returns:
        A path to the produced DMG file.
    """
    packaging_dir = paths.packaging_dir(config)

    if dist.channel_customize:
        dsstore_file = 'chrome_{}_dmg_dsstore'.format(dist.channel)
        icon_file = 'chrome_{}_dmg_icon.icns'.format(dist.channel)
    else:
        dsstore_file = 'chrome_dmg_dsstore'
        icon_file = 'chrome_dmg_icon.icns'

    dmg_path = os.path.join(paths.output,
                            '{}.dmg'.format(config.packaging_basename))
    app_path = os.path.join(paths.work, config.app_dir)

    # A locally-created empty directory is more trustworthy than /var/empty.
    empty_dir = os.path.join(paths.work, 'empty')
    commands.make_dir(empty_dir)

    # Make the disk image. Don't include any customized name fragments in
    # --volname because the .DS_Store expects the volume name to be constant.
    # Don't put a name on the /Applications symbolic link because the same disk
    # image is used for all languages.
    # yapf: disable
    pkg_dmg = [
        os.path.join(packaging_dir, 'pkg-dmg'),
        '--verbosity', '0',
        '--tempdir', paths.work,
        '--source', empty_dir,
        '--target', dmg_path,
        '--format', 'UDBZ',
        '--volname', config.app_product,
        '--copy', '{}:/'.format(app_path),
        '--symlink', '/Applications:/ ',
    ]
    # yapf: enable

    if dist.inflation_kilobytes:
        pkg_dmg += [
            '--copy',
            '{}/inflation.bin:/.background/inflation.bin'.format(packaging_dir)
        ]

    if config.is_chrome_branded():
        # yapf: disable
        pkg_dmg += [
            '--icon', os.path.join(packaging_dir, icon_file),
            '--copy',
                '{}/keystone_install.sh:/.keystone_install'.format(packaging_dir),
            '--mkdir', '.background',
            '--copy',
                '{}/chrome_dmg_background.png:/.background/background.png'.format(
                    packaging_dir),
            '--copy', '{}/{}:/.DS_Store'.format(packaging_dir, dsstore_file),
        ]
        # yapf: enable

    commands.run_command(pkg_dmg)

    return dmg_path
Packages a Chrome application bundle into a DMG.

    Args:
        paths: A |model.Paths| object.
        dist: The |model.Distribution| for which the product was customized.
        config: The |config.CodeSignConfig| object.

    Returns:
        A path to the produced DMG file.
    
Packages a Chrome application bundle into a DMG.
Packages a Chrome application bundle into a DMG .
def _package_dmg(paths, dist, config):
    packaging_dir = paths.packaging_dir(config)
    if dist.channel_customize:
        dsstore_file = 'chrome_{}_dmg_dsstore'.format(dist.channel)
        icon_file = 'chrome_{}_dmg_icon.icns'.format(dist.channel)
    else:
        dsstore_file = 'chrome_dmg_dsstore'
        icon_file = 'chrome_dmg_icon.icns'
    dmg_path = os.path.join(paths.output,
                            '{}.dmg'.format(config.packaging_basename))
    app_path = os.path.join(paths.work, config.app_dir)
    empty_dir = os.path.join(paths.work, 'empty')
    commands.make_dir(empty_dir)
    pkg_dmg = [
        os.path.join(packaging_dir, 'pkg-dmg'),
        '--verbosity', '0',
        '--tempdir', paths.work,
        '--source', empty_dir,
        '--target', dmg_path,
        '--format', 'UDBZ',
        '--volname', config.app_product,
        '--copy', '{}:/'.format(app_path),
        '--symlink', '/Applications:/ ',
    ]
    if dist.inflation_kilobytes:
        pkg_dmg += [
            '--copy',
            '{}/inflation.bin:/.background/inflation.bin'.format(packaging_dir)
        ]
    if config.is_chrome_branded():
        pkg_dmg += [
            '--icon', os.path.join(packaging_dir, icon_file),
            '--copy',
                '{}/keystone_install.sh:/.keystone_install'.format(packaging_dir),
            '--mkdir', '.background',
            '--copy',
                '{}/chrome_dmg_background.png:/.background/background.png'.format(
                    packaging_dir),
            '--copy', '{}/{}:/.DS_Store'.format(packaging_dir, dsstore_file),
        ]
    commands.run_command(pkg_dmg)
    return dmg_path
def _package_dmg ( paths , dist , config ) : packaging_dir = paths . packaging_dir ( config ) if dist . channel_customize : dsstore_file = 'chrome_{}_dmg_dsstore' . format ( dist . channel ) icon_file = 'chrome_{}_dmg_icon.icns' . format ( dist . channel ) else : dsstore_file = 'chrome_dmg_dsstore' icon_file = 'chrome_dmg_icon.icns' dmg_path = os . path . join ( paths . output , '{}.dmg' . format ( config . packaging_basename ) ) app_path = os . path . join ( paths . work , config . app_dir ) empty_dir = os . path . join ( paths . work , 'empty' ) commands . make_dir ( empty_dir ) pkg_dmg = [ os . path . join ( packaging_dir , 'pkg-dmg' ) , '--verbosity' , '0' , '--tempdir' , paths . work , '--source' , empty_dir , '--target' , dmg_path , '--format' , 'UDBZ' , '--volname' , config . app_product , '--copy' , '{}:/' . format ( app_path ) , '--symlink' , '/Applications:/ ' , ] if dist . inflation_kilobytes : pkg_dmg += [ '--copy' , '{}/inflation.bin:/.background/inflation.bin' . format ( packaging_dir ) ] if config . is_chrome_branded ( ) : pkg_dmg += [ '--icon' , os . path . join ( packaging_dir , icon_file ) , '--copy' , '{}/keystone_install.sh:/.keystone_install' . format ( packaging_dir ) , '--mkdir' , '.background' , '--copy' , '{}/chrome_dmg_background.png:/.background/background.png' . format ( packaging_dir ) , '--copy' , '{}/{}:/.DS_Store' . format ( packaging_dir , dsstore_file ) , ] commands . run_command ( pkg_dmg ) return dmg_path
Packages a Chrome application bundle into a DMG.
Packages a Chrome application bundle into a DMG .
"""Packages a Chrome application bundle into a DMG.

    Args:
        paths: A |model.Paths| object.
        dist: The |model.Distribution| for which the product was customized.
        config: The |config.CodeSignConfig| object.

    Returns:
        A path to the produced DMG file.
    """ # A locally-created empty directory is more trustworthy than /var/empty. # Make the disk image. Don't include any customized name fragments in # --volname because the .DS_Store expects the volume name to be constant. # Don't put a name on the /Applications symbolic link because the same disk # image is used for all languages. # yapf: disable # yapf: enable # yapf: disable # yapf: enable
A path to the produced DMG file.
A path to the produced DMG file .
paths
A |model.Paths| object.
A |model . Paths| object .
dist
The |model.Distribution| for which the product was customized.
The |model . Distribution| for which the product was customized .
config
The |config.CodeSignConfig| object.
The |config . CodeSignConfig| object .