def main(ns, rcpath): """Removes interfaces from the current fief selection.""" selection = _magic.env_selection() selection -= set(ns.ifcs) env = {'FIEF_SELECTION': ' '.join(sorted(selection))} if ns.verbose: sys.stderr.write("current interface selection: " + ' '.join(selection) + '\n') _magic.exportvars(env) return 0
def main(ns, config): """Adds interfaces to a fief selection.""" selection = _magic.env_selection(config) selection |= set(ns.ifcs) env = {'FIEF_SELECTION': ' '.join(selection)} if ns.verbose: sys.stderr.write("current interface selection: " + ' '.join(selection) + '\n') _magic.exportvars(env) return 0
def top_a(): finst = yield async.Sync(fief.Fief.new_a(rcpath)) activated = _magic.env_selection(finst) ifc2pkg, delv = yield async.Sync(deliver.deliver_a(finst, activated)) ed = EnvDelta() for ifc in ifc2pkg: e = delv(ifc, 'envdelta') if e is not None: ed.merge(e) env = ed.apply(os.environ) env['FIEF_KNOWN_INTERFACES'] = " ".join(sorted(finst.repo.interfaces())) _magic.exportvars(env)
from .. import fetch import _magic USAGE = ("Realizes the current fief selection." "usage: fief [realize]") def main(ns, config): """Realizes the current fief selection.""" repos = {} execfile(os.path.join('repo', '__repo__.py'), repos, repos) def top_a(): oven = bake.Oven(bake.MemoHost(bake.FileHost_a), "oven") repo.Cmd.showout = ns.verbose pkgs = repos['packages'] yield async.WaitFor(repo.init_a(oven, pkgs)) fetch._init(pkgs) activated = _magic.env_selection(config) ans = yield async.WaitFor(deliver.deliver_a(oven, activated, ns.lazy)) yield async.Result(ans) try: deliverables = async.run(top_a()) except Exception, e: sys.stderr.write(str(e.async_traceback) + '\n') raise env = repo.envrealize(deliverables) env['FIEF_KNOWN_INTERFACES'] = " ".join(set([ifc for ifc, pkg in repo.ifcpkg])) _magic.exportvars(env) return 0