From 920ba457e726298ae06af56dd3c733fd0871bdcd Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 10 Oct 2009 02:28:46 +0000 Subject: Remove world_sets support. svn path=/main/branches/2.1.7/; revision=14544 --- man/portage.5 | 10 ---------- pym/portage/_sets/files.py | 38 +++++--------------------------------- pym/portage/const.py | 1 - 3 files changed, 5 insertions(+), 44 deletions(-) diff --git a/man/portage.5 b/man/portage.5 index 50e7e98e5..cfded7e58 100644 --- a/man/portage.5 +++ b/man/portage.5 @@ -91,7 +91,6 @@ database to track installed packages .nf config world -world_sets .fi .SH "GLOSSARY" In the following sections, some terminology may be foreign to you or used @@ -865,15 +864,6 @@ games\-misc/fortune\-mod\-gentoo\-dev dev\-libs/uclibc app\-cdr/cdemu .fi -.TP -.BR world_sets -This is like the world file but instead of package atoms it contains -packages sets which always begin with the @ character. - -.I Example: -.nf -@system -.fi .RE .SH "REPORTING BUGS" Please report bugs via http://bugs.gentoo.org/ diff --git a/pym/portage/_sets/files.py b/pym/portage/_sets/files.py index cfa744d21..77793baa0 100644 --- a/pym/portage/_sets/files.py +++ b/pym/portage/_sets/files.py @@ -11,7 +11,7 @@ from portage import _encodings from portage import _unicode_decode from portage import _unicode_encode from portage.util import grabfile, write_atomic, ensure_dirs, normalize_path -from portage.const import USER_CONFIG_PATH, WORLD_FILE, WORLD_SETS_FILE +from portage.const import USER_CONFIG_PATH, WORLD_FILE from portage.localization import _ from portage.locks import lockfile, unlockfile from portage import portage_gid @@ -34,25 +34,16 @@ class WorldSet(EditablePackageSet): self._filename = os.path.join(os.sep, root, WORLD_FILE) self.loader = ItemFileLoader(self._filename, self._validate) self._mtime = None - - self._filename2 = os.path.join(os.sep, root, WORLD_SETS_FILE) - self.loader2 = ItemFileLoader(self._filename2, self._validate2) - self._mtime2 = None - + def _validate(self, atom): return ValidAtomValidator(atom) - def _validate2(self, setname): - return setname.startswith(SETPREFIX) - def write(self): write_atomic(self._filename, "".join(sorted("%s\n" % x for x in self._atoms))) - write_atomic(self._filename2, "\n".join(sorted(self._nonatoms))+"\n") - + def load(self): atoms = [] - nonatoms = [] atoms_changed = False # load atoms and non-atoms from different files so the worldfile is # backwards-compatible with older versions and other PMs, even though @@ -77,28 +68,9 @@ class WorldSet(EditablePackageSet): atoms_changed = True else: atoms.extend(self._atoms) - try: - mtime = os.stat(self._filename2).st_mtime - except (OSError, IOError): - mtime = None - if (not self._loaded or self._mtime2 != mtime): - try: - data, errors = self.loader2.load() - for fname in errors: - for e in errors[fname]: - self.errors.append(fname+": "+e) - except EnvironmentError as e: - if e.errno != errno.ENOENT: - raise - del e - data = {} - nonatoms = list(data) - self._mtime2 = mtime - atoms_changed = True - else: - nonatoms.extend(self._nonatoms) + if atoms_changed: - self._setAtoms(atoms+nonatoms) + self._setAtoms(atoms) def _ensure_dirs(self): ensure_dirs(os.path.dirname(self._filename), gid=portage_gid, mode=0o2750, mask=0o2) diff --git a/pym/portage/const.py b/pym/portage/const.py index 8b36aac14..890abe83b 100644 --- a/pym/portage/const.py +++ b/pym/portage/const.py @@ -47,7 +47,6 @@ VDB_PATH = "var/db/pkg" CACHE_PATH = "var/cache/edb" PRIVATE_PATH = "var/lib/portage" WORLD_FILE = PRIVATE_PATH + "/world" -WORLD_SETS_FILE = PRIVATE_PATH + "/world_sets" CONFIG_MEMORY_FILE = PRIVATE_PATH + "/config" NEWS_LIB_PATH = "var/lib/gentoo" -- cgit v1.2.3-1-g7c22