def execute(args, parser): import conda.plan as plan from conda.api import get_index import pscheck prefix = common.get_prefix(args) # handle explict installs of conda packages if args.packages and all(s.endswith('.tar.bz2') for s in args.packages): from conda.misc import install_local_packages install_local_packages(prefix, args.packages, verbose=not args.quiet) return if any(s.endswith('.tar.bz2') for s in args.packages): raise RuntimeError("cannot mix specifications with conda package " "filenames") if args.force: args.no_deps = True if args.file: specs = common.specs_from_file(args.file) else: specs = common.specs_from_args(args.packages) common.check_specs(prefix, specs) spec_names = set(s.split()[0] for s in specs) if args.no_deps: only_names = spec_names else: only_names = None common.ensure_override_channels_requires_channel(args) channel_urls = args.channel or () index = get_index(channel_urls=channel_urls, prepend=not args.override_channels) actions = plan.install_actions(prefix, index, specs, force=args.force, only_names=only_names) if plan.nothing_to_do(actions): from main_list import list_packages regex = '^(%s)$' % '|'.join(spec_names) print '# All requested packages already installed.' list_packages(prefix, regex) return print print "Package plan for installation in environment %s:" % prefix plan.display_actions(actions, index) if not pscheck.main(args): common.confirm_yn(args) plan.execute_actions(actions, index, verbose=not args.quiet)