def setSeeds(self, seeds):
        self.seeds = seeds

        # Suppress most log information
        logging.getLogger().setLevel(logging.CRITICAL)

        global MIRROR, DIST, COMPONENTS, ARCH
        print "Germinating"
        g = Germinator()
        apt_pkg.InitConfig()
        apt_pkg.Config.Set("APT::Architecture", ARCH)

        Germinate.Archive.TagFile(MIRROR).feed(g, DIST, COMPONENTS, ARCH)

        (seednames, seedinherit) = g.parseStructure(open_metafile("STRUCTURE"))
        for seedname in self.seeds:
            global SEEDS, RELEASE
            g.plantSeed(SEEDS, RELEASE, ARCH, seedname,
                        list(seedinherit[seedname]))
        g.prune()
        g.grow()

        for seedname in self.seeds:
            for pkg in g.seed[seedname]:
                self.package.setdefault(pkg, Package(pkg))
                self.package[pkg].setSeed(seedname + ".seed")
            for pkg in g.depends[seedname]:
                self.package.setdefault(pkg, Package(pkg))
                self.package[pkg].setSeed(seedname + ".depends")
Exemplo n.º 2
0
    def setSeeds(self, seeds):
        self.seeds = seeds

        # Suppress most log information
        logging.getLogger().setLevel(logging.CRITICAL)

        global RELEASE, MIRROR, DIST, COMPONENTS, ARCH
        print "Germinating"
        g = Germinator()
        apt_pkg.InitConfig()
        apt_pkg.Config.Set("APT::Architecture", ARCH)

        Germinate.Archive.TagFile(MIRROR).feed(g, DIST, COMPONENTS, ARCH)

        (seednames, seedinherit) = g.parseStructure(
            Germinate.seeds.open_seed(SEEDS + RELEASE, "STRUCTURE"))
        for seedname in self.seeds:
            g.plantSeed(Germinate.seeds.open_seed(SEEDS + RELEASE, seedname),
                        ARCH, seedname, list(seedinherit[seedname]), RELEASE)
        g.prune()
        g.grow()

        for seedname in self.seeds:
            for pkg in g.seed[seedname]:
                self.package.setdefault(pkg, Package(pkg))
                self.package[pkg].setSeed(seedname + ".seed")
            for pkg in g.depends[seedname]:
                self.package.setdefault(pkg, Package(pkg))
                self.package[pkg].setSeed(seedname + ".depends")
Exemplo n.º 3
0
    def setSeeds(self, seeds):
        self.seeds = seeds

        # Suppress most log information
        logging.getLogger().setLevel(logging.CRITICAL)

        global RELEASE, MIRROR, DIST, COMPONENTS, ARCH
        print "Germinating"
        g = Germinator()
        apt_pkg.InitConfig()
        apt_pkg.Config.Set("APT::Architecture", ARCH)

        Germinate.Archive.TagFile(MIRROR).feed(g, DIST, COMPONENTS, ARCH, True)

        seednames, seedinherit, seedbranches = g.parseStructure(SEEDS, RELEASE)
        needed_seeds = []
        build_tree = False
        for seedname in self.seeds:
            if seedname == ("%s+build-depends" % g.supported):
                seedname = g.supported
                build_tree = True
            for inherit in seedinherit[seedname]:
                if inherit not in needed_seeds:
                    needed_seeds.append(inherit)
            if seedname not in needed_seeds:
                needed_seeds.append(seedname)
        for seedname in needed_seeds:
            g.plantSeed(
                Germinate.seeds.open_seed(SEEDS, seedbranches, seedname),
                ARCH,
                seedname,
                list(seedinherit[seedname]),
                RELEASE,
            )
        g.prune()
        g.grow()

        for seedname in needed_seeds:
            for pkg in g.seed[seedname]:
                self.package.setdefault(pkg, Package(pkg))
                self.package[pkg].setSeed(seedname + ".seed")
            for pkg in g.seedrecommends[seedname]:
                self.package.setdefault(pkg, Package(pkg))
                self.package[pkg].setSeed(seedname + ".seed-recommends")
            for pkg in g.depends[seedname]:
                self.package.setdefault(pkg, Package(pkg))
                self.package[pkg].setSeed(seedname + ".depends")

            if build_tree:
                build_depends = dict.fromkeys(g.build_depends[seedname], True)
                for inner in g.innerSeeds(g.supported):
                    build_depends.update(dict.fromkeys(g.seed[inner], False))
                    build_depends.update(dict.fromkeys(g.seedrecommends[inner], False))
                    build_depends.update(dict.fromkeys(g.depends[inner], False))
                for (pkg, use) in build_depends.iteritems():
                    if use:
                        self.package.setdefault(pkg, Package(pkg))
                        self.package[pkg].setSeed(g.supported + ".build-depends")
