Parse an RPM version string

    Parses most (all tested) RPM version strings to get their name,
    epoch, version, release, and architecture information. Epoch (also
    called serial) is an optional component for RPM versions, and it
    is also optional when providing a version string to this function.
    RPM assumes the epoch to be 0 if it is not provided, so that
    behavior is mirrored here.

    :param str package_string:
    :param bool arch_included:
    :return: A :any:`common.Package` object containing all parsed
        information
    :rtype: common.Package

def package(package_string, arch_included=True):
    """Parse an RPM version string

    Parses most (all tested) RPM version strings to get their name,
    epoch, version, release, and architecture information. Epoch (also
    called serial) is an optional component for RPM versions, and it
    is also optional when providing a version string to this function.
    RPM assumes the epoch to be 0 if it is not provided, so that
    behavior is mirrored here.

    :param str package_string:
    :param bool arch_included:
    :return: A :any:`common.Package` object containing all parsed
        information
    :rtype: common.Package
    """
    logger.debug('package(%s, %s)', package_string, arch_included)
    pkg_info = parse_package(package_string, arch_included)
    pkg = Package(pkg_info['name'], pkg_info['EVR'][0], pkg_info['EVR'][1],
                  pkg_info['EVR'][2], pkg_info['arch'],
                  package_str=package_string)
    return pkg