Exemplo n.º 1
0
    if pool_path and not resolve_deps:
        fatal("--no-deps cannot be specified if pool is not defined")

    if not arch:
        arch = getoutput("dpkg --print-architecture")

    plan = Plan(pool_path=pool_path)
    for arg in args[1:]:
        if arg == "-" or os.path.exists(arg):
            plan |= Plan.init_from_file(arg, cpp_opts, pool_path)
        else:
            plan.add(arg)

    if pool_path:
        if resolve_deps:
            packages = list(plan.resolve())
        else:
            packages = list(plan)

        installer = PoolInstaller(chroot_path, pool_path, arch, environ)
    else:
        packages = list(plan)
        installer = LiveInstaller(chroot_path, apt_proxy, environ)

    installer.install(packages, ignore_errors)


if __name__=="__main__":
    main()

Exemplo n.º 2
0
    for arg in args:
        if arg == "-" or os.path.exists(arg):
            subplan = Plan.init_from_file(arg, cpp_opts, pool_path)
            plan |= subplan

            for package in subplan:
                plan.packageorigins.add(package, arg)

        else:
            plan.add(arg)
            plan.packageorigins.add(arg, '_')

    trap = StdTrap(stdout=(output_path is None), stderr=False)
    try:
        spec = plan.resolve()
    finally:
        trap.close()

    if output_path is None:
        trapped_output = trap.stdout.read()
        print >> sys.stderr, trapped_output,

    spec = annotate_spec(spec, plan.packageorigins)

    if output_path is None:
        print spec
    else:
        open(output_path, "w").write(str(spec) + "\n")

if __name__=="__main__":
Exemplo n.º 3
0
    if not pool_path and not resolve_deps:
        fatal("--no-deps cannot be specified if pool is not defined")

    if not arch:
        arch = getoutput("dpkg --print-architecture")

    plan = Plan(pool_path=pool_path)
    for arg in args[1:]:
        if arg == "-" or os.path.exists(arg):
            plan |= Plan.init_from_file(arg, cpp_opts, pool_path)
        else:
            plan.add(arg)

    if pool_path:
        if resolve_deps:
            packages = list(plan.resolve())
        else:
            packages = list(plan)

        installer = PoolInstaller(chroot_path, pool_path, arch, environ)
    else:
        packages = list(plan)
        installer = LiveInstaller(chroot_path, apt_proxy, environ)

    installer.install(packages, ignore_errors)


if __name__=="__main__":
    main()