Exemplo n.º 4
0
def main():
    global SEEDS, SEEDS_BZR, RELEASE, MIRROR, SOURCE_MIRROR
    global DIST, ARCH, COMPONENTS, CHECK_IPV6
    verbose = False
    bzr = False
    cleanup = False
    want_rdepends = True
    seed_packages = ()
    seeds_set = False

    g = Germinator()

    try:
        opts, args = getopt.getopt(sys.argv[1:], "hvS:s:m:d:c:a:i",
                                   ["help",
                                    "version",
                                    "verbose",
                                    "seed-source=",
                                    "seed-dist=",
                                    "mirror=",
                                    "source-mirror=",
                                    "dist=",
                                    "components=",
                                    "arch=",
                                    "ipv6",
                                    "bzr",
                                    "cleanup",
                                    "no-rdepends",
                                    "seed-packages="])
    except getopt.GetoptError:
        usage(sys.stderr)
        sys.exit(2)

    for option, value in opts:
        if option in ("-h", "--help"):
            usage(sys.stdout)
            sys.exit()
        elif option == "--version":
            print "%s %s" % (os.path.basename(sys.argv[0]),
                             Germinate.version.VERSION)
            sys.exit()
        elif option in ("-v", "--verbose"):
            verbose = True
        elif option in ("-S", "--seed-source"):
            SEEDS = value.split(",")
            seeds_set = True
        elif option in ("-s", "--seed-dist"):
            RELEASE = value
        elif option in ("-m", "--mirror"):
            MIRROR = value
            if not MIRROR.endswith("/"):
                MIRROR += "/"
        elif option == "--source-mirror":
            SOURCE_MIRROR = value
            if not SOURCE_MIRROR.endswith("/"):
                SOURCE_MIRROR += "/"
        elif option in ("-d", "--dist"):
            DIST = value.split(",")
        elif option in ("-c", "--components"):
            COMPONENTS = value.split(",")
        elif option in ("-a", "--arch"):
            ARCH = value
        elif option in ("-i", "--ipv6"):
            CHECK_IPV6 = True
        elif option == "--bzr":
            bzr = True
            if not seeds_set:
                SEEDS = SEEDS_BZR
        elif option == "--cleanup":
            cleanup = True
        elif option == "--no-rdepends":
            want_rdepends = False
        elif option == "--seed-packages":
            seed_packages = value.split(',')

    logger = logging.getLogger()
    if verbose:
        logger.setLevel(logging.DEBUG)
    else:
        logger.setLevel(Germinator.PROGRESS)
    handler = logging.StreamHandler(sys.stdout)
    handler.setFormatter(logging.Formatter('%(levelname)s%(message)s'))
    logger.addHandler(handler)

    apt_pkg.InitConfig()
    apt_pkg.Config.Set("APT::Architecture", ARCH)

    Germinate.Archive.TagFile(MIRROR, SOURCE_MIRROR).feed(
        g, DIST, COMPONENTS, ARCH, cleanup)

    if CHECK_IPV6:
        g.parseIPv6(open_ipv6_tag_file("dailydump"))

    if os.path.isfile("hints"):
        g.parseHints(open("hints"))

    blacklist = Germinate.seeds.open_seed(SEEDS, RELEASE, "blacklist", bzr)
    if blacklist is not None:
        g.parseBlacklist(blacklist)

    seednames, seedinherit, seedbranches = g.parseStructure(
        SEEDS, RELEASE, bzr)
    seedtexts = {}
    for seedname in seednames:
        seed_fd = Germinate.seeds.open_seed(SEEDS, seedbranches, seedname, bzr)
        seedtexts[seedname] = seed_fd.readlines()
        seed_fd.close()
        g.plantSeed(seedtexts[seedname],
                    ARCH, seedname, list(seedinherit[seedname]), RELEASE)
    for seed_package in seed_packages:
        (parent, pkg) = seed_package.split('/')
        g.plantSeed([" * " + pkg], ARCH, pkg,
                    seedinherit[parent] + [parent], RELEASE)
        seednames.append(pkg)
    g.prune()
    g.grow()
    g.addExtras(RELEASE)
    if want_rdepends:
        g.reverseDepends()

    seednames_extra = list(seednames)
    seednames_extra.append('extra')
    for seedname in seednames_extra:
        write_list(seedname, seedname,
                   g, set(g.seed[seedname]) | set(g.seedrecommends[seedname]) |
                      set(g.depends[seedname]))
        write_list(seedname, seedname + ".seed",
                   g, g.seed[seedname])
        write_list(seedname, seedname + ".seed-recommends",
                   g, g.seedrecommends[seedname])
        write_list(seedname, seedname + ".depends",
                   g, g.depends[seedname])
        write_list(seedname, seedname + ".build-depends",
                   g, g.build_depends[seedname])

        if seedname != "extra":
            write_seedtext(seedname + ".seedtext", seedtexts[seedname])
            write_source_list(seedname + ".sources",
                              g, g.sourcepkgs[seedname])
        write_source_list(seedname + ".build-sources",
                          g, g.build_sourcepkgs[seedname])

    all = set()
    sup = set()
    all_srcs = set()
    sup_srcs = set()
    for seedname in seednames:
        all.update(g.seed[seedname])
        all.update(g.seedrecommends[seedname])
        all.update(g.depends[seedname])
        all.update(g.build_depends[seedname])
        all_srcs.update(g.sourcepkgs[seedname])
        all_srcs.update(g.build_sourcepkgs[seedname])

        if seedname == g.supported:
            sup.update(g.seed[seedname])
            sup.update(g.seedrecommends[seedname])
            sup.update(g.depends[seedname])
            sup_srcs.update(g.sourcepkgs[seedname])

        # Only include those build-dependencies that aren't already in the
        # dependency outputs for inner seeds of supported. This allows
        # supported+build-depends to be usable as an "everything else"
        # output.
        build_depends = dict.fromkeys(g.build_depends[seedname], True)
        build_sourcepkgs = dict.fromkeys(g.build_sourcepkgs[seedname], True)
        for seed in g.innerSeeds(g.supported):
            build_depends.update(dict.fromkeys(g.seed[seed], False))
            build_depends.update(dict.fromkeys(g.seedrecommends[seed], False))
            build_depends.update(dict.fromkeys(g.depends[seed], False))
            build_sourcepkgs.update(dict.fromkeys(g.sourcepkgs[seed], False))
        sup.update([k for (k, v) in build_depends.iteritems() if v])
        sup_srcs.update([k for (k, v) in build_sourcepkgs.iteritems() if v])

    write_list("all", "all", g, all)
    write_source_list("all.sources", g, all_srcs)

    write_list("all", "%s+build-depends" % g.supported, g, sup)
    write_source_list("%s+build-depends.sources" % g.supported, g, sup_srcs)

    write_list("all", "all+extra", g, g.all)
    write_source_list("all+extra.sources", g, g.all_srcs)

    write_prov_list("provides", g.pkgprovides)

    write_structure("structure", g.structure)

    if os.path.exists("rdepends"):
        shutil.rmtree("rdepends")
    if want_rdepends:
        os.mkdir("rdepends")
        os.mkdir(os.path.join("rdepends", "ALL"))
        for pkg in g.all:
            dirname = os.path.join("rdepends", g.packages[pkg]["Source"])
            if not os.path.exists(dirname):
                os.mkdir(dirname)

            write_rdepend_list(os.path.join(dirname, pkg), g, pkg)
            os.symlink(os.path.join("..", g.packages[pkg]["Source"], pkg),
                       os.path.join("rdepends", "ALL", pkg))

    g.writeBlacklisted("blacklisted")
