* [gentoo-commits] proj/portage:master commit in: pym/portage/_sets/
@ 2011-06-06 2:01 Zac Medico
0 siblings, 0 replies; 23+ messages in thread
From: Zac Medico @ 2011-06-06 2:01 UTC (permalink / raw
To: gentoo-commits
commit: d90686c6b2dff96b883f6e1038e228d2b8351660
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 6 02:01:02 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jun 6 02:01:02 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d90686c6
InternalPackageSet: default allow_repo=True
Repo atoms are allowed more often than not, so it makes sense for this
class to allow them by default. The Atom constructor and isvalidatom()
functions default to allow_repo=False, which is sufficient to ensure
that repo atoms are prohibited when necessary.
---
pym/portage/_sets/base.py | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/pym/portage/_sets/base.py b/pym/portage/_sets/base.py
index b3bb06b..c8d3ae4 100644
--- a/pym/portage/_sets/base.py
+++ b/pym/portage/_sets/base.py
@@ -1,4 +1,4 @@
-# Copyright 2007-2010 Gentoo Foundation
+# Copyright 2007-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import sys
@@ -228,7 +228,13 @@ class EditablePackageSet(PackageSet):
raise NotImplementedError()
class InternalPackageSet(EditablePackageSet):
- def __init__(self, initial_atoms=None, allow_wildcard=False, allow_repo=False):
+ def __init__(self, initial_atoms=None, allow_wildcard=False, allow_repo=True):
+ """
+ Repo atoms are allowed more often than not, so it makes sense for this
+ class to allow them by default. The Atom constructor and isvalidatom()
+ functions default to allow_repo=False, which is sufficient to ensure
+ that repo atoms are prohibited when necessary.
+ """
super(InternalPackageSet, self).__init__(allow_wildcard=allow_wildcard, allow_repo=allow_repo)
if initial_atoms != None:
self.update(initial_atoms)
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/_sets/
@ 2011-07-21 16:15 Zac Medico
0 siblings, 0 replies; 23+ messages in thread
From: Zac Medico @ 2011-07-21 16:15 UTC (permalink / raw
To: gentoo-commits
commit: 02b28820ba8ea3e760110ae156c70e6ee0457048
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 21 16:14:50 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jul 21 16:14:50 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=02b28820
EverythingSet: always create SLOT atoms
Before it would only include the SLOT in the atom if there were
multiple slots installed. However, taht could lead to unwanted upgrades
as reported in bug #338959. Therefore, always create SLOT atoms.
---
pym/portage/_sets/dbapi.py | 20 ++++++--------------
1 files changed, 6 insertions(+), 14 deletions(-)
diff --git a/pym/portage/_sets/dbapi.py b/pym/portage/_sets/dbapi.py
index d32f1b7..0f238f0 100644
--- a/pym/portage/_sets/dbapi.py
+++ b/pym/portage/_sets/dbapi.py
@@ -31,20 +31,12 @@ class EverythingSet(PackageSet):
cp_list = self._db.cp_list
for cp in self._db.cp_all():
- cpv_list = cp_list(cp)
-
- if len(cpv_list) > 1:
- for cpv in cpv_list:
- slot, = aux_get(cpv, db_keys)
- atom = Atom("%s:%s" % (cp, slot))
- if self._filter:
- if self._filter(atom):
- myatoms.append(atom)
- else:
- myatoms.append(atom)
-
- else:
- atom = Atom(cp)
+ for cpv in cp_list(cp):
+ # NOTE: Create SLOT atoms even when there is only one
+ # SLOT installed, in order to avoid the possibility
+ # of unwanted upgrades as reported in bug #338959.
+ slot, = aux_get(cpv, db_keys)
+ atom = Atom("%s:%s" % (cp, slot))
if self._filter:
if self._filter(atom):
myatoms.append(atom)
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/_sets/
@ 2011-07-24 1:35 Zac Medico
0 siblings, 0 replies; 23+ messages in thread
From: Zac Medico @ 2011-07-24 1:35 UTC (permalink / raw
To: gentoo-commits
commit: 431d9054b74282e7d5d8b96d7eeaefaaab3f18a4
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 24 01:34:29 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jul 24 01:34:29 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=431d9054
LibraryConsumerSet: handle KeyError from dbapi
---
pym/portage/_sets/libs.py | 21 +++++++++++++--------
1 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/pym/portage/_sets/libs.py b/pym/portage/_sets/libs.py
index 3543b8d..6c5babc 100644
--- a/pym/portage/_sets/libs.py
+++ b/pym/portage/_sets/libs.py
@@ -1,12 +1,12 @@
-# Copyright 2007 Gentoo Foundation
+# Copyright 2007-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from __future__ import print_function
from portage.localization import _
from portage._sets.base import PackageSet
-from portage._sets import get_boolean
-from portage.versions import catpkgsplit
+from portage._sets import get_boolean, SetConfigError
+from portage.versions import cpv_getkey
import portage
class LibraryConsumerSet(PackageSet):
@@ -20,11 +20,16 @@ class LibraryConsumerSet(PackageSet):
def mapPathsToAtoms(self, paths):
rValue = set()
for p in paths:
- owners = self.dbapi._linkmap.getOwners(p)
- for cpv in owners:
- cat, pn = catpkgsplit(cpv)[:2]
- slot, = self.dbapi.aux_get(cpv, ["SLOT"])
- rValue.add("%s/%s:%s" % (cat, pn, slot))
+ for cpv in self.dbapi._linkmap.getOwners(p):
+ try:
+ slot, = self.dbapi.aux_get(cpv, ["SLOT"])
+ except KeyError:
+ # This is expected for preserved libraries
+ # of packages that have been uninstalled
+ # without replacement.
+ pass
+ else:
+ rValue.add("%s:%s" % (cpv_getkey(cpv), slot))
return rValue
class LibraryFileConsumerSet(LibraryConsumerSet):
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/_sets/
@ 2011-10-28 7:21 Zac Medico
0 siblings, 0 replies; 23+ messages in thread
From: Zac Medico @ 2011-10-28 7:21 UTC (permalink / raw
To: gentoo-commits
commit: 49cb5f96ebdb73e6b55ce171426fb2e1aefc01ae
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 28 07:21:05 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Oct 28 07:21:05 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=49cb5f96
SetConfig: use read_file/readfp for unicode
---
pym/portage/_sets/__init__.py | 38 ++++++++++++++++++++++++++++++++++----
1 files changed, 34 insertions(+), 4 deletions(-)
diff --git a/pym/portage/_sets/__init__.py b/pym/portage/_sets/__init__.py
index 34ca74b..88a4b3b 100644
--- a/pym/portage/_sets/__init__.py
+++ b/pym/portage/_sets/__init__.py
@@ -6,21 +6,27 @@ from __future__ import print_function
__all__ = ["SETPREFIX", "get_boolean", "SetConfigError",
"SetConfig", "load_default_config"]
+import io
+import logging
import sys
try:
- from configparser import NoOptionError
+ from configparser import NoOptionError, ParsingError
if sys.hexversion >= 0x3020000:
from configparser import ConfigParser as SafeConfigParser
else:
from configparser import SafeConfigParser
except ImportError:
- from ConfigParser import SafeConfigParser, NoOptionError
+ from ConfigParser import SafeConfigParser, NoOptionError, ParsingError
from portage import os
from portage import load_mod
+from portage import _unicode_decode
+from portage import _unicode_encode
+from portage import _encodings
from portage.const import USER_CONFIG_PATH, GLOBAL_CONFIG_PATH
from portage.const import _ENABLE_SET_CONFIG
from portage.exception import PackageSetNotFound
from portage.localization import _
+from portage.util import writemsg_level
SETPREFIX = "@"
@@ -48,7 +54,32 @@ class SetConfig(object):
})
if _ENABLE_SET_CONFIG:
- self._parser.read(paths)
+ # use read_file/readfp in order to control decoding of unicode
+ try:
+ # Python >=3.2
+ read_file = self._parser.read_file
+ except AttributeError:
+ read_file = self._parser.readfp
+
+ for p in paths:
+ f = None
+ try:
+ f = io.open(_unicode_encode(p,
+ encoding=_encodings['fs'], errors='strict'),
+ mode='r', encoding=_encodings['repo.content'],
+ errors='replace')
+ except EnvironmentError:
+ pass
+ else:
+ try:
+ read_file(f)
+ except ParsingError as e:
+ writemsg_level(_unicode_decode(
+ _("!!! Error while reading sets config file: %s\n")
+ ) % e, level=logging.ERROR, noiselevel=-1)
+ finally:
+ if f is not None:
+ f.close()
else:
self._create_default_config()
@@ -206,7 +237,6 @@ class SetConfig(object):
except KeyError:
raise PackageSetNotFound(setname)
myatoms = myset.getAtoms()
- parser = self._parser
if ignorelist is None:
ignorelist = set()
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/_sets/
@ 2012-05-14 0:51 Zac Medico
0 siblings, 0 replies; 23+ messages in thread
From: Zac Medico @ 2012-05-14 0:51 UTC (permalink / raw
To: gentoo-commits
commit: 741205453f86f64e5b7775250eb2ae650018f81b
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon May 14 00:51:40 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon May 14 00:51:40 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=74120545
_sets/dbapi: use _pkg_str + vercmp, not pkgcmp
---
pym/portage/_sets/dbapi.py | 14 +++++---------
1 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/pym/portage/_sets/dbapi.py b/pym/portage/_sets/dbapi.py
index 0f238f0..4982a92 100644
--- a/pym/portage/_sets/dbapi.py
+++ b/pym/portage/_sets/dbapi.py
@@ -1,10 +1,10 @@
-# Copyright 2007-2010 Gentoo Foundation
+# Copyright 2007-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import time
from portage import os
-from portage.versions import catpkgsplit, catsplit, pkgcmp, best
+from portage.versions import best, catsplit, vercmp
from portage.dep import Atom
from portage.localization import _
from portage._sets.base import PackageSet
@@ -72,18 +72,16 @@ class OwnerSet(PackageSet):
aux_keys = ["SLOT"]
if exclude_paths is None:
for link, p in vardb._owners.iter_owners(paths):
- cat, pn = catpkgsplit(link.mycpv)[:2]
slot, = aux_get(link.mycpv, aux_keys)
- rValue.add("%s/%s:%s" % (cat, pn, slot))
+ rValue.add("%s:%s" % (link.mycpv.cp, slot))
else:
all_paths = set()
all_paths.update(paths)
all_paths.update(exclude_paths)
exclude_atoms = set()
for link, p in vardb._owners.iter_owners(all_paths):
- cat, pn = catpkgsplit(link.mycpv)[:2]
slot, = aux_get(link.mycpv, aux_keys)
- atom = "%s/%s:%s" % (cat, pn, slot)
+ atom = "%s:%s" % (link.mycpv.cp, slot)
rValue.add(atom)
if p in exclude_paths:
exclude_atoms.add(atom)
@@ -184,9 +182,7 @@ class DowngradeSet(PackageSet):
ebuild = xmatch(xmatch_level, slot_atom)
if not ebuild:
continue
- ebuild_split = catpkgsplit(ebuild)[1:]
- installed_split = catpkgsplit(cpv)[1:]
- if pkgcmp(installed_split, ebuild_split) > 0:
+ if vercmp(cpv.version, ebuild.version) > 0:
atoms.append(slot_atom)
self._setAtoms(atoms)
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/_sets/
@ 2012-05-14 1:02 Zac Medico
0 siblings, 0 replies; 23+ messages in thread
From: Zac Medico @ 2012-05-14 1:02 UTC (permalink / raw
To: gentoo-commits
commit: 2ff656151b9d7ff747660a7eed787f039cc35dfa
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon May 14 01:02:11 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon May 14 01:02:11 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2ff65615
_sets/security: use _pkg_str + vercmp, not pkgcmp
---
pym/portage/_sets/security.py | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/pym/portage/_sets/security.py b/pym/portage/_sets/security.py
index 2d8fcf6..7e856bc 100644
--- a/pym/portage/_sets/security.py
+++ b/pym/portage/_sets/security.py
@@ -1,9 +1,9 @@
-# Copyright 2007 Gentoo Foundation
+# Copyright 2007-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import portage.glsa as glsa
from portage._sets.base import PackageSet
-from portage.versions import catpkgsplit, pkgcmp
+from portage.versions import vercmp
from portage._sets import get_boolean
__all__ = ["SecuritySet", "NewGlsaSet", "NewAffectedSet", "AffectedSet"]
@@ -45,12 +45,12 @@ class SecuritySet(PackageSet):
for atom in atomlist[:]:
cpv = self._portdbapi.xmatch("match-all", atom)[0]
slot = self._portdbapi.aux_get(cpv, ["SLOT"])[0]
- cps = "/".join(catpkgsplit(cpv)[0:2]) + ":" + slot
+ cps = "%s:%s" % (cpv.cp, slot)
if not cps in mydict:
mydict[cps] = (atom, cpv)
else:
other_cpv = mydict[cps][1]
- if pkgcmp(catpkgsplit(cpv)[1:], catpkgsplit(other_cpv)[1:]) > 0:
+ if vercmp(cpv.version, other_cpv.version) > 0:
atomlist.remove(mydict[cps][0])
mydict[cps] = (atom, cpv)
return atomlist
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/_sets/
@ 2012-09-01 4:29 Zac Medico
0 siblings, 0 replies; 23+ messages in thread
From: Zac Medico @ 2012-09-01 4:29 UTC (permalink / raw
To: gentoo-commits
commit: 9f1d501a12514c62efb8cd4afea7a68aaf9b5129
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 1 04:29:24 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Sep 1 04:29:24 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9f1d501a
Enable @module-rebuild for 2.1 branch.
---
pym/portage/_sets/__init__.py | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/pym/portage/_sets/__init__.py b/pym/portage/_sets/__init__.py
index c3b590e..3e6b0d8 100644
--- a/pym/portage/_sets/__init__.py
+++ b/pym/portage/_sets/__init__.py
@@ -131,6 +131,11 @@ class SetConfig(object):
parser.set("usersets", "directory", "%(PORTAGE_CONFIGROOT)setc/portage/sets")
parser.set("usersets", "world-candidate", "true")
+ parser.remove_section("module-rebuild")
+ parser.add_section("module-rebuild")
+ parser.set("module-rebuild", "class", "portage.sets.dbapi.OwnerSet")
+ parser.set("module-rebuild", "files", "/lib/modules")
+
def update(self, setname, options):
parser = self._parser
self.errors = []
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/_sets/
@ 2012-09-02 20:19 Zac Medico
0 siblings, 0 replies; 23+ messages in thread
From: Zac Medico @ 2012-09-02 20:19 UTC (permalink / raw
To: gentoo-commits
commit: ce16249658fa99a8b2051a19091b85f712f5dac1
Author: Martin Väth <vaeth at <mathematik.uni-wuerzburg.de>
AuthorDate: Sun Sep 2 20:18:20 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep 2 20:18:20 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ce162496
Add DateSet, bug #433704.
Allow sets of packages installed before or after a specific date.
The date may be specified explicitly (in dateformat which defaults to "%x %X")
or seconds since Epoch, or implicitly as an installation date or a filestamp.
For example, the following sets can be specified in /etc/portage/sets.conf:
[date1]
class = portage.sets.dbapi.DateSet
mode = older
date = 08/31/12 10:00:00
dateformat = %%x %%X
[date2]
class = portage.sets.dbapi.DateSet
mode = newer
seconds = 1346400000
[date3]
class = portage.sets.dbapi.DateSet
package = sys-devel/gcc:4.7
[date4]
class = portage.sets.dbapi.DateSet
filestamp = /usr/bin/gcc
---
pym/portage/_sets/dbapi.py | 68 ++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 68 insertions(+), 0 deletions(-)
diff --git a/pym/portage/_sets/dbapi.py b/pym/portage/_sets/dbapi.py
index 4982a92..03c4941 100644
--- a/pym/portage/_sets/dbapi.py
+++ b/pym/portage/_sets/dbapi.py
@@ -355,6 +355,74 @@ class AgeSet(EverythingSet):
singleBuilder = classmethod(singleBuilder)
+class DateSet(EverythingSet):
+ _operations = ["merge", "unmerge"]
+
+ def __init__(self, vardb, date, mode="older"):
+ super(DateSet, self).__init__(vardb)
+ self._mode = mode
+ self._date = date
+
+ def _filter(self, atom):
+
+ cpv = self._db.match(atom)[0]
+ path = self._db.getpath(cpv, filename="COUNTER")
+ date = os.stat(path).st_mtime
+ # Make sure inequality is _strict_ to exclude tested package
+ if ((self._mode == "older" and date < self._date) \
+ or (self._mode == "newer" and date > self._date)):
+ return True
+ else:
+ return False
+
+ def singleBuilder(cls, options, settings, trees):
+ vardbapi = trees["vartree"].dbapi
+ mode = options.get("mode", "older")
+ if str(mode).lower() not in ["newer", "older"]:
+ raise SetConfigError(_("invalid 'mode' value %s (use either 'newer' or 'older')") % mode)
+ package = options.get("package")
+ if package is not None:
+ format = "package"
+ else:
+ filestamp = options.get("filestamp")
+ if filestamp is not None:
+ format = "filestamp"
+ else:
+ seconds = options.get("seconds")
+ if seconds is not None:
+ format = "seconds"
+ else:
+ dateopt = options.get("date")
+ if dateopt is not None:
+ format = "date"
+ else:
+ raise SetConfigError(_("none of these options specified: 'package', 'filestamp', 'seconds', 'date'"))
+ if (format == "package"):
+ try:
+ cpv = vardbapi.match(package)[0]
+ path = vardbapi.getpath(cpv, filename="COUNTER")
+ date = os.stat(path).st_mtime
+ except ValueError:
+ raise SetConfigError(_("cannot determine installation date of package %s") % package)
+ elif (format == "filestamp"):
+ try:
+ date = os.stat(filestamp).st_mtime
+ except OSError:
+ raise SetConfigError(_("cannot determine 'filestamp' of '%s'") % filestamp)
+ elif (format == "seconds"):
+ # Do *not* test for integer:
+ # Modern filesystems support fractional seconds
+ date = seconds
+ else:
+ try:
+ dateformat = options.get("dateformat", "%x %X")
+ date = time.mktime(time.strptime(dateopt, dateformat))
+ except ValueError:
+ raise SetConfigError(_("'date=%s' does not match 'dateformat=%s'") % (dateopt, dateformat))
+ return DateSet(vardb=vardbapi, date=date, mode=mode)
+
+ singleBuilder = classmethod(singleBuilder)
+
class RebuiltBinaries(EverythingSet):
_operations = ('merge',)
_aux_keys = ('BUILD_TIME',)
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/_sets/
@ 2012-09-02 22:32 Zac Medico
0 siblings, 0 replies; 23+ messages in thread
From: Zac Medico @ 2012-09-02 22:32 UTC (permalink / raw
To: gentoo-commits
commit: 952d5c235ed1b440cd156654014fd51f55b638cb
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 2 22:31:20 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep 2 22:31:20 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=952d5c23
DateSet: only allow one format option in config
---
pym/portage/_sets/dbapi.py | 40 ++++++++++++++++++++++------------------
1 files changed, 22 insertions(+), 18 deletions(-)
diff --git a/pym/portage/_sets/dbapi.py b/pym/portage/_sets/dbapi.py
index 03c4941..a451bd5 100644
--- a/pym/portage/_sets/dbapi.py
+++ b/pym/portage/_sets/dbapi.py
@@ -380,24 +380,26 @@ class DateSet(EverythingSet):
mode = options.get("mode", "older")
if str(mode).lower() not in ["newer", "older"]:
raise SetConfigError(_("invalid 'mode' value %s (use either 'newer' or 'older')") % mode)
- package = options.get("package")
- if package is not None:
- format = "package"
- else:
- filestamp = options.get("filestamp")
- if filestamp is not None:
- format = "filestamp"
- else:
- seconds = options.get("seconds")
- if seconds is not None:
- format = "seconds"
- else:
- dateopt = options.get("date")
- if dateopt is not None:
- format = "date"
- else:
- raise SetConfigError(_("none of these options specified: 'package', 'filestamp', 'seconds', 'date'"))
+
+ formats = []
+ if options.get("package") is not None:
+ formats.append("package")
+ if options.get("filestamp") is not None:
+ formats.append("filestamp")
+ if options.get("seconds") is not None:
+ formats.append("seconds")
+ if options.get("date") is not None:
+ formats.append("date")
+
+ if not formats:
+ raise SetConfigError(_("none of these options specified: 'package', 'filestamp', 'seconds', 'date'"))
+ elif len(formats) > 1:
+ raise SetConfigError(_("no more than one of these options is allowed: 'package', 'filestamp', 'seconds', 'date'"))
+
+ format = formats[0]
+
if (format == "package"):
+ package = options.get("package")
try:
cpv = vardbapi.match(package)[0]
path = vardbapi.getpath(cpv, filename="COUNTER")
@@ -405,6 +407,7 @@ class DateSet(EverythingSet):
except ValueError:
raise SetConfigError(_("cannot determine installation date of package %s") % package)
elif (format == "filestamp"):
+ filestamp = options.get("filestamp")
try:
date = os.stat(filestamp).st_mtime
except OSError:
@@ -412,8 +415,9 @@ class DateSet(EverythingSet):
elif (format == "seconds"):
# Do *not* test for integer:
# Modern filesystems support fractional seconds
- date = seconds
+ date = options.get("seconds")
else:
+ dateopt = options.get("date")
try:
dateformat = options.get("dateformat", "%x %X")
date = time.mktime(time.strptime(dateopt, dateformat))
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/_sets/
@ 2012-09-04 20:41 Zac Medico
0 siblings, 0 replies; 23+ messages in thread
From: Zac Medico @ 2012-09-04 20:41 UTC (permalink / raw
To: gentoo-commits
commit: 3cb75111668cbe9bdfc16272afda6ebf5c297d83
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 4 20:25:28 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Sep 4 20:25:28 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3cb75111
Enable @live-rebuild for 2.1 branch.
---
pym/portage/_sets/__init__.py | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/pym/portage/_sets/__init__.py b/pym/portage/_sets/__init__.py
index 3e6b0d8..554c6ae 100644
--- a/pym/portage/_sets/__init__.py
+++ b/pym/portage/_sets/__init__.py
@@ -131,6 +131,12 @@ class SetConfig(object):
parser.set("usersets", "directory", "%(PORTAGE_CONFIGROOT)setc/portage/sets")
parser.set("usersets", "world-candidate", "true")
+ parser.remove_section("live-rebuild")
+ parser.add_section("live-rebuild")
+ parser.set("live-rebuild", "class", "portage.sets.dbapi.VariableSet")
+ parser.set("live-rebuild", "variable", "INHERITED")
+ parser.set("live-rebuild", "includes", "bzr cvs darcs git git-2 mercurial subversion tla")
+
parser.remove_section("module-rebuild")
parser.add_section("module-rebuild")
parser.set("module-rebuild", "class", "portage.sets.dbapi.OwnerSet")
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/_sets/
@ 2012-09-04 20:41 Zac Medico
0 siblings, 0 replies; 23+ messages in thread
From: Zac Medico @ 2012-09-04 20:41 UTC (permalink / raw
To: gentoo-commits
commit: 5f406f9ec956f751810dec41bd094364dfa1b834
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 4 20:40:21 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Sep 4 20:40:21 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5f406f9e
Enable @x11-module-rebuild for 2.1 branch.
---
pym/portage/_sets/__init__.py | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/pym/portage/_sets/__init__.py b/pym/portage/_sets/__init__.py
index 554c6ae..f92c2cb 100644
--- a/pym/portage/_sets/__init__.py
+++ b/pym/portage/_sets/__init__.py
@@ -142,6 +142,12 @@ class SetConfig(object):
parser.set("module-rebuild", "class", "portage.sets.dbapi.OwnerSet")
parser.set("module-rebuild", "files", "/lib/modules")
+ parser.remove_section("x11-module-rebuild")
+ parser.add_section("x11-module-rebuild")
+ parser.set("x11-module-rebuild", "class", "portage.sets.dbapi.OwnerSet")
+ parser.set("x11-module-rebuild", "files", "/usr/lib/xorg/modules")
+ parser.set("x11-module-rebuild", "exclude-files", "/usr/bin/Xorg")
+
def update(self, setname, options):
parser = self._parser
self.errors = []
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/_sets/
@ 2012-09-05 20:37 Zac Medico
0 siblings, 0 replies; 23+ messages in thread
From: Zac Medico @ 2012-09-05 20:37 UTC (permalink / raw
To: gentoo-commits
commit: 1ceea27a7cb658f0f592363a98bdef1fe2d1c552
Author: Martin Väth <vaeth at <mathematik.uni-wuerzburg.de>
AuthorDate: Wed Sep 5 20:36:43 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Sep 5 20:36:43 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1ceea27a
DateSet: use BUILD_TIME, bug #433964
---
pym/portage/_sets/dbapi.py | 36 +++++++++++++++++++++++-------------
1 files changed, 23 insertions(+), 13 deletions(-)
diff --git a/pym/portage/_sets/dbapi.py b/pym/portage/_sets/dbapi.py
index a451bd5..e75ceda 100644
--- a/pym/portage/_sets/dbapi.py
+++ b/pym/portage/_sets/dbapi.py
@@ -326,6 +326,7 @@ class CategorySet(PackageSet):
class AgeSet(EverythingSet):
_operations = ["merge", "unmerge"]
+ _aux_keys = ('BUILD_TIME',)
def __init__(self, vardb, mode="older", age=7):
super(AgeSet, self).__init__(vardb)
@@ -335,8 +336,12 @@ class AgeSet(EverythingSet):
def _filter(self, atom):
cpv = self._db.match(atom)[0]
- path = self._db.getpath(cpv, filename="COUNTER")
- age = (time.time() - os.stat(path).st_mtime) / (3600 * 24)
+ try:
+ date, = self._db.aux_get(cpv, self._aux_keys)
+ date = int(date)
+ except (KeyError, ValueError):
+ return bool(self._mode == "older")
+ age = (time.time() - date) / (3600 * 24)
if ((self._mode == "older" and age <= self._age) \
or (self._mode == "newer" and age >= self._age)):
return False
@@ -357,6 +362,7 @@ class AgeSet(EverythingSet):
class DateSet(EverythingSet):
_operations = ["merge", "unmerge"]
+ _aux_keys = ('BUILD_TIME',)
def __init__(self, vardb, date, mode="older"):
super(DateSet, self).__init__(vardb)
@@ -366,8 +372,11 @@ class DateSet(EverythingSet):
def _filter(self, atom):
cpv = self._db.match(atom)[0]
- path = self._db.getpath(cpv, filename="COUNTER")
- date = os.stat(path).st_mtime
+ try:
+ date, = self._db.aux_get(cpv, self._aux_keys)
+ date = int(date)
+ except (KeyError, ValueError):
+ return bool(self._mode == "older")
# Make sure inequality is _strict_ to exclude tested package
if ((self._mode == "older" and date < self._date) \
or (self._mode == "newer" and date > self._date)):
@@ -402,25 +411,26 @@ class DateSet(EverythingSet):
package = options.get("package")
try:
cpv = vardbapi.match(package)[0]
- path = vardbapi.getpath(cpv, filename="COUNTER")
- date = os.stat(path).st_mtime
- except ValueError:
+ date, = vardbapi.aux_get(cpv, ('BUILD_TIME',))
+ date = int(date)
+ except (KeyError, ValueError):
raise SetConfigError(_("cannot determine installation date of package %s") % package)
elif (format == "filestamp"):
filestamp = options.get("filestamp")
try:
- date = os.stat(filestamp).st_mtime
- except OSError:
+ date = int(os.stat(filestamp).st_mtime)
+ except (OSError, ValueError):
raise SetConfigError(_("cannot determine 'filestamp' of '%s'") % filestamp)
elif (format == "seconds"):
- # Do *not* test for integer:
- # Modern filesystems support fractional seconds
- date = options.get("seconds")
+ try:
+ date = int(options.get("seconds"))
+ except ValueError:
+ raise SetConfigError(_("option 'seconds' must be an integer"))
else:
dateopt = options.get("date")
try:
dateformat = options.get("dateformat", "%x %X")
- date = time.mktime(time.strptime(dateopt, dateformat))
+ date = int(time.mktime(time.strptime(dateopt, dateformat)))
except ValueError:
raise SetConfigError(_("'date=%s' does not match 'dateformat=%s'") % (dateopt, dateformat))
return DateSet(vardb=vardbapi, date=date, mode=mode)
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/_sets/
@ 2012-10-18 2:52 Zac Medico
0 siblings, 0 replies; 23+ messages in thread
From: Zac Medico @ 2012-10-18 2:52 UTC (permalink / raw
To: gentoo-commits
commit: d3b487536789d6331e7c85f839068be890b6112a
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 18 02:51:52 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Oct 18 02:51:52 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d3b48753
_sets/dbapi: fix for EAPI 5 sub-slot in SLOT
---
pym/portage/_sets/dbapi.py | 25 +++++++++++--------------
1 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/pym/portage/_sets/dbapi.py b/pym/portage/_sets/dbapi.py
index e75ceda..384fb3a 100644
--- a/pym/portage/_sets/dbapi.py
+++ b/pym/portage/_sets/dbapi.py
@@ -26,8 +26,7 @@ class EverythingSet(PackageSet):
def load(self):
myatoms = []
- db_keys = ["SLOT"]
- aux_get = self._db.aux_get
+ pkg_str = self._db._pkg_str
cp_list = self._db.cp_list
for cp in self._db.cp_all():
@@ -35,8 +34,8 @@ class EverythingSet(PackageSet):
# NOTE: Create SLOT atoms even when there is only one
# SLOT installed, in order to avoid the possibility
# of unwanted upgrades as reported in bug #338959.
- slot, = aux_get(cpv, db_keys)
- atom = Atom("%s:%s" % (cp, slot))
+ pkg = pkg_str(cpv, None)
+ atom = Atom("%s:%s" % (pkg.cp, pkg.slot))
if self._filter:
if self._filter(atom):
myatoms.append(atom)
@@ -68,20 +67,19 @@ class OwnerSet(PackageSet):
"""
rValue = set()
vardb = self._db
- aux_get = vardb.aux_get
- aux_keys = ["SLOT"]
+ pkg_str = vardb._pkg_str
if exclude_paths is None:
for link, p in vardb._owners.iter_owners(paths):
- slot, = aux_get(link.mycpv, aux_keys)
- rValue.add("%s:%s" % (link.mycpv.cp, slot))
+ pkg = pkg_str(link.mycpv, None)
+ rValue.add("%s:%s" % (pkg.cp, pkg.slot))
else:
all_paths = set()
all_paths.update(paths)
all_paths.update(exclude_paths)
exclude_atoms = set()
for link, p in vardb._owners.iter_owners(all_paths):
- slot, = aux_get(link.mycpv, aux_keys)
- atom = "%s:%s" % (link.mycpv.cp, slot)
+ pkg = pkg_str(link.mycpv, None)
+ atom = "%s:%s" % (pkg.cp, pkg.slot)
rValue.add(atom)
if p in exclude_paths:
exclude_atoms.add(atom)
@@ -173,12 +171,11 @@ class DowngradeSet(PackageSet):
xmatch = self._portdb.xmatch
xmatch_level = "bestmatch-visible"
cp_list = self._vardb.cp_list
- aux_get = self._vardb.aux_get
- aux_keys = ["SLOT"]
+ pkg_str = self._vardb._pkg_str
for cp in self._vardb.cp_all():
for cpv in cp_list(cp):
- slot, = aux_get(cpv, aux_keys)
- slot_atom = "%s:%s" % (cp, slot)
+ pkg = pkg_str(cpv, None)
+ slot_atom = "%s:%s" % (pkg.cp, pkg.slot)
ebuild = xmatch(xmatch_level, slot_atom)
if not ebuild:
continue
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/_sets/
@ 2012-10-18 3:02 Zac Medico
0 siblings, 0 replies; 23+ messages in thread
From: Zac Medico @ 2012-10-18 3:02 UTC (permalink / raw
To: gentoo-commits
commit: eae98cf5e150d0c65ed2d7f55bf0f4d01b3dfdbb
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 18 03:02:26 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Oct 18 03:02:26 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=eae98cf5
StaticFileSet: fix for EAPI 5 sub-slot in SLOT
---
pym/portage/_sets/files.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pym/portage/_sets/files.py b/pym/portage/_sets/files.py
index b891ea4..b839582 100644
--- a/pym/portage/_sets/files.py
+++ b/pym/portage/_sets/files.py
@@ -86,8 +86,8 @@ class StaticFileSet(EditablePackageSet):
for a in data:
matches = self.dbapi.match(a)
for cpv in matches:
- atoms.append("%s:%s" % (cpv_getkey(cpv),
- self.dbapi.aux_get(cpv, ["SLOT"])[0]))
+ pkg = self.dbapi._pkg_str(cpv, None)
+ atoms.append("%s:%s" % (pkg.cp, pkg.slot))
# In addition to any installed slots, also try to pull
# in the latest new slot that may be available.
atoms.append(a)
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/_sets/
@ 2012-10-18 3:06 Zac Medico
0 siblings, 0 replies; 23+ messages in thread
From: Zac Medico @ 2012-10-18 3:06 UTC (permalink / raw
To: gentoo-commits
commit: 19b88931cb438d058b60f2e56928839d12e22456
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 18 03:06:45 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Oct 18 03:06:45 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=19b88931
LibraryConsumerSet: fix for EAPI 5 sub-slot
---
pym/portage/_sets/libs.py | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/pym/portage/_sets/libs.py b/pym/portage/_sets/libs.py
index 6c5babc..27ef50e 100644
--- a/pym/portage/_sets/libs.py
+++ b/pym/portage/_sets/libs.py
@@ -1,4 +1,4 @@
-# Copyright 2007-2011 Gentoo Foundation
+# Copyright 2007-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from __future__ import print_function
@@ -6,7 +6,6 @@ from __future__ import print_function
from portage.localization import _
from portage._sets.base import PackageSet
from portage._sets import get_boolean, SetConfigError
-from portage.versions import cpv_getkey
import portage
class LibraryConsumerSet(PackageSet):
@@ -22,14 +21,14 @@ class LibraryConsumerSet(PackageSet):
for p in paths:
for cpv in self.dbapi._linkmap.getOwners(p):
try:
- slot, = self.dbapi.aux_get(cpv, ["SLOT"])
+ pkg = self.dbapi._pkg_str(cpv, None)
except KeyError:
# This is expected for preserved libraries
# of packages that have been uninstalled
# without replacement.
pass
else:
- rValue.add("%s:%s" % (cpv_getkey(cpv), slot))
+ rValue.add("%s:%s" % (pkg.cp, pkg.slot))
return rValue
class LibraryFileConsumerSet(LibraryConsumerSet):
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/_sets/
@ 2012-10-18 3:12 Zac Medico
0 siblings, 0 replies; 23+ messages in thread
From: Zac Medico @ 2012-10-18 3:12 UTC (permalink / raw
To: gentoo-commits
commit: bc63a48af0517b31872141aa06ed1a5f9b6b4f52
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 18 03:12:33 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Oct 18 03:12:33 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=bc63a48a
SecuritySet: fix for EAPI 5 sub-slot in SLOT
---
pym/portage/_sets/security.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pym/portage/_sets/security.py b/pym/portage/_sets/security.py
index 7e856bc..f8dbef2 100644
--- a/pym/portage/_sets/security.py
+++ b/pym/portage/_sets/security.py
@@ -44,8 +44,8 @@ class SecuritySet(PackageSet):
mydict = {}
for atom in atomlist[:]:
cpv = self._portdbapi.xmatch("match-all", atom)[0]
- slot = self._portdbapi.aux_get(cpv, ["SLOT"])[0]
- cps = "%s:%s" % (cpv.cp, slot)
+ pkg = self._portdbapi._pkg_str(cpv, None)
+ cps = "%s:%s" % (pkg.cp, pkg.slot)
if not cps in mydict:
mydict[cps] = (atom, cpv)
else:
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/_sets/
@ 2014-05-12 10:13 Alexander Berntsen
0 siblings, 0 replies; 23+ messages in thread
From: Alexander Berntsen @ 2014-05-12 10:13 UTC (permalink / raw
To: gentoo-commits
commit: 0c416cbb70858a5db2a1a23b2e90a95c0a1f2ea8
Author: Alexander Berntsen <bernalex <AT> gentoo <DOT> org>
AuthorDate: Mon May 12 10:12:42 2014 +0000
Commit: Alexander Berntsen <bernalex <AT> gentoo <DOT> org>
CommitDate: Mon May 12 10:12:42 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0c416cbb
Make b4d8e300c04b768be7cd5c respect max line width
---
pym/portage/_sets/profiles.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/pym/portage/_sets/profiles.py b/pym/portage/_sets/profiles.py
index 48c29de..7135d7f 100644
--- a/pym/portage/_sets/profiles.py
+++ b/pym/portage/_sets/profiles.py
@@ -33,7 +33,9 @@ class PackagesSystemSet(PackageSet):
writemsg_level("\nPackagesSystemSet: profile paths: %s\n" % \
(self._profile_paths,), level=logging.DEBUG, noiselevel=-1)
- mylist = [grabfile_package(os.path.join(x, "packages"), recursive=True, verify_eapi=True) for x in self._profile_paths]
+ mylist = [grabfile_package(os.path.join(x, "packages"),
+ recursive=True,
+ verify_eapi=True) for x in self._profile_paths]
if debug:
writemsg_level("\nPackagesSystemSet: raw packages: %s\n" % \
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/_sets/
@ 2014-12-08 0:42 Zac Medico
0 siblings, 0 replies; 23+ messages in thread
From: Zac Medico @ 2014-12-08 0:42 UTC (permalink / raw
To: gentoo-commits
commit: a4784ffb9406e69811aaf21818459aff00fadb6b
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 8 00:42:03 2014 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Dec 8 00:42:03 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a4784ffb
WorldSelectedSet._load: load all nested atoms/sets
Since commit 3e327e8c849cf6bfb84a3a3ec5c080ab4bc4653c,
AutounmaskTestCase.testAutounmaskAndSets fails due to incorrect logic
in WorldSelectedSet._load. Fix it to load all nested atoms/sets.
Fixes: 3e327e8c849c ("Split @selected into @selected-packages and @selected-sets")
---
pym/portage/_sets/files.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pym/portage/_sets/files.py b/pym/portage/_sets/files.py
index e76fa83..379ca30 100644
--- a/pym/portage/_sets/files.py
+++ b/pym/portage/_sets/files.py
@@ -222,7 +222,7 @@ class WorldSelectedSet(EditablePackageSet):
def load(self):
self._pkgset.load()
self._setset.load()
- self._setAtoms(self._pkgset._atoms | self._pkgset._nonatoms)
+ self._setAtoms(chain(self._pkgset, self._setset))
def lock(self):
self._pkgset.lock()
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/_sets/
@ 2014-12-10 20:14 Arfrever Frehtes Taifersar Arahesis
0 siblings, 0 replies; 23+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2014-12-10 20:14 UTC (permalink / raw
To: gentoo-commits
commit: 9e7fda6c40a3588d56aae74c6b769d5c651fe890
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Wed Dec 10 20:06:54 2014 +0000
Commit: Arfrever Frehtes Taifersar Arahesis <arfrever <AT> apache <DOT> org>
CommitDate: Wed Dec 10 20:06:54 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9e7fda6c
Update loading of configuration of sets.
- Ignore VCS directories.
- Ignore directories and files whose names start with "." or end with "~".
- Fix "BytesWarning: Comparison between bytes and string", which was occurring
when any directory in /etc/portage/sets exists.
---
pym/portage/_sets/__init__.py | 9 +++++++--
pym/portage/_sets/files.py | 9 +++++----
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/pym/portage/_sets/__init__.py b/pym/portage/_sets/__init__.py
index a652227..5e4a9dc 100644
--- a/pym/portage/_sets/__init__.py
+++ b/pym/portage/_sets/__init__.py
@@ -1,4 +1,4 @@
-# Copyright 2007-2012 Gentoo Foundation
+# Copyright 2007-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from __future__ import print_function
@@ -24,6 +24,7 @@ from portage import _unicode_decode
from portage import _unicode_encode
from portage import _encodings
from portage.const import USER_CONFIG_PATH, GLOBAL_CONFIG_PATH
+from portage.const import VCS_DIRS
from portage.const import _ENABLE_SET_CONFIG
from portage.exception import PackageSetNotFound
from portage.localization import _
@@ -307,10 +308,14 @@ def load_default_config(settings, trees):
if portage.const.EPREFIX:
global_config_path = os.path.join(portage.const.EPREFIX,
GLOBAL_CONFIG_PATH.lstrip(os.sep))
+ vcs_dirs = [_unicode_encode(x, encoding=_encodings['fs']) for x in VCS_DIRS]
def _getfiles():
for path, dirs, files in os.walk(os.path.join(global_config_path, "sets")):
+ for d in dirs:
+ if d in vcs_dirs or d.startswith(b".") or d.endswith(b"~"):
+ dirs.remove(d)
for f in files:
- if not f.startswith(b'.'):
+ if not f.startswith(b".") and not f.endswith(b"~"):
yield os.path.join(path, f)
dbapi = trees["porttree"].dbapi
diff --git a/pym/portage/_sets/files.py b/pym/portage/_sets/files.py
index 379ca30..9d25280 100644
--- a/pym/portage/_sets/files.py
+++ b/pym/portage/_sets/files.py
@@ -1,4 +1,4 @@
-# Copyright 2007-2013 Gentoo Foundation
+# Copyright 2007-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import errno
@@ -10,7 +10,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, VCS_DIRS, WORLD_FILE, WORLD_SETS_FILE
from portage.localization import _
from portage.locks import lockfile, unlockfile
from portage import portage_gid
@@ -142,6 +142,7 @@ class StaticFileSet(EditablePackageSet):
_("Directory path contains invalid character(s) for encoding '%s': '%s'") \
% (_encodings['fs'], directory))
+ vcs_dirs = [_unicode_encode(x, encoding=_encodings['fs']) for x in VCS_DIRS]
if os.path.isdir(directory):
directory = normalize_path(directory)
@@ -152,7 +153,7 @@ class StaticFileSet(EditablePackageSet):
except UnicodeDecodeError:
continue
for d in dirs[:]:
- if d[:1] == '.':
+ if d in vcs_dirs or d.startswith(b".") or d.endswith(b"~"):
dirs.remove(d)
for filename in files:
try:
@@ -160,7 +161,7 @@ class StaticFileSet(EditablePackageSet):
encoding=_encodings['fs'], errors='strict')
except UnicodeDecodeError:
continue
- if filename[:1] == '.':
+ if filename.startswith(".") or filename.endswith("~"):
continue
if filename.endswith(".metadata"):
continue
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/_sets/
@ 2015-02-11 16:17 Brian Dolbec
0 siblings, 0 replies; 23+ messages in thread
From: Brian Dolbec @ 2015-02-11 16:17 UTC (permalink / raw
To: gentoo-commits
commit: 2c7a6e862589c8f426a69c910a84991d4b8d3d5b
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 11 16:13:34 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Wed Feb 11 16:16:49 2015 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2c7a6e86
Revert "WorldSelectedSet._load: load all nested atoms/sets"
This reverts commit a4784ffb9406e69811aaf21818459aff00fadb6b.
This commit destroys the world file when you emerge multiple pkgs.
It saves only the last file merged.
Bug 539746.
---
pym/portage/_sets/files.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pym/portage/_sets/files.py b/pym/portage/_sets/files.py
index 9d25280..6bf05d4 100644
--- a/pym/portage/_sets/files.py
+++ b/pym/portage/_sets/files.py
@@ -223,7 +223,7 @@ class WorldSelectedSet(EditablePackageSet):
def load(self):
self._pkgset.load()
self._setset.load()
- self._setAtoms(chain(self._pkgset, self._setset))
+ self._setAtoms(self._pkgset._atoms | self._pkgset._nonatoms)
def lock(self):
self._pkgset.lock()
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/_sets/
@ 2015-02-11 19:11 Brian Dolbec
0 siblings, 0 replies; 23+ messages in thread
From: Brian Dolbec @ 2015-02-11 19:11 UTC (permalink / raw
To: gentoo-commits
commit: c3586c5e15c8373d08f9192713a2b03d4542faaf
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 11 18:53:26 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Wed Feb 11 19:05:47 2015 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c3586c5e
WorldSelectedSet: fix breakage for bug #539746
Since commit 3e327e8c849cf6bfb84a3a3ec5c080ab4bc4653c,
AutounmaskTestCase.testAutounmaskAndSets fails due to incorrect logic
in WorldSelectedSet._load. Fix it to load all nested atoms/sets. Also,
fix WorldSelectedSet.write so that self._pkgset and self._setset have
separate data structures. Shared data structures triggered the
corruption reported in bug #539746.
Fixes: 3e327e8c849c ("Split @selected into @selected-packages and @selected-sets")
X-Gentoo-Bug: 539746
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=539746
---
pym/portage/_sets/files.py | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/pym/portage/_sets/files.py b/pym/portage/_sets/files.py
index 6bf05d4..26ee094 100644
--- a/pym/portage/_sets/files.py
+++ b/pym/portage/_sets/files.py
@@ -215,15 +215,14 @@ class WorldSelectedSet(EditablePackageSet):
self._setset = WorldSelectedSetsSet(eroot)
def write(self):
- self._pkgset._atoms = self._atoms
+ self._pkgset._atoms = self._atoms.copy()
self._pkgset.write()
- self._setset._nonatoms = self._nonatoms
+ self._setset._nonatoms = self._nonatoms.copy()
self._setset.write()
def load(self):
- self._pkgset.load()
- self._setset.load()
- self._setAtoms(self._pkgset._atoms | self._pkgset._nonatoms)
+ # Iterating over these sets loads them automatically.
+ self._setAtoms(chain(self._pkgset, self._setset))
def lock(self):
self._pkgset.lock()
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/_sets/
@ 2015-03-09 19:53 Zac Medico
0 siblings, 0 replies; 23+ messages in thread
From: Zac Medico @ 2015-03-09 19:53 UTC (permalink / raw
To: gentoo-commits
commit: 0bdfd62184d3224c23f5293683ba6fb5c0769e6a
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 9 19:31:21 2015 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Mar 9 19:51:46 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=0bdfd621
WorldSelectedSet: fix load method for bug 542732
Since commit c3586c5e15c8373d08f9192713a2b03d4542faaf, the WorldSelectedSet
load method does not force the set to load if it has already been loaded.
Fix it to do so.
Fixes: c3586c5e15c8 ("WorldSelectedSet: fix breakage for bug #539746")
X-Gentoo-Bug: 542732
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=542732
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>
pym/portage/_sets/files.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/pym/portage/_sets/files.py b/pym/portage/_sets/files.py
index 26ee094..e045701 100644
--- a/pym/portage/_sets/files.py
+++ b/pym/portage/_sets/files.py
@@ -221,7 +221,10 @@ class WorldSelectedSet(EditablePackageSet):
self._setset.write()
def load(self):
- # Iterating over these sets loads them automatically.
+ # Iterating over these sets does not force them to load if they
+ # have been loaded previously.
+ self._pkgset.load()
+ self._setset.load()
self._setAtoms(chain(self._pkgset, self._setset))
def lock(self):
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/_sets/
@ 2015-12-09 4:25 Zac Medico
0 siblings, 0 replies; 23+ messages in thread
From: Zac Medico @ 2015-12-09 4:25 UTC (permalink / raw
To: gentoo-commits
commit: a4cb82f5214aa8f498c6bab53a54fc4f71c81ccc
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 9 04:24:01 2015 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Dec 9 04:24:09 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=a4cb82f5
SetConfig._create_default_config: add profile set definition
Fixes: 28828655da86 ("Support @profile package set for bug #532224")
pym/portage/_sets/__init__.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/pym/portage/_sets/__init__.py b/pym/portage/_sets/__init__.py
index 47be418..91f9dd1 100644
--- a/pym/portage/_sets/__init__.py
+++ b/pym/portage/_sets/__init__.py
@@ -118,6 +118,10 @@ class SetConfig(object):
parser.set("world", "class", "portage.sets.base.DummyPackageSet")
parser.set("world", "packages", "@profile @selected @system")
+ parser.remove_section("profile")
+ parser.add_section("profile")
+ parser.set("profile", "class", "portage.sets.ProfilePackageSet.ProfilePackageSet")
+
parser.remove_section("selected")
parser.add_section("selected")
parser.set("selected", "class", "portage.sets.files.WorldSelectedSet")
^ permalink raw reply related [flat|nested] 23+ messages in thread
end of thread, other threads:[~2015-12-09 4:25 UTC | newest]
Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-10 20:14 [gentoo-commits] proj/portage:master commit in: pym/portage/_sets/ Arfrever Frehtes Taifersar Arahesis
-- strict thread matches above, loose matches on Subject: below --
2015-12-09 4:25 Zac Medico
2015-03-09 19:53 Zac Medico
2015-02-11 19:11 Brian Dolbec
2015-02-11 16:17 Brian Dolbec
2014-12-08 0:42 Zac Medico
2014-05-12 10:13 Alexander Berntsen
2012-10-18 3:12 Zac Medico
2012-10-18 3:06 Zac Medico
2012-10-18 3:02 Zac Medico
2012-10-18 2:52 Zac Medico
2012-09-05 20:37 Zac Medico
2012-09-04 20:41 Zac Medico
2012-09-04 20:41 Zac Medico
2012-09-02 22:32 Zac Medico
2012-09-02 20:19 Zac Medico
2012-09-01 4:29 Zac Medico
2012-05-14 1:02 Zac Medico
2012-05-14 0:51 Zac Medico
2011-10-28 7:21 Zac Medico
2011-07-24 1:35 Zac Medico
2011-07-21 16:15 Zac Medico
2011-06-06 2:01 Zac Medico
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox