Add a --package-moves[=n] option that can be used to control the
authorZac Medico <zmedico@gentoo.org>
Wed, 28 Jul 2010 15:14:34 +0000 (08:14 -0700)
committerZac Medico <zmedico@gentoo.org>
Wed, 28 Jul 2010 15:14:34 +0000 (08:14 -0700)
"Performing Global Updates" routine. This option is enabled by
default.

man/emerge.1
pym/_emerge/actions.py
pym/_emerge/help.py
pym/_emerge/main.py

index fbf668d71e9473e95899e843d0c71a8426f98894..15d7fcac527bd3cdc7a6a2940a3a512b444829eb 100644 (file)
@@ -468,6 +468,10 @@ for later updating.
 Only merge (or pretend to merge) the dependencies of the packages
 specified, not the packages themselves.
 .TP
+.BR "\-\-package\-moves[=n]"
+Perform package moves when necessary. This option
+is enabled by default.
+.TP
 .BR "\-\-pretend " (\fB\-p\fR)
 Instead of actually performing the merge, simply display what *would*
 have been installed if \fB\-\-pretend\fR weren't used.  Using \fB\-\-pretend\fR
index e014b16d4acc77edd29839c4cc9de710689dca43..16c329bbe5eb418d398dfca12b80ec69db536f34 100644 (file)
@@ -2289,7 +2289,8 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
                # the only one that's been synced here.
                action_metadata(settings, portdb, myopts, porttrees=[myportdir])
 
-       if _global_updates(trees, mtimedb["updates"]):
+       if myopts.get('--package-moves') != 'n' and \
+               _global_updates(trees, mtimedb["updates"]):
                mtimedb.commit()
                # Reload the whole config from scratch.
                settings, trees, mtimedb = load_emerge_config(trees=trees)
index fe616ca957d29405de450e524574985a051e3d88..9834c5c544031018d0408322474c9a60de48b1a4 100644 (file)
@@ -515,6 +515,12 @@ def help(myopts, havecolor=1):
                print("              Only merge (or pretend to merge) the dependencies of the")
                print("              specified packages, not the packages themselves.")
                print()
+               print("       " + green("--package-moves") + "[=%s]" % turquoise("n"))
+               desc = "Perform package moves when necessary. This option " + \
+                       "is enabled by default."
+               for line in wrap(desc, desc_width):
+                       print(desc_indent + line)
+               print()
                print("       "+green("--pretend")+" ("+green("-p")+" short option)")
                print("              Instead of actually performing the merge, simply display what")
                print("              ebuilds and tbz2s *would* have been installed if --pretend")
index e4449e8059302365487447d630fa12a3b1204cb7..5f0a7663af01c206f78bb50ee34b89c638aacf61 100644 (file)
@@ -398,6 +398,7 @@ def insert_optional_args(args):
                '--getbinpkgonly'        : ('n',),
                '--jobs'       : valid_integers,
                '--keep-going'           : ('n',),
+               '--package-moves'        : ('n',),
                '--rebuilt-binaries'     : ('n',),
                '--root-deps'  : ('rdeps',),
                '--select'               : ('n',),
@@ -638,6 +639,12 @@ def parse_opts(tmpcmdline, silent=False):
                        "choices"  : ("True", "n")
                },
 
+               "--package-moves": {
+                       "help"     : "perform package moves when necessary",
+                       "type"     : "choice",
+                       "choices"  : ("True", "n")
+               },
+
                "--rebuilt-binaries": {
                        "help"     : "replace installed packages with binary " + \
                                     "packages that have been rebuilt",
@@ -791,6 +798,9 @@ def parse_opts(tmpcmdline, silent=False):
        else:
                myoptions.keep_going = None
 
+       if myoptions.package_moves in ("True",):
+               myoptions.package_moves = True
+
        if myoptions.rebuilt_binaries in ("True",):
                myoptions.rebuilt_binaries = True
 
@@ -1247,7 +1257,14 @@ def emerge_main():
        if rval != os.EX_OK:
                return rval
 
+       tmpcmdline = []
+       if "--ignore-default-opts" not in myopts:
+               tmpcmdline.extend(settings["EMERGE_DEFAULT_OPTS"].split())
+       tmpcmdline.extend(sys.argv[1:])
+       myaction, myopts, myfiles = parse_opts(tmpcmdline)
+
        if myaction not in ('help', 'info', 'version') and \
+               myopts.get('--package-moves') != 'n' and \
                _global_updates(trees, mtimedb["updates"]):
                mtimedb.commit()
                # Reload the whole config from scratch.
@@ -1258,12 +1275,6 @@ def emerge_main():
        if xterm_titles:
                xtermTitle("emerge")
 
-       tmpcmdline = []
-       if "--ignore-default-opts" not in myopts:
-               tmpcmdline.extend(settings["EMERGE_DEFAULT_OPTS"].split())
-       tmpcmdline.extend(sys.argv[1:])
-       myaction, myopts, myfiles = parse_opts(tmpcmdline)
-
        if "--digest" in myopts:
                os.environ["FEATURES"] = os.environ.get("FEATURES","") + " digest"
                # Reload the whole config from scratch so that the portdbapi internal