def postpone_postinstall(package): try: import pisi.comariface as comariface comariface.register(package) except ImportError: raise Error(_("COMAR: comard not fully installed"))
def configure_pending(): # start with pending packages # configure them in reverse topological order of dependency A = ctx.installdb.list_pending() G_f = pgraph.PGraph(ctx.packagedb) # construct G_f for x in A.keys(): G_f.add_package(x) B = A while len(B) > 0: Bp = set() for x in B.keys(): pkg = ctx.packagedb.get_package(x) for dep in pkg.runtimeDependencies(): if dep.package in G_f.vertices(): G_f.add_dep(x, dep) B = Bp if ctx.get_option('debug'): G_f.write_graphviz(sys.stdout) order = G_f.topological_sort() order.reverse() try: import pisi.comariface as comariface for x in order: if ctx.installdb.is_installed(x): pkginfo = A[x] pkgname = util.package_name(x, pkginfo.version, pkginfo.release, False, False) pkg_path = util.join_path(ctx.config.lib_dir(), 'package', pkgname) m = MetaData() metadata_path = util.join_path(pkg_path, ctx.const.metadata_xml) m.read(metadata_path) for pcomar in m.package.providesComar: scriptPath = util.join_path(pkg_path, ctx.const.comar_dir, pcomar.script) comariface.register(pcomar, x, scriptPath) # FIXME: we need a full package info here! # Eray, please fix this # your wish is a command, darling -- eray pkginfo.name = x ctx.ui.notify(pisi.ui.configuring, package = pkginfo, files = None) comariface.run_postinstall(x) ctx.ui.notify(pisi.ui.configured, package = pkginfo, files = None) ctx.installdb.clear_pending(x) except ImportError: raise Error(_("COMAR: comard not fully installed"))
def configure_pending(): # start with pending packages # configure them in reverse topological order of dependency A = ctx.installdb.list_pending() G_f = pgraph.PGraph(packagedb) # construct G_f for x in A.keys(): G_f.add_package(x) B = A while len(B) > 0: Bp = set() for x in B.keys(): pkg = packagedb.get_package(x) for dep in pkg.runtimeDependencies: if dep.package in G_f.vertices(): G_f.add_dep(x, dep) B = Bp if ctx.get_option('debug'): G_f.write_graphviz(sys.stdout) order = G_f.topological_sort() order.reverse() try: import pisi.comariface as comariface for x in order: pkginfo = A[x] pkgname = util.package_name(x, pkginfo.version, pkginfo.release, pkginfo.build, False) pkg_path = util.join_path(ctx.config.lib_dir(), pkgname) m = MetaData() metadata_path = util.join_path(pkg_path, ctx.const.metadata_xml) m.read(metadata_path) for pcomar in m.package.providesComar: scriptPath = util.join_path(pkg_path, ctx.const.comar_dir, pcomar.script) comariface.register(pcomar, x, scriptPath) comariface.run_postinstall(x) ctx.installdb.clear_pending(x) except ImportError: raise Error(_("COMAR: comard not fully installed"))