Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r10611 - main/branches/2.1.2/bin
Date: Mon, 09 Jun 2008 14:22:52
Message-Id: E1K5iGj-0001LR-QZ@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-06-09 14:22:44 +0000 (Mon, 09 Jun 2008)
3 New Revision: 10611
4
5 Modified:
6 main/branches/2.1.2/bin/emerge
7 Log:
8 Add Package.counter and mtime attributes. (trunk r10587)
9
10
11 Modified: main/branches/2.1.2/bin/emerge
12 ===================================================================
13 --- main/branches/2.1.2/bin/emerge 2008-06-09 14:20:45 UTC (rev 10610)
14 +++ main/branches/2.1.2/bin/emerge 2008-06-09 14:22:44 UTC (rev 10611)
15 @@ -1422,13 +1422,13 @@
16 __slots__ = ("built", "cpv", "depth",
17 "installed", "metadata", "onlydeps", "operation",
18 "root_config", "type_name",
19 - "category", "cp", "cpv_split", "iuse",
20 + "category", "counter", "cp", "cpv_split", "iuse", "mtime",
21 "pf", "pv_split", "root", "slot", "slot_atom", "use")
22
23 metadata_keys = [
24 "CHOST", "COUNTER", "DEPEND", "EAPI", "IUSE", "KEYWORDS",
25 "LICENSE", "PDEPEND", "PROVIDE", "RDEPEND",
26 - "repository", "RESTRICT", "SLOT", "USE"]
27 + "repository", "RESTRICT", "SLOT", "USE", "_mtime_"]
28
29 def __init__(self, **kwargs):
30 Task.__init__(self, **kwargs)
31 @@ -1472,7 +1472,8 @@
32 """
33 Detect metadata updates and synchronize Package attributes.
34 """
35 - _wrapped_keys = frozenset(["IUSE", "SLOT", "USE"])
36 + _wrapped_keys = frozenset(
37 + ["COUNTER", "IUSE", "SLOT", "USE", "_mtime_"])
38
39 def __init__(self, pkg, metadata):
40 dict.__init__(self)
41 @@ -1499,6 +1500,22 @@
42 def _set_use(self, k, v):
43 self._pkg.use = self._pkg._use(v.split())
44
45 + def _set_counter(self, k, v):
46 + if isinstance(v, basestring):
47 + try:
48 + v = int(v.strip())
49 + except ValueError:
50 + v = 0
51 + self._pkg.counter = v
52 +
53 + def _set__mtime_(self, k, v):
54 + if isinstance(v, basestring):
55 + try:
56 + v = float(v.strip())
57 + except ValueError:
58 + v = 0
59 + self._pkg.mtime = v
60 +
61 def _get_hash_key(self):
62 hash_key = getattr(self, "_hash_key", None)
63 if hash_key is None:
64
65 --
66 gentoo-commits@l.g.o mailing list