def _repack_pkgs(pkgs, normalize=True):
    '''
    Repack packages specified using "pkgs" argument to pkg states into a single
    dictionary
    '''
    if normalize and 'pkg.normalize_name' in __salt__:
        _normalize_name = __salt__['pkg.normalize_name']
    else:
        _normalize_name = lambda pkgname: pkgname
    return dict(
        [
            (_normalize_name(six.text_type(x)), six.text_type(y) if y is not None else y)
            for x, y in six.iteritems(salt.utils.data.repack_dictlist(pkgs))
        ]
    )