Exemplo n.º 5
0
additions = {}
removals = {}
apt_pkg.InitConfig()
for architecture in architectures:
    print "[%s] Downloading available package lists..." % architecture
    apt_pkg.Config.Set("APT::Architecture", architecture)
    germinator = Germinator()
    Germinate.Archive.TagFile(archive_base[architecture],
                              archive_base_default).feed(germinator, [dist],
                                                         components,
                                                         architecture,
                                                         cleanup=True)
    debootstrap_base = set(debootstrap_packages(architecture))

    print "[%s] Loading seed lists..." % architecture
    (seed_names, seed_inherit) = germinator.parseStructure(
        Germinate.seeds.open_seed(seed_base, "STRUCTURE", bzr))
    for seed_name in seeds:
        germinator.plantSeed(
            Germinate.seeds.open_seed(seed_base, seed_name, bzr), architecture,
            seed_name, list(seed_inherit[seed_name]))

    print "[%s] Merging seeds with available package lists..." % architecture
    for seed_name in output_seeds:
        output_filename = '%s-%s' % (seed_name, architecture)
        old_list = None
        if os.path.exists(output_filename):
            old_list = set(map(str.strip, open(output_filename).readlines()))
            os.rename(output_filename, output_filename + '.old')

        # work on the depends
        new_list = []
