Пример #1
0
def _listChannels(channelList, is_source):
    # Lists the packages from these channels
    # Uniquify the channels
    channels = set(channelList)
    rez = []
    for channel in channels:
        c_info = rhnChannel.channel_info(channel)
        if not c_info:
            # No packages in this channel
            continue

        if is_source:
            packageList = rhnChannel.list_packages_source(c_info['id'])
        else:
            packageList = rhnChannel.list_packages_sql(c_info['id'])
        for p in packageList:
            if is_source:
                for pkg in range(len(p)):
                    if p[pkg] is None:
                        p[pkg] = ""
                print p
                rez.append([p[0], p[1], p[2], p[3], channel])
            else:
                # We don't care about the size for now, even if we all know size
                # matters :-)
                rez.append([p[0], p[1], p[2], p[3], p[4], channel])
    return rez
Пример #2
0
def _listChannels(channelList, is_source, include_checksums):
    # Lists the packages from these channels
    # Uniquify the channels
    channels = set(channelList)
    rez = []
    for channel in channels:
        c_info = rhnChannel.channel_info(channel)
        if not c_info:
            # No packages in this channel
            continue

        if is_source:
            packageList = rhnChannel.list_packages_source(c_info['id'])
        else:
            if include_checksums:
                packageList = rhnChannel.list_packages_checksum_sql(
                    c_info['id'])
            else:
                packageList = rhnChannel.list_packages_sql(c_info['id'])
        for p in packageList:
            if is_source:
                for pkg in range(len(p)):
                    if p[pkg] is None:
                        p[pkg] = ""
                print(p)
                rez.append([p[0], p[1], p[2], p[3], channel])
            else:
                if include_checksums:
                    rez.append([p[0], p[1], p[2], p[3], p[4], p[6], p[7],
                                channel])
                else:
                    rez.append([p[0], p[1], p[2], p[3], p[4], channel])
    return rez
Пример #3
0
def listChannelsSource(channelList):
    # Lists the packages from these channels
    # Uniquify the channels
    channelHash = {}
    channels = []
    for channel in channelList:
        if channelHash.has_key(channel):
            # Already seen
            continue
        channels.append(channel)
        channelHash[channel] = None
    # channels is the unique list of channels now
    rez = []
    for channel in channels:
        c_info = rhnChannel.channel_info(channel)
        if not c_info:
            # No packages in this channel
            continue

        packageList = rhnChannel.list_packages_source(c_info['id'])
        for p in packageList:
            for pkg in range(len(p)):
                if p[pkg] is None:
                    p[pkg] = ""
            print p
            rez.append([p[0], p[1], p[2], p[3], channel])
    return rez