diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-10-26 06:10:58 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-10-26 06:10:58 +0000 |
commit | a2c83b84058aa9aa59be6cee2449e81c70ae02fe (patch) | |
tree | 1480f33b17e9df2d6d3647035479690c7a486426 | |
parent | 0c140401072f7dba238b0cbe6c347d5109b01b2d (diff) | |
download | portage-a2c83b84058aa9aa59be6cee2449e81c70ae02fe.tar.gz portage-a2c83b84058aa9aa59be6cee2449e81c70ae02fe.tar.bz2 portage-a2c83b84058aa9aa59be6cee2449e81c70ae02fe.zip |
Make emerge add sets to the world file as one would expect.
svn path=/main/trunk/; revision=8308
-rw-r--r-- | pym/_emerge/__init__.py | 20 | ||||
-rw-r--r-- | pym/portage/sets/base.py | 19 |
2 files changed, 31 insertions, 8 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 17e130c22..e6ccc39b8 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -3520,14 +3520,27 @@ class depgraph(object): if myfavkey in added_favorites: continue added_favorites.add(myfavkey) - world_set.add(myfavkey) - print ">>> Recording",myfavkey,"in \"world\" favorites file..." except portage.exception.InvalidDependString, e: writemsg("\n\n!!! '%s' has invalid PROVIDE: %s\n" % \ (pkg_key, str(e)), noiselevel=-1) writemsg("!!! see '%s'\n\n" % os.path.join( root, portage.VDB_PATH, pkg_key, "PROVIDE"), noiselevel=-1) del e + all_added = [] + for k in self._sets: + if k in ("args", "world"): + continue + s = SETPREFIX + k + if s in world_set: + continue + all_added.append(SETPREFIX + k) + all_added.extend(added_favorites) + all_added.sort() + for a in all_added: + print ">>> Recording %s in \"world\" favorites file..." % \ + colorize("INFORM", a) + if all_added: + world_set.update(all_added) world_set.unlock() def loadResumeCommand(self, resume_data): @@ -6171,8 +6184,7 @@ def action_build(settings, trees, mtimedb, pkglist.append(pkg) else: pkglist = mydepgraph.altlist() - if favorites: - mydepgraph.saveNomergeFavorites() + mydepgraph.saveNomergeFavorites() del mydepgraph mergetask = MergeTask(settings, trees, myopts) retval = mergetask.merge(pkglist, favorites, mtimedb) diff --git a/pym/portage/sets/base.py b/pym/portage/sets/base.py index 1f3858137..c22ee9953 100644 --- a/pym/portage/sets/base.py +++ b/pym/portage/sets/base.py @@ -26,7 +26,7 @@ class PackageSet(object): self._nonatoms = set() def __contains__(self, atom): - return atom in self.getAtoms() + return atom in self.getAtoms() or atom in self._nonatoms def __iter__(self): for x in self.getAtoms(): @@ -122,9 +122,20 @@ class EditablePackageSet(PackageSet): def update(self, atoms): self.getAtoms() - self._atoms.update(atoms) - self._updateAtomMap(atoms=atoms) - self.write() + modified = False + normal_atoms = [] + for a in atoms: + if isvalidatom(a): + normal_atoms.append(a) + else: + modified = True + self._nonatoms.add(a) + if normal_atoms: + modified = True + self._atoms.update(normal_atoms) + self._updateAtomMap(atoms=normal_atoms) + if modified: + self.write() def add(self, atom): self.update([atom]) |