1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
4 from __future__ import print_function
10 portage.proxy.lazyimport.lazyimport(globals(),
13 'portage.util:writemsg_level',
15 '_emerge.actions:load_emerge_config,run_action,' + \
16 'validate_ebuild_environment',
17 '_emerge.help:help@emerge_help',
18 '_emerge.is_valid_package_atom:insert_category_into_atom'
20 from portage import os
21 from portage.util._argparse import ArgumentParser
23 if sys.hexversion >= 0x3000000:
28 "--ask-enter-invalid",
31 "--changelog", "--columns",
35 "--verbose-conflicts",
36 "--fetchonly", "--fetch-all-uri",
37 "--ignore-default-opts",
40 "--nodeps", "--noreplace",
41 "--nospinner", "--oneshot",
42 "--onlydeps", "--pretend",
43 "--quiet-repo-display",
44 "--quiet-unmerge-warn",
49 "--unordered-display",
51 "--verbose-main-repo-display",
61 "f":"--fetchonly", "F":"--fetch-all-uri",
64 "n":"--noreplace", "N":"--newuse",
65 "o":"--onlydeps", "O":"--nodeps",
66 "p":"--pretend", "P":"--prune",
68 "s":"--search", "S":"--searchdesc",
76 Larry loves Gentoo (%s)
78 _______________________
79 < Have you mooed today? >
80 -----------------------
89 def multiple_actions(action1, action2):
90 sys.stderr.write("\n!!! Multiple actions requested... Please choose one only.\n")
91 sys.stderr.write("!!! '%s' or '%s'\n\n" % (action1, action2))
94 def insert_optional_args(args):
96 Parse optional arguments and insert a value if one has
97 not been provided. This is done before feeding the args
98 to the optparse parser since that parser does not support
99 this feature natively.
102 class valid_integers(object):
103 def __contains__(self, s):
106 except (ValueError, OverflowError):
109 valid_integers = valid_integers()
111 class valid_floats(object):
112 def __contains__(self, s):
115 except (ValueError, OverflowError):
118 valid_floats = valid_floats()
126 '--autounmask' : y_or_n,
127 '--autounmask-keep-masks': y_or_n,
128 '--autounmask-unrestricted-atoms' : y_or_n,
129 '--autounmask-write' : y_or_n,
130 '--buildpkg' : y_or_n,
131 '--complete-graph' : y_or_n,
132 '--deep' : valid_integers,
133 '--depclean-lib-check' : y_or_n,
134 '--deselect' : y_or_n,
135 '--binpkg-respect-use' : y_or_n,
136 '--fail-clean' : y_or_n,
137 '--getbinpkg' : y_or_n,
138 '--getbinpkgonly' : y_or_n,
139 '--jobs' : valid_integers,
140 '--keep-going' : y_or_n,
141 '--load-average' : valid_floats,
142 '--package-moves' : y_or_n,
144 '--quiet-build' : y_or_n,
145 '--quiet-fail' : y_or_n,
146 '--rebuild-if-new-slot': y_or_n,
147 '--rebuild-if-new-rev' : y_or_n,
148 '--rebuild-if-new-ver' : y_or_n,
149 '--rebuild-if-unbuilt' : y_or_n,
150 '--rebuilt-binaries' : y_or_n,
151 '--root-deps' : ('rdeps',),
153 '--selective' : y_or_n,
154 "--use-ebuild-visibility": y_or_n,
156 '--usepkgonly' : y_or_n,
157 '--verbose' : y_or_n,
161 'D' : valid_integers,
162 'j' : valid_integers,
165 # Don't make things like "-kn" expand to "-k n"
166 # since existence of -n makes it too ambiguous.
182 arg = arg_stack.pop()
184 default_arg_choices = default_arg_opts.get(arg)
185 if default_arg_choices is not None:
187 if arg_stack and arg_stack[-1] in default_arg_choices:
188 new_args.append(arg_stack.pop())
190 # insert default argument
191 new_args.append('True')
194 if arg[:1] != "-" or arg[:2] == "--":
199 for k, arg_choices in short_arg_opts.items():
205 for k, arg_choices in short_arg_opts_n.items():
216 if arg_stack and arg_stack[-1] in arg_choices:
217 new_args.append(arg_stack.pop())
219 # insert default argument
220 new_args.append('True')
223 # Insert an empty placeholder in order to
224 # satisfy the requirements of optparse.
226 new_args.append("-" + match)
230 if arg[1:2] == match:
231 if match not in short_arg_opts_n and arg[2:] in arg_choices:
237 saved_opts = arg[1:].replace(match, "")
240 if opt_arg is None and arg_stack and \
241 arg_stack[-1] in arg_choices:
242 opt_arg = arg_stack.pop()
245 new_args.append("True")
247 new_args.append(opt_arg)
249 if saved_opts is not None:
250 # Recycle these on arg_stack since they
251 # might contain another match.
252 arg_stack.append("-" + saved_opts)
256 def _find_bad_atoms(atoms, less_strict=False):
258 Declares all atoms as invalid that have an operator,
259 a use dependency, a blocker or a repo spec.
260 It accepts atoms with wildcards.
261 In less_strict mode it accepts operators and repo specs.
264 for x in ' '.join(atoms).split():
266 if "/" not in x.split(":")[0]:
267 x_cat = insert_category_into_atom(x, 'dummy-category')
268 if x_cat is not None:
273 atom = Atom(atom, allow_wildcard=True, allow_repo=less_strict)
274 except portage.exception.InvalidAtom:
277 if bad_atom or (atom.operator and not less_strict) or atom.blocker or atom.use:
282 def parse_opts(tmpcmdline, silent=False):
287 actions = frozenset([
288 "clean", "check-news", "config", "depclean", "help",
289 "info", "list-sets", "metadata", "moo",
290 "prune", "regen", "search",
291 "sync", "unmerge", "version",
294 longopt_aliases = {"--cols":"--columns", "--skip-first":"--skipfirst"}
296 true_y_or_n = ("True", "y", "n")
297 true_y = ("True", "y")
302 "help" : "prompt before performing any actions",
303 "choices" : true_y_or_n
307 "help" : "automatically unmask packages",
308 "choices" : true_y_or_n
311 "--autounmask-unrestricted-atoms": {
312 "help" : "write autounmask changes with >= atoms if possible",
313 "choices" : true_y_or_n
316 "--autounmask-keep-masks": {
317 "help" : "don't add package.unmask entries",
318 "choices" : true_y_or_n
321 "--autounmask-write": {
322 "help" : "write changes made by --autounmask to disk",
323 "choices" : true_y_or_n
326 "--accept-properties": {
327 "help":"temporarily override ACCEPT_PROPERTIES",
331 "--accept-restrict": {
332 "help":"temporarily override ACCEPT_RESTRICT",
338 "help" : "Specifies how many times to backtrack if dependency " + \
339 "calculation fails ",
346 "help" : "build binary packages",
347 "choices" : true_y_or_n
350 "--buildpkg-exclude": {
351 "help" :"A space separated list of package atoms for which " + \
352 "no binary packages should be built. This option overrides all " + \
353 "possible ways to enable building of binary packages.",
359 "help":"specify the location for portage configuration files",
363 "help":"enable or disable color output",
367 "--complete-graph": {
368 "help" : "completely account for all known dependencies",
369 "choices" : true_y_or_n
372 "--complete-graph-if-new-use": {
373 "help" : "trigger --complete-graph behavior if USE or IUSE will change for an installed package",
377 "--complete-graph-if-new-ver": {
378 "help" : "trigger --complete-graph behavior if an installed package version will change (upgrade or downgrade)",
386 "help" : "Specifies how deep to recurse into dependencies " + \
387 "of packages given as arguments. If no argument is given, " + \
388 "depth is unlimited. Default behavior is to skip " + \
389 "dependencies of installed packages.",
394 "--depclean-lib-check": {
395 "help" : "check for consumers of libraries before removing them",
396 "choices" : true_y_or_n
400 "help" : "remove atoms/sets from the world file",
401 "choices" : true_y_or_n
405 "help": "substitute the dependencies of installed packages with the dependencies of unbuilt ebuilds",
410 "help" :"A space separated list of package names or slot atoms. " + \
411 "Emerge won't install any ebuild or binary package that " + \
412 "matches any of the given package atoms.",
418 "help" : "clean temp files after build failure",
419 "choices" : true_y_or_n
422 "--ignore-built-slot-operator-deps": {
423 "help": "Ignore the slot/sub-slot := operator parts of dependencies that have "
424 "been recorded when packages where built. This option is intended "
425 "only for debugging purposes, and it only affects built packages "
426 "that specify slot/sub-slot := operator dependencies using the "
427 "experimental \"4-slot-abi\" EAPI.",
435 "help" : "Specifies the number of packages to build " + \
442 "help" : "continue as much as possible after an error",
443 "choices" : true_y_or_n
448 "help" :"Specifies that no new builds should be started " + \
449 "if there are other builds running and the load average " + \
450 "is at least LOAD (a floating-point number).",
455 "--misspell-suggestions": {
456 "help" : "enable package name misspell suggestions",
457 "choices" : ("y", "n")
461 "help":"include unnecessary build time dependencies",
465 "help":"specify conditions to trigger package reinstallation",
466 "choices":["changed-use"]
469 "--reinstall-atoms": {
470 "help" :"A space separated list of package names or slot atoms. " + \
471 "Emerge will treat matching packages as if they are not " + \
472 "installed, and reinstall them if necessary. Implies --deep.",
477 "--binpkg-respect-use": {
478 "help" : "discard binary packages if their use flags \
479 don't match the current configuration",
480 "choices" : true_y_or_n
485 "help" : "fetch binary packages",
486 "choices" : true_y_or_n
491 "help" : "fetch binary packages only",
492 "choices" : true_y_or_n
495 "--usepkg-exclude": {
496 "help" :"A space separated list of package names or slot atoms. " + \
497 "Emerge will ignore matching binary packages. ",
502 "--rebuild-exclude": {
503 "help" :"A space separated list of package names or slot atoms. " + \
504 "Emerge will not rebuild these packages due to the " + \
510 "--rebuild-ignore": {
511 "help" :"A space separated list of package names or slot atoms. " + \
512 "Emerge will not rebuild packages that depend on matching " + \
513 "packages due to the --rebuild flag. ",
519 "help" : "perform package moves when necessary",
520 "choices" : true_y_or_n
524 "help" : "specify the installation prefix",
529 "help" : "format of result binary package",
535 "help" : "reduced or condensed output",
536 "choices" : true_y_or_n
540 "help" : "redirect build output to logs",
541 "choices" : true_y_or_n,
545 "help" : "suppresses display of the build log on stdout",
546 "choices" : true_y_or_n,
549 "--rebuild-if-new-slot": {
550 "help" : ("Automatically rebuild or reinstall packages when slot/sub-slot := "
551 "operator dependencies can be satisfied by a newer slot, so that "
552 "older packages slots will become eligible for removal by the "
553 "--depclean action as soon as possible."),
554 "choices" : true_y_or_n
557 "--rebuild-if-new-rev": {
558 "help" : "Rebuild packages when dependencies that are " + \
559 "used at both build-time and run-time are built, " + \
560 "if the dependency is not already installed with the " + \
561 "same version and revision.",
562 "choices" : true_y_or_n
565 "--rebuild-if-new-ver": {
566 "help" : "Rebuild packages when dependencies that are " + \
567 "used at both build-time and run-time are built, " + \
568 "if the dependency is not already installed with the " + \
569 "same version. Revision numbers are ignored.",
570 "choices" : true_y_or_n
573 "--rebuild-if-unbuilt": {
574 "help" : "Rebuild packages when dependencies that are " + \
575 "used at both build-time and run-time are built.",
576 "choices" : true_y_or_n
579 "--rebuilt-binaries": {
580 "help" : "replace installed packages with binary " + \
581 "packages that have been rebuilt",
582 "choices" : true_y_or_n
585 "--rebuilt-binaries-timestamp": {
586 "help" : "use only binaries that are newer than this " + \
587 "timestamp for --rebuilt-binaries",
592 "help" : "specify the target root filesystem for merging packages",
597 "help" : "modify interpretation of depedencies",
598 "choices" :("True", "rdeps")
603 "help" : "add specified packages to the world set " + \
604 "(inverse of --oneshot)",
605 "choices" : true_y_or_n
609 "help" : "identical to --noreplace",
610 "choices" : true_y_or_n
613 "--use-ebuild-visibility": {
614 "help" : "use unbuilt ebuild metadata for visibility checks on built packages",
615 "choices" : true_y_or_n
618 "--useoldpkg-atoms": {
619 "help" :"A space separated list of package names or slot atoms. " + \
620 "Emerge will prefer matching binary packages over newer unbuilt packages. ",
627 "help" : "use binary packages",
628 "choices" : true_y_or_n
633 "help" : "use only binary packages",
634 "choices" : true_y_or_n
639 "help" : "verbose output",
640 "choices" : true_y_or_n
644 parser = ArgumentParser(add_help=False)
646 for action_opt in actions:
647 parser.add_argument("--" + action_opt, action="store_true",
648 dest=action_opt.replace("-", "_"), default=False)
649 for myopt in options:
650 parser.add_argument(myopt, action="store_true",
651 dest=myopt.lstrip("--").replace("-", "_"), default=False)
652 for shortopt, longopt in shortmapping.items():
653 parser.add_argument("-" + shortopt, action="store_true",
654 dest=longopt.lstrip("--").replace("-", "_"), default=False)
655 for myalias, myopt in longopt_aliases.items():
656 parser.add_argument(myalias, action="store_true",
657 dest=myopt.lstrip("--").replace("-", "_"), default=False)
659 for myopt, kwargs in argument_options.items():
660 shortopt = kwargs.pop("shortopt", None)
662 if shortopt is not None:
663 args.append(shortopt)
664 parser.add_argument(dest=myopt.lstrip("--").replace("-", "_"),
667 tmpcmdline = insert_optional_args(tmpcmdline)
669 myoptions, myargs = parser.parse_known_args(args=tmpcmdline)
671 if myoptions.ask in true_y:
676 if myoptions.autounmask in true_y:
677 myoptions.autounmask = True
679 if myoptions.autounmask_unrestricted_atoms in true_y:
680 myoptions.autounmask_unrestricted_atoms = True
682 if myoptions.autounmask_keep_masks in true_y:
683 myoptions.autounmask_keep_masks = True
685 if myoptions.autounmask_write in true_y:
686 myoptions.autounmask_write = True
688 if myoptions.buildpkg in true_y:
689 myoptions.buildpkg = True
691 if myoptions.buildpkg_exclude:
692 bad_atoms = _find_bad_atoms(myoptions.buildpkg_exclude, less_strict=True)
693 if bad_atoms and not silent:
694 parser.error("Invalid Atom(s) in --buildpkg-exclude parameter: '%s'\n" % \
695 (",".join(bad_atoms),))
697 if myoptions.changed_use is not False:
698 myoptions.reinstall = "changed-use"
699 myoptions.changed_use = False
701 if myoptions.deselect in true_y:
702 myoptions.deselect = True
704 if myoptions.binpkg_respect_use is not None:
705 if myoptions.binpkg_respect_use in true_y:
706 myoptions.binpkg_respect_use = 'y'
708 myoptions.binpkg_respect_use = 'n'
710 if myoptions.complete_graph in true_y:
711 myoptions.complete_graph = True
713 myoptions.complete_graph = None
715 if myoptions.depclean_lib_check in true_y:
716 myoptions.depclean_lib_check = True
718 if myoptions.exclude:
719 bad_atoms = _find_bad_atoms(myoptions.exclude)
720 if bad_atoms and not silent:
721 parser.error("Invalid Atom(s) in --exclude parameter: '%s' (only package names and slot atoms (with wildcards) allowed)\n" % \
722 (",".join(bad_atoms),))
724 if myoptions.reinstall_atoms:
725 bad_atoms = _find_bad_atoms(myoptions.reinstall_atoms)
726 if bad_atoms and not silent:
727 parser.error("Invalid Atom(s) in --reinstall-atoms parameter: '%s' (only package names and slot atoms (with wildcards) allowed)\n" % \
728 (",".join(bad_atoms),))
730 if myoptions.rebuild_exclude:
731 bad_atoms = _find_bad_atoms(myoptions.rebuild_exclude)
732 if bad_atoms and not silent:
733 parser.error("Invalid Atom(s) in --rebuild-exclude parameter: '%s' (only package names and slot atoms (with wildcards) allowed)\n" % \
734 (",".join(bad_atoms),))
736 if myoptions.rebuild_ignore:
737 bad_atoms = _find_bad_atoms(myoptions.rebuild_ignore)
738 if bad_atoms and not silent:
739 parser.error("Invalid Atom(s) in --rebuild-ignore parameter: '%s' (only package names and slot atoms (with wildcards) allowed)\n" % \
740 (",".join(bad_atoms),))
742 if myoptions.usepkg_exclude:
743 bad_atoms = _find_bad_atoms(myoptions.usepkg_exclude)
744 if bad_atoms and not silent:
745 parser.error("Invalid Atom(s) in --usepkg-exclude parameter: '%s' (only package names and slot atoms (with wildcards) allowed)\n" % \
746 (",".join(bad_atoms),))
748 if myoptions.useoldpkg_atoms:
749 bad_atoms = _find_bad_atoms(myoptions.useoldpkg_atoms)
750 if bad_atoms and not silent:
751 parser.error("Invalid Atom(s) in --useoldpkg-atoms parameter: '%s' (only package names and slot atoms (with wildcards) allowed)\n" % \
752 (",".join(bad_atoms),))
754 if myoptions.fail_clean in true_y:
755 myoptions.fail_clean = True
757 if myoptions.getbinpkg in true_y:
758 myoptions.getbinpkg = True
760 myoptions.getbinpkg = None
762 if myoptions.getbinpkgonly in true_y:
763 myoptions.getbinpkgonly = True
765 myoptions.getbinpkgonly = None
767 if myoptions.keep_going in true_y:
768 myoptions.keep_going = True
770 myoptions.keep_going = None
772 if myoptions.package_moves in true_y:
773 myoptions.package_moves = True
775 if myoptions.quiet in true_y:
776 myoptions.quiet = True
778 myoptions.quiet = None
780 if myoptions.quiet_build in true_y:
781 myoptions.quiet_build = 'y'
783 if myoptions.quiet_fail in true_y:
784 myoptions.quiet_fail = 'y'
786 if myoptions.rebuild_if_new_slot in true_y:
787 myoptions.rebuild_if_new_slot = 'y'
789 if myoptions.rebuild_if_new_ver in true_y:
790 myoptions.rebuild_if_new_ver = True
792 myoptions.rebuild_if_new_ver = None
794 if myoptions.rebuild_if_new_rev in true_y:
795 myoptions.rebuild_if_new_rev = True
796 myoptions.rebuild_if_new_ver = None
798 myoptions.rebuild_if_new_rev = None
800 if myoptions.rebuild_if_unbuilt in true_y:
801 myoptions.rebuild_if_unbuilt = True
802 myoptions.rebuild_if_new_rev = None
803 myoptions.rebuild_if_new_ver = None
805 myoptions.rebuild_if_unbuilt = None
807 if myoptions.rebuilt_binaries in true_y:
808 myoptions.rebuilt_binaries = True
810 if myoptions.root_deps in true_y:
811 myoptions.root_deps = True
813 if myoptions.select in true_y:
814 myoptions.select = True
815 myoptions.oneshot = False
816 elif myoptions.select == "n":
817 myoptions.oneshot = True
819 if myoptions.selective in true_y:
820 myoptions.selective = True
822 if myoptions.backtrack is not None:
825 backtrack = int(myoptions.backtrack)
826 except (OverflowError, ValueError):
832 parser.error("Invalid --backtrack parameter: '%s'\n" % \
833 (myoptions.backtrack,))
835 myoptions.backtrack = backtrack
837 if myoptions.deep is not None:
839 if myoptions.deep == "True":
843 deep = int(myoptions.deep)
844 except (OverflowError, ValueError):
847 if deep is not True and deep < 0:
850 parser.error("Invalid --deep parameter: '%s'\n" % \
853 myoptions.deep = deep
857 if myoptions.jobs == "True":
861 jobs = int(myoptions.jobs)
865 if jobs is not True and \
869 parser.error("Invalid --jobs parameter: '%s'\n" % \
872 myoptions.jobs = jobs
874 if myoptions.load_average == "True":
875 myoptions.load_average = None
877 if myoptions.load_average:
879 load_average = float(myoptions.load_average)
883 if load_average <= 0.0:
886 parser.error("Invalid --load-average parameter: '%s'\n" % \
887 (myoptions.load_average,))
889 myoptions.load_average = load_average
891 if myoptions.rebuilt_binaries_timestamp:
893 rebuilt_binaries_timestamp = int(myoptions.rebuilt_binaries_timestamp)
895 rebuilt_binaries_timestamp = -1
897 if rebuilt_binaries_timestamp < 0:
898 rebuilt_binaries_timestamp = 0
900 parser.error("Invalid --rebuilt-binaries-timestamp parameter: '%s'\n" % \
901 (myoptions.rebuilt_binaries_timestamp,))
903 myoptions.rebuilt_binaries_timestamp = rebuilt_binaries_timestamp
905 if myoptions.use_ebuild_visibility in true_y:
906 myoptions.use_ebuild_visibility = True
911 if myoptions.usepkg in true_y:
912 myoptions.usepkg = True
914 myoptions.usepkg = None
916 if myoptions.usepkgonly in true_y:
917 myoptions.usepkgonly = True
919 myoptions.usepkgonly = None
921 if myoptions.verbose in true_y:
922 myoptions.verbose = True
924 myoptions.verbose = None
926 for myopt in options:
927 v = getattr(myoptions, myopt.lstrip("--").replace("-", "_"))
931 for myopt in argument_options:
932 v = getattr(myoptions, myopt.lstrip("--").replace("-", "_"), None)
936 if myoptions.searchdesc:
937 myoptions.search = True
939 for action_opt in actions:
940 v = getattr(myoptions, action_opt.replace("-", "_"))
943 multiple_actions(myaction, action_opt)
945 myaction = action_opt
947 if myaction is None and myoptions.deselect is True:
948 myaction = 'deselect'
952 return myaction, myopts, myfiles
954 def profile_check(trees, myaction):
955 if myaction in ("help", "info", "search", "sync", "version"):
957 for root_trees in trees.values():
958 if root_trees["root_config"].settings.profiles:
960 # generate some profile related warning messages
961 validate_ebuild_environment(trees)
962 msg = ("Your current profile is invalid. If you have just changed "
963 "your profile configuration, you should revert back to the "
964 "previous configuration. Allowed actions are limited to "
965 "--help, --info, --search, --sync, and --version.")
966 writemsg_level("".join("!!! %s\n" % l for l in textwrap.wrap(msg, 70)),
967 level=logging.ERROR, noiselevel=-1)
971 def emerge_main(args=None):
973 @param args: command arguments (default: sys.argv[1:])
979 args = portage._decode_argv(args)
981 # Disable color until we're sure that it should be enabled (after
982 # EMERGE_DEFAULT_OPTS has been parsed).
983 portage.output.havecolor = 0
985 # This first pass is just for options that need to be known as early as
986 # possible, such as --config-root. They will be parsed again later,
987 # together with EMERGE_DEFAULT_OPTS (which may vary depending on the
988 # the value of --config-root).
989 myaction, myopts, myfiles = parse_opts(args, silent=True)
990 if "--debug" in myopts:
991 os.environ["PORTAGE_DEBUG"] = "1"
992 if "--config-root" in myopts:
993 os.environ["PORTAGE_CONFIGROOT"] = myopts["--config-root"]
994 if "--root" in myopts:
995 os.environ["ROOT"] = myopts["--root"]
996 if "--prefix" in myopts:
997 os.environ["EPREFIX"] = myopts["--prefix"]
998 if "--accept-properties" in myopts:
999 os.environ["ACCEPT_PROPERTIES"] = myopts["--accept-properties"]
1000 if "--accept-restrict" in myopts:
1001 os.environ["ACCEPT_RESTRICT"] = myopts["--accept-restrict"]
1003 # optimize --help (no need to load config / EMERGE_DEFAULT_OPTS)
1004 if myaction == "help":
1007 elif myaction == "moo":
1008 print(COWSAY_MOO % platform.system())
1011 # Portage needs to ensure a sane umask for the files it creates.
1013 if myaction == "sync":
1014 portage._sync_disabled_warnings = True
1015 emerge_config = load_emerge_config(
1016 action=myaction, args=myfiles, opts=myopts)
1017 rval = profile_check(emerge_config.trees, emerge_config.action)
1018 if rval != os.EX_OK:
1022 if "--ignore-default-opts" not in myopts:
1023 tmpcmdline.extend(portage.util.shlex_split(
1024 emerge_config.target_config.settings.get(
1025 "EMERGE_DEFAULT_OPTS", "")))
1026 tmpcmdline.extend(args)
1027 emerge_config.action, emerge_config.opts, emerge_config.args = \
1028 parse_opts(tmpcmdline)
1031 return run_action(emerge_config)
1033 # Call destructors for our portdbapi instances.
1034 for x in emerge_config.trees.values():
1035 if "porttree" in x.lazy_items:
1037 x["porttree"].dbapi.close_caches()