Gentoo Archives: gentoo-commits

From: "Fabian Groffen (grobian)" <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r14183 - in main/branches/prefix/pym: _emerge portage/elog
Date: Fri, 04 Sep 2009 14:11:56
Message-Id: E1MjeKe-000386-Uf@stork.gentoo.org
1 Author: grobian
2 Date: 2009-09-04 19:20:24 +0000 (Fri, 04 Sep 2009)
3 New Revision: 14183
4
5 Modified:
6 main/branches/prefix/pym/_emerge/main.py
7 main/branches/prefix/pym/portage/elog/mod_save_summary.py
8 Log:
9 Merged from trunk -r14176:14182
10
11 | 14180 | Use _unicode_decode() on the string retunred from |
12 | zmedico | time.strftime(), in order to avoid a potential |
13 | | UnicodeDecodeError later. Thanks to Markus Duft |
14 | | <mduft@g.o> for reporting. |
15
16 | 14181 | Bug #283513 - Do not allow --noreplace together with |
17 | zmedico | --emptytree since it results in bogus masking messages. |
18
19 | 14182 | Fix typo from previous commit. |
20 | zmedico | |
21
22
23 Modified: main/branches/prefix/pym/_emerge/main.py
24 ===================================================================
25 --- main/branches/prefix/pym/_emerge/main.py 2009-09-03 03:27:19 UTC (rev 14182)
26 +++ main/branches/prefix/pym/_emerge/main.py 2009-09-04 19:20:24 UTC (rev 14183)
27 @@ -1144,6 +1144,12 @@
28 print "emerge: can't specify both of \"--tree\" and \"--columns\"."
29 return 1
30
31 + if '--emptytree' in myopts and '--noreplace' in myopts:
32 + writemsg_level("emerge: can't specify both of " + \
33 + "\"--emptytree\" and \"--noreplace\".\n",
34 + level=logging.ERROR, noiselevel=-1)
35 + return 1
36 +
37 if ("--quiet" in myopts):
38 spinner.update = spinner.update_quiet
39 portage.util.noiselimit = -1
40
41 Modified: main/branches/prefix/pym/portage/elog/mod_save_summary.py
42 ===================================================================
43 --- main/branches/prefix/pym/portage/elog/mod_save_summary.py 2009-09-03 03:27:19 UTC (rev 14182)
44 +++ main/branches/prefix/pym/portage/elog/mod_save_summary.py 2009-09-04 19:20:24 UTC (rev 14183)
45 @@ -7,6 +7,7 @@
46 import time
47 from portage import os
48 from portage import _encodings
49 +from portage import _unicode_decode
50 from portage import _unicode_encode
51 from portage.data import portage_uid, portage_gid
52 from portage.localization import _
53 @@ -26,8 +27,13 @@
54 encoding=_encodings['fs'], errors='strict'),
55 mode='a', encoding=_encodings['content'], errors='backslashreplace')
56 apply_permissions(elogfilename, mode=060, mask=0)
57 + time_str = time.strftime("%Y-%m-%d %H:%M:%S %Z",
58 + time.localtime(time.time()))
59 + # Avoid potential UnicodeDecodeError later.
60 + time_str = _unicode_decode(time_str,
61 + encoding=_encodings['content'], errors='replace')
62 elogfile.write(_(">>> Messages generated by process %(pid)d on %(time)s for package %(pkg)s:\n\n") %
63 - {"pid": os.getpid(), "time": time.strftime("%Y-%m-%d %H:%M:%S %Z", time.localtime(time.time())), "pkg": key})
64 + {"pid": os.getpid(), "time": time_str, "pkg": key})
65 elogfile.write(fulltext)
66 elogfile.write("\n")
67 elogfile.close()