#!/usr/bin/python # tries to reorder the deps of a given list of packages so they # are merged in order - [email protected] (09 Oct 03) import portage import sys, string fakedbapi = portage.fakedbapi() varapi = portage.db["/"]["vartree"].dbapi pkgs_to_reorder = sys.argv[1:] pkgs_ordered = [] # key = catpkgver # value = ( added, dependencies, slot ) DEP_ADDED = 0 DEP_DEPLIST = 1 DEP_SLOT = 2 dep_cache = {} # very simply, we extract the dependencies for each package for pkg in pkgs_to_reorder: try: deps, slot = varapi.aux_get(pkg, ["DEPEND", "SLOT"]) except ValueError: sys.stderr.write("Error getting dependency information off " + pkg + "\n") continue try: realdeps = portage.dep_check(deps, fakedbapi) except TypeError:
reinstall_period = 5 * seconds_per_week import os import sys import time import portage current_time = time.time() portdb = portage.portdb portdb.porttrees = [portdb.porttree_root] # exclude overlays portdb.freeze() settings = portage.config(clone=portage.settings) vardb = portage.db[settings["ROOT"]]["vartree"].dbapi fakedb = portage.fakedbapi(settings=portage.settings) deps = {} metadata_keys = [k for k in portage.auxdbkeys if not k.startswith("UNUSED_")] dep_keys = ["DEPEND", "RDEPEND", "PDEPEND"] good_pkgs = set() bad_pkgs = set() for cp in portdb.cp_all(): best_visible = portdb.xmatch("bestmatch-visible", cp) if best_visible: best_installed = portage.best(vardb.match(cp)) reinstall = False if best_installed and reinstall_period is not None: try: mtime = os.stat(
reinstall_period = 5 * seconds_per_week import os import sys import time import portage current_time = time.time() portdb = portage.portdb portdb.porttrees = [portdb.porttree_root] # exclude overlays portdb.freeze() settings = portage.config(clone=portage.settings) vardb = portage.db[settings["ROOT"]]["vartree"].dbapi fakedb = portage.fakedbapi(settings=portage.settings) deps = {} metadata_keys = [k for k in portage.auxdbkeys if not k.startswith("UNUSED_")] dep_keys = ["DEPEND", "RDEPEND", "PDEPEND"] good_pkgs = set() bad_pkgs = set() for cp in portdb.cp_all(): best_visible = portdb.xmatch("bestmatch-visible", cp) if best_visible: best_installed = portage.best(vardb.match(cp)) reinstall = False if best_installed and reinstall_period is not None: try: mtime = os.stat(os.path.join(