Enable atom::repo in the @selected package set.
authorZac Medico <zmedico@gentoo.org>
Sun, 5 Jun 2011 16:13:35 +0000 (09:13 -0700)
committerZac Medico <zmedico@gentoo.org>
Sun, 5 Jun 2011 16:13:35 +0000 (09:13 -0700)
pym/_emerge/create_world_atom.py
pym/portage/_sets/files.py

index 54964186c37b8ce54b8b7c2b4042b99600f87d1e..d0141f7d8fec7e17f72186baa55f5abaa4decf86 100644 (file)
@@ -1,6 +1,8 @@
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
+from portage.dep import _repo_separator
+
 def create_world_atom(pkg, args_set, root_config):
        """Create a new atom for the world file if one does not exist.  If the
        argument atom is precise enough to identify a specific slot then a slot
@@ -14,6 +16,8 @@ def create_world_atom(pkg, args_set, root_config):
                return None
        cp = arg_atom.cp
        new_world_atom = cp
+       if arg_atom.repo:
+               new_world_atom += _repo_separator + arg_atom.repo
        sets = root_config.sets
        portdb = root_config.trees["porttree"].dbapi
        vardb = root_config.trees["vartree"].dbapi
@@ -64,11 +68,13 @@ def create_world_atom(pkg, args_set, root_config):
                                matched_slots.add(mydb.aux_get(cpv, ["SLOT"])[0])
                        if len(matched_slots) == 1:
                                new_world_atom = slot_atom
+                               if arg_atom.repo:
+                                       new_world_atom += _repo_separator + arg_atom.repo
 
        if new_world_atom == sets["selected"].findAtomForPackage(pkg):
                # Both atoms would be identical, so there's nothing to add.
                return None
-       if not slotted:
+       if not slotted and not arg_atom.repo:
                # Unlike world atoms, system atoms are not greedy for slots, so they
                # can't be safely excluded from world if they are slotted.
                system_atom = sets["system"].findAtomForPackage(pkg)
index 8c8aeef4be5a56a7c23dc43b1fd8110d354b87d5..f19ecf6ce37151cc75d9d84baacb556b2c5d69ed 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 2007 Gentoo Foundation
+# Copyright 2007-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import errno
@@ -209,7 +209,7 @@ class WorldSelectedSet(EditablePackageSet):
        description = "Set of packages that were directly installed by the user"
        
        def __init__(self, eroot):
-               super(WorldSelectedSet, self).__init__()
+               super(WorldSelectedSet, self).__init__(allow_repo=True)
                # most attributes exist twice as atoms and non-atoms are stored in 
                # separate files
                self._lock = None
@@ -222,7 +222,7 @@ class WorldSelectedSet(EditablePackageSet):
                self._mtime2 = None
                
        def _validate(self, atom):
-               return ValidAtomValidator(atom)
+               return ValidAtomValidator(atom, allow_repo=True)
 
        def _validate2(self, setname):
                return setname.startswith(SETPREFIX)