code: def _populate_cache(platform, pkg_cache, mount_dir):
      '''
      If a ``pkg_cache`` directory is specified, then use it to populate the
      disk image.
      '''
      if not pkg_cache:
          return
      if not os.path.isdir(pkg_cache):
          return
  
      if platform == 'pacman':
          cache_dir = '{0}/var/cache/pacman/pkg'.format(mount_dir)
  
      __salt__['file.mkdir'](cache_dir, 'root', 'root', '755')
      __salt__['file.copy'](pkg_cache, cache_dir, recurse=True, remove_existing=Truef _populate_cache(platform, pkg_cache, mount_dir):
      '''
      If a ``pkg_cache`` directory is specified, then use it to populate the
      disk image.
      '''
      if not pkg_cache:
          return
      if not os.path.isdir(pkg_cache):
          return
  
      if platform == 'pacman':
          cache_dir = '{0}/var/cache/pacman/pkg'.format(mount_dir)
  
      __salt__['file.mkdir'](cache_dir, 'root', 'root', '755')
      __salt__['file.copy'](pkg_cache, cache_dir, recurse=True, remove_existing=True)
docs: If a ``pkg_cache`` directory is specified, then use it to populate the
      disk image.