Esempio n. 1
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
Esempio n. 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
Esempio n. 3
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
Esempio n. 4
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
Esempio n. 5
0
def listChannels(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_sql(c_info['id'])
        for p in packageList:
            # 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