check_debootstrap_version()

additions = {}
removals = {}
apt_pkg.InitConfig()
for architecture in architectures:
    print "[%s] Downloading available package lists..." % architecture
    apt_pkg.Config.Set("APT::Architecture", architecture)
    germinator = Germinator()
    Germinate.Archive.TagFile(archive_base[architecture], archive_base_default).feed(
        germinator, [dist], components, architecture, cleanup=True)
    debootstrap_base = set(debootstrap_packages(architecture))

    print "[%s] Loading seed lists..." % architecture
    (seed_names, seed_inherit) = germinator.parseStructure(
        Germinate.seeds.open_seed(seed_base, "STRUCTURE", bzr))
    for seed_name in seeds:
        germinator.plantSeed(Germinate.seeds.open_seed(seed_base, seed_name,
                                                       bzr),
                             architecture, seed_name,
                             list(seed_inherit[seed_name]))

    print "[%s] Merging seeds with available package lists..." % architecture
    for seed_name in output_seeds:
        output_filename = '%s-%s' % (seed_name,architecture)
        old_list = None
        if os.path.exists(output_filename):
            old_list = set(map(str.strip,open(output_filename).readlines()))
            os.rename(output_filename, output_filename + '.old')

        # work on the depends
check_debootstrap_version()

additions = {}
removals = {}
moves = {}
apt_pkg.InitConfig()
for architecture in architectures:
    print "[%s] Downloading available package lists..." % architecture
    apt_pkg.Config.Set("APT::Architecture", architecture)
    germinator = Germinator()
    Germinate.Archive.TagFile(archive_base[architecture], archive_base_default).feed(
        germinator, [dist], components, architecture, cleanup=True)
    debootstrap_base = set(debootstrap_packages(architecture))

    print "[%s] Loading seed lists..." % architecture
    seed_names, seed_inherit, seed_branches = germinator.parseStructure(
        seed_base, seed_dist, bzr)
    needed_seeds = []
    for seed_name in seeds:
        for inherit in seed_inherit[seed_name]:
            if inherit not in needed_seeds:
                needed_seeds.append(inherit)
        if seed_name not in needed_seeds:
            needed_seeds.append(seed_name)
    seed_texts = {}
    for seed_name in needed_seeds:
        seed_fd = Germinate.seeds.open_seed(seed_base, seed_branches,
                                            seed_name, bzr)
        seed_texts[seed_name] = seed_fd.readlines()
        seed_fd.close()
        germinator.plantSeed(seed_texts[seed_name], architecture, seed_name,
                             list(seed_inherit[seed_name]))
