fixpackages: don't use PORTAGE_CALLER
authorZac Medico <zmedico@gentoo.org>
Sat, 15 Oct 2011 21:40:28 +0000 (14:40 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 15 Oct 2011 21:40:28 +0000 (14:40 -0700)
bin/fixpackages
pym/portage/_global_updates.py
pym/portage/tests/emerge/test_simple.py

index 5e1df704503f5119cd689aaf083a333111edbf3f..dc43ed2b352c32166524b296333698cdd3f99a6a 100755 (executable)
@@ -1,11 +1,12 @@
 #!/usr/bin/python
-# Copyright 1999-2006 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function
 
-import os,sys
-os.environ["PORTAGE_CALLER"]="fixpackages"
+import os
+import sys
+
 try:
        import portage
 except ImportError:
@@ -38,7 +39,7 @@ except (OSError, ValueError) as e:
        portage.writemsg("!!! %s\n" % str(e))
        del e
 
-_global_updates(mytrees, mtimedb["updates"])
+_global_updates(mytrees, mtimedb["updates"], if_mtime_changed=False)
 
 print()
 print("Done.")
index be8a73492043cc7c92c4cd7d0bfccb7f141cb88f..72fd5c4fd601a1d4f8825ee3eed0aeed549e3822 100644 (file)
@@ -15,7 +15,7 @@ from portage.update import grab_updates, parse_updates, update_config_files, upd
 from portage.util import grabfile, shlex_split, \
        writemsg, writemsg_stdout, write_atomic
 
-def _global_updates(trees, prev_mtimes, quiet=False):
+def _global_updates(trees, prev_mtimes, quiet=False, if_mtime_changed=True):
        """
        Perform new global updates if they exist in 'profiles/updates/'
        subdirectories of all active repositories (PORTDIR + PORTDIR_OVERLAY).
@@ -73,10 +73,10 @@ def _global_updates(trees, prev_mtimes, quiet=False):
                        continue
 
                try:
-                       if mysettings.get("PORTAGE_CALLER") == "fixpackages":
-                               update_data = grab_updates(updpath)
+                       if if_mtime_changed:
+                               update_data = grab_updates(updpath, prev_mtimes=prev_mtimes)
                        else:
-                               update_data = grab_updates(updpath, prev_mtimes)
+                               update_data = grab_updates(updpath)
                except DirectoryNotFound:
                        continue
                myupd = []
index 134d889baacd622e78df37787b8c6d593ac6af01..70d491845dca7fe4caef43c5c281f2d9e0e87bd8 100644 (file)
@@ -249,7 +249,8 @@ src_install() {
                        "PYTHONPATH" : pythonpath,
                }
 
-               dirs = [distdir, fake_bin, portage_tmpdir,
+               updates_dir = os.path.join(portdir, "profiles", "updates")
+               dirs = [distdir, fake_bin, portage_tmpdir, updates_dir,
                        user_config_dir, var_cache_edb]
                true_symlinks = ["chown", "chgrp"]
                true_binary = find_binary("true")
@@ -271,6 +272,11 @@ src_install() {
                        for cp, xml_data in metadata_xml_files:
                                with open(os.path.join(portdir, cp, "metadata.xml"), 'w') as f:
                                        f.write(playground.metadata_xml_template % xml_data)
+                       with open(os.path.join(updates_dir, "1Q-2010"), 'w') as f:
+                               f.write("""
+slotmove =app-doc/pms-3 2 3
+move dev-util/git dev-vcs/git
+""")
 
                        if debug:
                                # The subprocess inherits both stdout and stderr, for