def main():
    global SEEDS, RELEASE, MIRROR, DIST, ARCH, COMPONENTS, CHECK_IPV6
    want_rdepends = True
    logger = logging.getLogger()
    logger.setLevel(logging.DEBUG)
    handler = logging.StreamHandler(sys.stdout)
    handler.setFormatter(logging.Formatter('%(levelname)s%(message)s'))
    logger.addHandler(handler)

    g = Germinator()

    try:
        opts, args = getopt.getopt(sys.argv[1:], "hS:s:m:d:c:a:i",
                                   ["help",
                                    "seed-source=",
                                    "seed-dist=",
                                    "mirror=",
                                    "dist=",
                                    "components=",
                                    "arch=",
                                    "ipv6",
                                    "no-rdepends"])
    except getopt.GetoptError:
        usage(sys.stderr)
        sys.exit(2)

    for option, value in opts:
        if option in ("-h", "--help"):
            usage(sys.stdout)
            sys.exit()
        elif option in ("-S", "--seed-source"):
            SEEDS = value
            if not SEEDS.endswith("/"):
                SEEDS += "/"
        elif option in ("-s", "--seed-dist"):
            RELEASE = value
        elif option in ("-m", "--mirror"):
            MIRROR = value
            if not MIRROR.endswith("/"):
                MIRROR += "/"
        elif option in ("-d", "--dist"):
            DIST = value.split(",")
        elif option in ("-c", "--components"):
            COMPONENTS = value.split(",")
        elif option in ("-a", "--arch"):
            ARCH = value
        elif option in ("-i", "--ipv6"):
            CHECK_IPV6 = True
        elif option == "--no-rdepends":
            want_rdepends = False

    apt_pkg.InitConfig()
    apt_pkg.Config.Set("APT::Architecture", ARCH)

    Germinate.Archive.TagFile(MIRROR).feed(g, DIST, COMPONENTS, ARCH)

    if CHECK_IPV6:
        g.parseIPv6(open_ipv6_tag_file("dailydump"))

    if os.path.isfile("hints"):
        g.parseHints(open("hints"))

    blacklist = open_metafile("blacklist")
    if blacklist is not None:
        g.parseBlacklist(blacklist)
    print "BLACKLIST ",blacklist
    (seednames, seedinherit) = g.parseStructure(open_metafile("STRUCTURE"))
    for seedname in seednames:
        g.plantSeed(SEEDS, RELEASE, ARCH, seedname,
                    list(seedinherit[seedname]))
    g.prune()
    g.grow()
    g.addExtras()
    if want_rdepends:
        g.reverseDepends()

    seednames_extra = list(seednames)
    seednames_extra.append('extra')
    for seedname in seednames_extra:
        write_list(seedname, seedname,
                   g, g.seed[seedname] + g.depends[seedname])
        write_list(seedname, seedname + ".seed",
                   g, g.seed[seedname])
        write_list(seedname, seedname + ".depends",
                   g, g.depends[seedname])
        write_list(seedname, seedname + ".build-depends",
                   g, g.build_depends[seedname])

        if seedname != "extra":
            write_source_list(seedname + ".sources",
                              g, g.sourcepkgs[seedname])
        write_source_list(seedname + ".build-sources",
                          g, g.build_sourcepkgs[seedname])

    all = []
    sup = []
    all_srcs = []
    sup_srcs = []
    for seedname in seednames:
        all += g.seed[seedname]
        all += g.depends[seedname]
        all += g.build_depends[seedname]
        all_srcs += g.sourcepkgs[seedname]
        all_srcs += g.build_sourcepkgs[seedname]

        if seedname == "supported":
            sup += g.seed[seedname]
            sup += g.depends[seedname]
            sup_srcs += g.sourcepkgs[seedname]

        # Only include those build-dependencies that aren't already in the
        # dependency outputs for inner seeds of supported. This allows
        # supported+build-depends to be usable as an "everything else"
        # output.
        build_depends = dict.fromkeys(g.build_depends[seedname], True)
        build_sourcepkgs = dict.fromkeys(g.build_sourcepkgs[seedname], True)
        for seed in g.innerSeeds("supported"):
            build_depends.update(dict.fromkeys(g.seed[seed], False))
            build_depends.update(dict.fromkeys(g.depends[seed], False))
            build_sourcepkgs.update(dict.fromkeys(g.sourcepkgs[seed], False))
        sup += [k for (k, v) in build_depends.iteritems() if v]
        sup_srcs += [k for (k, v) in build_sourcepkgs.iteritems() if v]

    # TODO: use sets from Python 2.4 once Ubuntu datacentre is upgraded to
    # Hoary
    all = dict.fromkeys(all).keys()
    all_srcs = dict.fromkeys(all_srcs).keys()
    sup = dict.fromkeys(sup).keys()
    sup_srcs = dict.fromkeys(sup_srcs).keys()

    write_list("all", "all", g, all)
    write_source_list("all.sources", g, all_srcs)

    write_list("all", "supported+build-depends", g, sup)
    write_source_list("supported+build-depends.sources", g, sup_srcs)

    write_list("all", "all+extra", g, g.all)
    write_source_list("all+extra.sources", g, g.all_srcs)

    write_prov_list("provides", g.pkgprovides)

    if os.path.exists("rdepends"):
        shutil.rmtree("rdepends")
    if want_rdepends:
        os.mkdir("rdepends")
        os.mkdir(os.path.join("rdepends", "ALL"))
        for pkg in g.all:
            dirname = os.path.join("rdepends", g.packages[pkg]["Source"])
            if not os.path.exists(dirname):
                os.mkdir(dirname)

            write_rdepend_list(os.path.join(dirname, pkg), g, pkg)
            os.symlink(os.path.join("..", g.packages[pkg]["Source"], pkg),
                       os.path.join("rdepends", "ALL", pkg))

    g.writeBlacklisted("blacklisted")
Exemplo n.º 9
0
def main():
    global SEEDS, RELEASE, MIRROR, SOURCE_MIRROR
    global DIST, ARCH, COMPONENTS, CHECK_IPV6
    verbose = False
    bzr = False
    cleanup = False
    want_rdepends = True
    seed_packages = ()

    g = Germinator()

    try:
        opts, args = getopt.getopt(sys.argv[1:], "hvS:s:m:d:c:a:i", [
            "help", "verbose", "seed-source=", "seed-dist=", "mirror=",
            "source-mirror=", "dist=", "components=", "arch=", "ipv6", "bzr",
            "cleanup", "no-rdepends", "seed-packages="
        ])
    except getopt.GetoptError:
        usage(sys.stderr)
        sys.exit(2)

    for option, value in opts:
        if option in ("-h", "--help"):
            usage(sys.stdout)
            sys.exit()
        elif option in ("-v", "--verbose"):
            verbose = True
        elif option in ("-S", "--seed-source"):
            SEEDS = value
            if not SEEDS.endswith("/"):
                SEEDS += "/"
        elif option in ("-s", "--seed-dist"):
            RELEASE = value
        elif option in ("-m", "--mirror"):
            MIRROR = value
            if not MIRROR.endswith("/"):
                MIRROR += "/"
        elif option == "--source-mirror":
            SOURCE_MIRROR = value
            if not SOURCE_MIRROR.endswith("/"):
                SOURCE_MIRROR += "/"
        elif option in ("-d", "--dist"):
            DIST = value.split(",")
        elif option in ("-c", "--components"):
            COMPONENTS = value.split(",")
        elif option in ("-a", "--arch"):
            ARCH = value
        elif option in ("-i", "--ipv6"):
            CHECK_IPV6 = True
        elif option == "--bzr":
            bzr = True
        elif option == "--cleanup":
            cleanup = True
        elif option == "--no-rdepends":
            want_rdepends = False
        elif option == "--seed-packages":
            seed_packages = value.split(',')

    logger = logging.getLogger()
    if verbose:
        logger.setLevel(logging.DEBUG)
    else:
        logger.setLevel(Germinator.PROGRESS)
    handler = logging.StreamHandler(sys.stdout)
    handler.setFormatter(logging.Formatter('%(levelname)s%(message)s'))
    logger.addHandler(handler)

    apt_pkg.InitConfig()
    apt_pkg.Config.Set("APT::Architecture", ARCH)

    Germinate.Archive.TagFile(MIRROR,
                              SOURCE_MIRROR).feed(g, DIST, COMPONENTS, ARCH,
                                                  cleanup)

    if CHECK_IPV6:
        g.parseIPv6(open_ipv6_tag_file("dailydump"))

    if os.path.isfile("hints"):
        g.parseHints(open("hints"))

    blacklist = Germinate.seeds.open_seed(SEEDS + RELEASE, "blacklist", bzr)
    if blacklist is not None:
        g.parseBlacklist(blacklist)

    (seednames, seedinherit) = g.parseStructure(
        Germinate.seeds.open_seed(SEEDS + RELEASE, "STRUCTURE", bzr))
    for seedname in seednames:
        g.plantSeed(Germinate.seeds.open_seed(SEEDS + RELEASE, seedname, bzr),
                    ARCH, seedname, list(seedinherit[seedname]), RELEASE)
    for seed_package in seed_packages:
        (parent, pkg) = seed_package.split('/')
        g.plantSeed([" * " + pkg], ARCH, pkg, seedinherit[parent] + [parent],
                    RELEASE)
        seednames.append(pkg)
    g.prune()
    g.grow()
    g.addExtras(RELEASE)
    if want_rdepends:
        g.reverseDepends()

    seednames_extra = list(seednames)
    seednames_extra.append('extra')
    for seedname in seednames_extra:
        write_list(
            seedname, seedname, g,
            set(g.seed[seedname]) | set(g.seedrecommends[seedname])
            | set(g.depends[seedname]))
        write_list(seedname, seedname + ".seed", g, g.seed[seedname])
        write_list(seedname, seedname + ".seed-recommends", g,
                   g.seedrecommends[seedname])
        write_list(seedname, seedname + ".depends", g, g.depends[seedname])
        write_list(seedname, seedname + ".build-depends", g,
                   g.build_depends[seedname])

        if seedname != "extra":
            write_source_list(seedname + ".sources", g, g.sourcepkgs[seedname])
        write_source_list(seedname + ".build-sources", g,
                          g.build_sourcepkgs[seedname])

    all = set()
    sup = set()
    all_srcs = set()
    sup_srcs = set()
    for seedname in seednames:
        all.update(g.seed[seedname])
        all.update(g.seedrecommends[seedname])
        all.update(g.depends[seedname])
        all.update(g.build_depends[seedname])
        all_srcs.update(g.sourcepkgs[seedname])
        all_srcs.update(g.build_sourcepkgs[seedname])

        if seedname == "supported":
            sup.update(g.seed[seedname])
            sup.update(g.seedrecommends[seedname])
            sup.update(g.depends[seedname])
            sup_srcs.update(g.sourcepkgs[seedname])

        # Only include those build-dependencies that aren't already in the
        # dependency outputs for inner seeds of supported. This allows
        # supported+build-depends to be usable as an "everything else"
        # output.
        build_depends = dict.fromkeys(g.build_depends[seedname], True)
        build_sourcepkgs = dict.fromkeys(g.build_sourcepkgs[seedname], True)
        for seed in g.innerSeeds("supported"):
            build_depends.update(dict.fromkeys(g.seed[seed], False))
            build_depends.update(dict.fromkeys(g.seedrecommends[seed], False))
            build_depends.update(dict.fromkeys(g.depends[seed], False))
            build_sourcepkgs.update(dict.fromkeys(g.sourcepkgs[seed], False))
        sup.update([k for (k, v) in build_depends.iteritems() if v])
        sup_srcs.update([k for (k, v) in build_sourcepkgs.iteritems() if v])

    write_list("all", "all", g, all)
    write_source_list("all.sources", g, all_srcs)

    write_list("all", "supported+build-depends", g, sup)
    write_source_list("supported+build-depends.sources", g, sup_srcs)

    write_list("all", "all+extra", g, g.all)
    write_source_list("all+extra.sources", g, g.all_srcs)

    write_prov_list("provides", g.pkgprovides)

    if os.path.exists("rdepends"):
        shutil.rmtree("rdepends")
    if want_rdepends:
        os.mkdir("rdepends")
        os.mkdir(os.path.join("rdepends", "ALL"))
        for pkg in g.all:
            dirname = os.path.join("rdepends", g.packages[pkg]["Source"])
            if not os.path.exists(dirname):
                os.mkdir(dirname)

            write_rdepend_list(os.path.join(dirname, pkg), g, pkg)
            os.symlink(os.path.join("..", g.packages[pkg]["Source"], pkg),
                       os.path.join("rdepends", "ALL", pkg))

    g.writeBlacklisted("blacklisted")