Re: [gentoo-dev] A constructive reommendation on stablity improvemt
Hello Tim, Sunday, August 10, 2014, 4:41:09 AM, you wrote: I have no doubts that it could be done. What I'm perplexed about... The project consists of 3 major parts: Reporting (portage - Database - Processing) Database Processing Wouldn't it be logical to have Data Reporting unit working to some extent before everything else? It's difficult to code imagining the most important part of the game - portage Reporting unit. Database and Processing units both would require an expensive hardware to work, there should be some kind invitation from portage to spend a few thousand bucks. Not to mention time. If the invitation in Portage is there a lot of people can try out their own Database and Processing units. Sounds fair to me. FWIW: I have worked on a project for years where exception reporting was used as a pump handle for Bugzilla. It can be done; the trick is getting good data *in* and automating recognition of which failures are the same failure, doing NOTHING until some threshold number of failures are logged, and having a way to flag certain flavors of report as known-bogus. Here is an example failure report and resulting bug report: http://statistics.netbeans.org/exceptions/detail.do?id=205871 https://netbeans.org/bugzilla/show_bug.cgi?id=239261 That being said, it was done for ONE language in ONE application, where the error messages were detailed, meaningful and in a standard, Java-specific format. Doing that across the multiple languages, myriad bug tracking systems (including none at all), for all packages anyone ever might build on Linux sounds like a doomed enterprise. I'm not saying don't do it - such statistics might be interesting in aggregate - but don't have high hopes for it solving the world's problems, and plan on simply publishing those stats in a consumable way, promote their existence and plan on *attracting* developers and projects to *want* to consume those, as opposed to force-feeding every bug tracker in the universe, which I assure you, will not win friends. But the bottom line is: Write a patch. Prototype the server-side piece. People respond to working code; hypothetical discussions about what somebody else could or should do inevitably go nowhere. If you write something, nobody can say you're not committed to it, and *everybody* will agree on what the thing does because they can see it, rather than guessing at what files a bug report means and getting into arguments because people are using the same words for different things. You'll probably get a better sense of the problem space and what's easy and what's hard about it in the process, which will result in a better proposal. If it's just telling other people what they ought to do, then it looks like you're a dilettante, and people are rightly wary of that. -Tim -- Best regards, Igormailto:lanthrus...@gmail.com
Re: [gentoo-dev] A constructive reommendation on stablity improvemt
Hello Kent, Saturday, August 9, 2014, 11:49:43 PM, you wrote: We have a lot of uncertainty even about what to send and how. It is important for a data processor to understand what data is going to be fed before it's designed. If you have 1000 requests/second JSON parsing might be a problem and might require different solutions/hardware. If portage implements data the way it sees is - bad or good - that would reduce uncertainty and allow tools implemented. OK, let's have another year for everyone to think over it. On 10 August 2014 06:15, Igor lanthrus...@gmail.com wrote: Communication protocol is already there - it's HTTP, method POST HTTP protocol is already with Python - CURL, WGET A reliable server ready to accept data from portage is all so there - it's Apache web server. For the sake of this discussion, those protocols serve only as a channel. You have to send some kind of data structure over that channel indicating data about state. This requires the data to have a defined format, and potentially a versioning scheme for that format. And not just a defined format, like JSON for instance, but a defined structure of JSON representation with keys and values being clearly stipulated. You can't just send arbitrary freeform JSON to a random server and hope it pulls sense out of fat air. -- Kent KENTNL - https://metacpan.org/author/KENTNL -- Best regards, Igormailto:lanthrus...@gmail.com
Re: [gentoo-dev] A constructive reommendation on stablity improvemt
Hi, On 09/08/14 18:18, Igor wrote: Hi all, Hereby the summary of my personal suggestions to increase GENTOO stability and help it's maintainers and developers. 1. make.conf Add BUG_REPORT_URL http://;(or similar name) BUG_REPORT ON/OFF BUG_REPORT_LEVEL to make.conf Apart from the huge work to implement this, I think any automatic reporting of build failures will not be useful due to a very bad signal to noise ratio. Bug wrangling will be insane. What are the experiences in the industry. Is Mozilla getting anything useful out of their automatic crash reports? Cheers, Thomas -- Thomas Kahle http://dev.gentoo.org/~tomka/ signature.asc Description: OpenPGP digital signature
[gentoo-dev] gentoo-x86 tree cleanup for 'DESCRIPTION ends with a '.' character' warnings
Hello World! TL;DR: This evening I plan to mangle ~3000 ebuilds in the main tree by dropping trailing '.' in all 'DESCRIPTION=' fields (except etc. case) Long story: As you may know newest portage release 2.2.11 got a minor (but chatty) QA warning: DESCRIPTION ends with a '.' character https://github.com/gentoo/portage/commit/06637c4215d55c57517739214c6e0fd6f8f53914 https://bugs.gentoo.org/438976 About ~3000 ebuilds are affected, thus I've sketched a mangling script: https://github.com/trofi/gentoo-qa/blob/master/check_description.sh It is nice to use to convert all your large overlays you sync to gx86, etc. The script does not handle case of multiline description: DESCRIPTION=You have to clean that yourself. I'll mangle/commit one package at a time. Hope not to interfere with your workflow much. If you have any objections/thoughts please do say so. Thanks! -- Sergei signature.asc Description: PGP signature
[gentoo-dev] Last rites: dev-python/amara
# Tiziano Müller dev-z...@gentoo.org (10 Aug 2014) # Bundles an old (2.0.0) and vulnerable, but modified version of expat. # Testsuite is completely broken and upstream seems to be working on the # next rewrite instead of fixing this one. Nothing in the tree depends on it. # Removal in a month. dev-python/amara
[gentoo-dev] Automated Package Removal and Addition Tracker, for the week ending 2014-08-10 23h59 UTC
The attached list notes all of the packages that were added or removed from the tree, for the week ending 2014-08-10 23h59 UTC. Removals: dev-vcs/gitosis 2014-08-04 04:35:46 robbat2 dev-vcs/gitosis-gentoo 2014-08-04 04:35:46 robbat2 Additions: net-libs/txtorcon 2014-08-04 22:34:45 mrueg dev-ruby/prawn-table2014-08-06 01:20:33 mrueg sys-apps/cv 2014-08-06 02:43:45 zx2c4 media-libs/openctm 2014-08-07 16:50:58 amynka sci-libs/levmar 2014-08-07 16:55:20 amynka media-gfx/printrun 2014-08-07 17:03:47 amynka dev-python/alabaster2014-08-10 14:35:43 idella4 -- Robin Hugh Johnson Gentoo Linux Developer E-Mail : robb...@gentoo.org GnuPG FP : 11AC BA4F 4778 E3F6 E4ED F38E B27B 944E 3488 4E85 Removed Packages: dev-vcs/gitosis,removed,robbat2,2014-08-04 04:35:46 dev-vcs/gitosis-gentoo,removed,robbat2,2014-08-04 04:35:46 Added Packages: net-libs/txtorcon,added,mrueg,2014-08-04 22:34:45 dev-ruby/prawn-table,added,mrueg,2014-08-06 01:20:33 sys-apps/cv,added,zx2c4,2014-08-06 02:43:45 media-libs/openctm,added,amynka,2014-08-07 16:50:58 sci-libs/levmar,added,amynka,2014-08-07 16:55:20 media-gfx/printrun,added,amynka,2014-08-07 17:03:47 dev-python/alabaster,added,idella4,2014-08-10 14:35:43 Done.
Re: [gentoo-dev] A constructive reommendation on stablity improvemt
On 09/08/14 21:22, Jeroen Roovers wrote: A better bug reporting client will not deal with all the problems of bad reports (and probably exacerbate that problem), but it will stop spam and should encourage users to file more bug reports, and would be based on a vetted implementation that has already addressed many of the concerns that your proposal would need to address from the ground up. Absolutely! -- Thomas Kahle http://dev.gentoo.org/~tomka/ signature.asc Description: OpenPGP digital signature
Re: [gentoo-dev] gentoo-x86 tree cleanup for 'DESCRIPTION ends with a '.' character' warnings
Hi, On 2014-08-10 14:22, Sergei Trofimovich wrote: The script does not handle case of multiline description: DESCRIPTION=You have to clean that yourself. You could handle this by reading metadata/md5-cache/*/* instead of ebuild itself But is multiline DESCRIPTION something recommended as it should contain a short description ? -- Beber
[gentoo-dev] Supporting both Qt4 and Qt5 builds
Hi, I'm thinking of converting a few ebuilds (x11-libs/qwt, dev-libs/kqoauth, net-libs/qxmpp among them) to support building with both Qt4 and Qt5. Should this better be done by adding the corresponding useflags (qt4 and qt5 respectively) or by slotting? The pros and cons for each, off the top of my head: slotting: + Allows having different use flags for qt4 and qt5 builds (can't think why that would be needed in the above examples though). - Possibility of exponential growth of the number of slots in case slotting would be required according to some other criteria (again, can't think why that would be needed in the above examples). - Requires keeping two different copies of the same ebuild with basically the same build rules, with all the consequences. useflags: + Seems to be easier and doing the required trick. + app-text/poppler already does this. - Enabling support for previously disabled Qt version requires rebuilding the whole library twice. What's your opinion on this? I've attached the useflag-based variant as a draft. -- Georg Rudoy kqoauth-0.98-r2.ebuild Description: Binary data
Re: [gentoo-dev] Supporting both Qt4 and Qt5 builds
Am Sonntag, 10. August 2014, 14:51:45 schrieb Georg Rudoy: Hi, I'm thinking of converting a few ebuilds (x11-libs/qwt, dev-libs/kqoauth, net-libs/qxmpp among them) to support building with both Qt4 and Qt5. Should this better be done by adding the corresponding useflags (qt4 and qt5 respectively) or by slotting? The pros and cons for each, off the top of my head: slotting: + Allows having different use flags for qt4 and qt5 builds (can't think why that would be needed in the above examples though). - Possibility of exponential growth of the number of slots in case slotting would be required according to some other criteria (again, can't think why that would be needed in the above examples). - Requires keeping two different copies of the same ebuild with basically the same build rules, with all the consequences. useflags: + Seems to be easier and doing the required trick. + app-text/poppler already does this. - Enabling support for previously disabled Qt version requires rebuilding the whole library twice. What's your opinion on this? I've attached the useflag-based variant as a draft. Multibuild is prefered. -- Johannes Huber (johu) Gentoo Linux Developer / KDE Team GPG Key ID F3CFD2BD
Re: [gentoo-dev] gentoo-x86 tree cleanup for 'DESCRIPTION ends with a '.' character' warnings
On Sun, Aug 10, 2014 at 03:22:11PM +0300, Sergei Trofimovich wrote: Hello World! TL;DR: This evening I plan to mangle ~3000 ebuilds in the main tree by dropping trailing '.' in all 'DESCRIPTION=' fields (except etc. case) Long story: As you may know newest portage release 2.2.11 got a minor (but chatty) QA warning: DESCRIPTION ends with a '.' character Why is this a QA warning in the first place? I don't recall a policy mandating that descriptions can't end with '.'. I asked our QA lead about it and was told that he didn't recall that we have an official policy about it either. Also, the devmanual never mentions any such requirement. If someone can point me to something I'm missing, let me know. Otherwise, I think the warning should be removed. William signature.asc Description: Digital signature
Re: [gentoo-dev] gentoo-x86 tree cleanup for 'DESCRIPTION ends with a '.' character' warnings
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On 08/12/2014 03:48 AM, William Hubbs wrote: On Sun, Aug 10, 2014 at 03:22:11PM +0300, Sergei Trofimovich wrote: Hello World! TL;DR: This evening I plan to mangle ~3000 ebuilds in the main tree by dropping trailing '.' in all 'DESCRIPTION=' fields (except etc. case) Long story: As you may know newest portage release 2.2.11 got a minor (but chatty) QA warning: DESCRIPTION ends with a '.' character Why is this a QA warning in the first place? I don't recall a policy mandating that descriptions can't end with '.'. I asked our QA lead about it and was told that he didn't recall that we have an official policy about it either. Also, the devmanual never mentions any such requirement. If someone can point me to something I'm missing, let me know. Otherwise, I think the warning should be removed. William These links might be helpful: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=06637c4215d55c57517739214c6e0fd6f8f53914 https://bugs.gentoo.org/show_bug.cgi?id=438976 http://comments.gmane.org/gmane.linux.gentoo.devel/80786 What's still missing is a patch for devmanual (if we still really want to enforce this). Manuel -BEGIN PGP SIGNATURE- Version: GnuPG v2.0 iQJ8BAEBCgBmBQJT6XUCXxSAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ4MDA1RERERkM0ODM2QkE4MEY3NzY0N0M1 OEZCQTM2QzhEOUQ2MzVDAAoJEFj7o2yNnWNcJ8kP/RPn7b+TO/KJef2qdkuDQ7r9 6A86HEylCFMoKDJKk8jV4ne+Ns/zDydiD+JNWidOfdNpiVHbs9FA+WYW+mLzo4dB MvcsQ03afPC320z817RAYjPJAg+SRI+RmTy+0d9v65wuwjowNY+uOReCAvjEBiCu Qe5yEmMzhrGDud+xV7RveNsByXhSmZuDxFM+qsDc/+T2iBf+oX1x7jKSd9rMQP5d A/Q6dB3/54QQxkAkawFMuyYl/FX2WvE/QSDqJD8S8R7KWM2nEGNP9S7F83F6RZJd yPrV3GpVwrY/A7K995MHCkdM1/lSg2h0+48Q/P4frJCvE5yfAkYYmo0THx/7/DNA XVpcrq1/31wgmYATa1qacF6NHSwWqt0+JMQTn4HDw8WajIkdiMbJ4x9VIbFcvRT2 GcbsE2zPYEeybK7OdslA9V6Am8M0rDWby+r1S+QKwTvWXJDRQndUmrNTD5riLU8R RG+vhLm+U+u2tSn9Cy/jhl+H3mgVkZ1Fmk4Gnw4Nvob1Vxxc8bWzzppDCu2gZWVS paz97341YghYUdx3rknU8cat8J+sYeEx26b4s5Dvj9o9WOpQBIRMfzBQ3/nV8hK9 imlgNCHMaBYvwKM0/yn+7Jm/+JU+STmhexL0dBkja1LgfbGWcNRQeuXh881cU1WN Am75VVTGrpU9FPN8IqIc =bmFg -END PGP SIGNATURE-
Re: [gentoo-dev] gentoo-x86 tree cleanup for 'DESCRIPTION ends with a '.' character' warnings
On Tue, Aug 12, 2014 at 03:59:30AM +0200, Manuel Rüger wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA512 *snip* These links might be helpful: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=06637c4215d55c57517739214c6e0fd6f8f53914 https://bugs.gentoo.org/show_bug.cgi?id=438976 http://comments.gmane.org/gmane.linux.gentoo.devel/80786 What's still missing is a patch for devmanual (if we still really want to enforce this). I read the thread, and there was no concensus about making this a repoman check. Some people thought it was a good idea, but there was a feeling that this sort of thing is trivial and shouldn't be worried about. William signature.asc Description: Digital signature
Re: [gentoo-dev] gentoo-x86 tree cleanup for 'DESCRIPTION ends with a '.' character' warnings
how to i get off these mailing lists? On Mon, Aug 11, 2014 at 7:42 PM, William Hubbs willi...@gentoo.org wrote: On Tue, Aug 12, 2014 at 03:59:30AM +0200, Manuel Rüger wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA512 *snip* These links might be helpful: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=06637c4215d55c57517739214c6e0fd6f8f53914 https://bugs.gentoo.org/show_bug.cgi?id=438976 http://comments.gmane.org/gmane.linux.gentoo.devel/80786 What's still missing is a patch for devmanual (if we still really want to enforce this). I read the thread, and there was no concensus about making this a repoman check. Some people thought it was a good idea, but there was a feeling that this sort of thing is trivial and shouldn't be worried about. William -- Tyler Pohl
Re: [gentoo-dev] Supporting both Qt4 and Qt5 builds
On 10 August 2014 18:51, Georg Rudoy 0xd34df...@gmail.com wrote: Hi, I'm thinking of converting a few ebuilds (x11-libs/qwt, dev-libs/kqoauth, net-libs/qxmpp among them) to support building with both Qt4 and Qt5. Should this better be done by adding the corresponding useflags (qt4 and qt5 respectively) or by slotting? What's your opinion on this? The Qt team has always recommended the useflag method for packages that support more than one major version of Qt. This is also what we implement ourselves. So for consistency's sake, please stick with the useflags. -- Cheers, Ben | yngwin Gentoo developer
[gentoo-dev] Re: gentoo-x86 tree cleanup for 'DESCRIPTION ends with a '.' character' warnings
[Mailed direct and to list.] Tyler Pohl posted on Mon, 11 Aug 2014 21:20:17 -0700 as excerpted: how to i get off these mailing lists? Follow the instructions, as found in the headers of every mail on the list including the one you replied to, or the ones on the site you presumably signed up from? Seriously: Headers: List-Help: mailto:gentoo-dev+h...@lists.gentoo.org List-Unsubscribe: mailto:gentoo-dev+unsubscr...@lists.gentoo.org List-Subscribe: mailto:gentoo-dev+subscr...@lists.gentoo.org List-Id: Gentoo Linux mail gentoo-dev.gentoo.org Page at http://www.gentoo.org/main/en/lists.xml, clearly linked via the lists link on the gentoo homepage: quote To unsubscribe from a list, send an empty email to: listname+unsubscr...@lists.gentoo.org Note: You must use the identical address that you subscribed with to unsubscribe successfully. If your email address is now forwarded/ rewritten beyond your control, please contact the list owner via listname +ow...@lists.gentoo.org with a request for manual removal. You will then recieve a unsubscription confirmation request (double opt- in) from the list manager, that you must reply to if you wish to be unsubscribed. /quote -- Duncan - List replies preferred. No HTML msgs. Every nonfree program has a lord, a master -- and if you use the program, he is your master. Richard Stallman
[gentoo-portage-dev] [PATCH] Use __future__ to enable floating-point division of integers in Python 2.
In Python 2, the division ('/') operator defaults to integer (truncating) division when given integer argument. In Python 3, it performs floating-point division unconditionally instead. To overcome this difference and get a consistent behavior, integers were converted to floats explicitly in a few places. Instead, use a simpler 'from __future__ import division' statement that enables floating-point division globally in Python 2. Use it in all relevant files to get a consistent behavior, and use '//' appropriately whenever integer division is desired. Reviewed-by: Arfrever Frehtes Taifersar Arahesis arfre...@apache.org X-Pull-Request: https://github.com/gentoo/portage/pull/2 --- bin/quickpkg | 4 ++-- pym/_emerge/Scheduler.py | 2 +- pym/_emerge/actions.py | 10 +- pym/_emerge/depgraph.py | 4 ++-- pym/_emerge/sync/old_tree_timestamp.py | 12 +++- pym/portage/_emirrordist/FetchTask.py| 6 -- pym/portage/_sets/dbapi.py | 4 +++- pym/portage/cache/sqlite.py | 4 ++-- pym/portage/dbapi/vartree.py | 4 ++-- pym/portage/localization.py | 2 ++ pym/portage/output.py| 6 -- pym/portage/util/_eventloop/EventLoop.py | 8 +--- pym/portage/util/_eventloop/PollSelectAdapter.py | 6 -- 13 files changed, 43 insertions(+), 29 deletions(-) diff --git a/bin/quickpkg b/bin/quickpkg index 90277ad..035131e 100755 --- a/bin/quickpkg +++ b/bin/quickpkg @@ -2,7 +2,7 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function +from __future__ import division, print_function import errno import math @@ -264,7 +264,7 @@ def quickpkg_main(options, args, eout): size_str = 0 else: power_of_2 = math.log(size, 2) - power_of_2 = 10*int(power_of_2/10) + power_of_2 = 10*(power_of_2//10) unit = units.get(power_of_2) if unit: size = float(size)/(2**power_of_2) diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py index dd268f7..d6db311 100644 --- a/pym/_emerge/Scheduler.py +++ b/pym/_emerge/Scheduler.py @@ -1,7 +1,7 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function, unicode_literals +from __future__ import division, print_function, unicode_literals from collections import deque import gc diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index b935139..e482744 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -1,7 +1,7 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function, unicode_literals +from __future__ import division, print_function, unicode_literals import errno import logging @@ -1499,14 +1499,14 @@ def action_info(settings, trees, myopts, myfiles): vm_info = get_vm_info() if ram.total in vm_info: - line = %-9s %10d total % (KiB Mem:, vm_info[ram.total] / 1024) + line = %-9s %10d total % (KiB Mem:, vm_info[ram.total] // 1024) if ram.free in vm_info: - line += ,%10d free % (vm_info[ram.free] / 1024,) + line += ,%10d free % (vm_info[ram.free] // 1024,) append(line) if swap.total in vm_info: - line = %-9s %10d total % (KiB Swap:, vm_info[swap.total] / 1024) + line = %-9s %10d total % (KiB Swap:, vm_info[swap.total] // 1024) if swap.free in vm_info: - line += ,%10d free % (vm_info[swap.free] / 1024,) + line += ,%10d free % (vm_info[swap.free] // 1024,) append(line) lastSync = portage.grabfile(os.path.join( diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index acb1db1..a10297a 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -1,7 +1,7 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function, unicode_literals +from __future__ import division, print_function, unicode_literals import collections import errno @@ -8446,7 +8446,7 @@ def _backtrack_depgraph(settings, trees, myopts, myparams, myaction, myfiles, sp debug = --debug in myopts mydepgraph = None max_retries = myopts.get('--backtrack', 10) - max_depth = max(1, (max_retries + 1) / 2) + max_depth = max(1, (max_retries + 1) // 2) allow_backtracking =
[gentoo-portage-dev] [PATCH v2] Use __future__ to enable floating-point division of integers in Python 2.
In Python 2, the division ('/') operator defaults to integer (truncating) division when given integer argument. In Python 3, it performs floating-point division unconditionally instead. To overcome this difference and get a consistent behavior, integers were converted to floats explicitly in a few places. Instead, use a simpler 'from __future__ import division' statement that enables floating-point division globally in Python 2. Use it in all relevant files to get a consistent behavior, and use '//' appropriately whenever integer division is desired. X-Pull-Request: https://github.com/gentoo/portage/pull/2 --- pym/_emerge/Scheduler.py | 2 +- pym/_emerge/actions.py | 2 +- pym/_emerge/depgraph.py | 4 ++-- pym/_emerge/sync/old_tree_timestamp.py | 10 ++ pym/portage/_emirrordist/FetchTask.py| 4 +++- pym/portage/_sets/dbapi.py | 2 ++ pym/portage/cache/sqlite.py | 4 ++-- pym/portage/dbapi/vartree.py | 4 ++-- pym/portage/localization.py | 2 ++ pym/portage/output.py| 6 -- pym/portage/util/_eventloop/EventLoop.py | 6 -- pym/portage/util/_eventloop/PollSelectAdapter.py | 4 +++- 12 files changed, 32 insertions(+), 18 deletions(-) diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py index dd268f7..d6db311 100644 --- a/pym/_emerge/Scheduler.py +++ b/pym/_emerge/Scheduler.py @@ -1,7 +1,7 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function, unicode_literals +from __future__ import division, print_function, unicode_literals from collections import deque import gc diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index b935139..fd2ad89 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -1,7 +1,7 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function, unicode_literals +from __future__ import division, print_function, unicode_literals import errno import logging diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index acb1db1..a10297a 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -1,7 +1,7 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function, unicode_literals +from __future__ import division, print_function, unicode_literals import collections import errno @@ -8446,7 +8446,7 @@ def _backtrack_depgraph(settings, trees, myopts, myparams, myaction, myfiles, sp debug = --debug in myopts mydepgraph = None max_retries = myopts.get('--backtrack', 10) - max_depth = max(1, (max_retries + 1) / 2) + max_depth = max(1, (max_retries + 1) // 2) allow_backtracking = max_retries 0 backtracker = Backtracker(max_depth) backtracked = 0 diff --git a/pym/_emerge/sync/old_tree_timestamp.py b/pym/_emerge/sync/old_tree_timestamp.py index 9b35aed..8411cae 100644 --- a/pym/_emerge/sync/old_tree_timestamp.py +++ b/pym/_emerge/sync/old_tree_timestamp.py @@ -1,6 +1,8 @@ # Copyright 2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 +from __future__ import division + import locale import logging import time @@ -27,16 +29,16 @@ def whenago(seconds): out = [] if sec 60: - mins = sec / 60 + mins = sec // 60 sec = sec % 60 if mins 60: - hrs = mins / 60 + hrs = mins // 60 mins = mins % 60 if hrs 24: - days = hrs / 24 + days = hrs // 24 hrs = hrs % 24 if days 365: - years = days / 365 + years = days // 365 days = days % 365 if years: diff --git a/pym/portage/_emirrordist/FetchTask.py b/pym/portage/_emirrordist/FetchTask.py index 66c41c1..20e93fc 100644 --- a/pym/portage/_emirrordist/FetchTask.py +++ b/pym/portage/_emirrordist/FetchTask.py @@ -1,6 +1,8 @@ # Copyright 2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 +from __future__ import division + import collections import errno import logging @@ -242,7 +244,7 @@ class FetchTask(CompositeTask): remaining_tries = self.config.options.tries - len(self._tried_uris) if remaining_tries 0: - if remaining_tries = self.config.options.tries / 2: + if remaining_tries = self.config.options.tries // 2: while self._primaryuri_stack: uri =
Re: [gentoo-portage-dev] [PATCH] Use __future__ to enable floating-point division of integers in Python 2.
Dnia 2014-08-06, o godz. 19:26:08 Michał Górny mgo...@gentoo.org napisał(a): In Python 2, the division ('/') operator defaults to integer (truncating) division when given integer argument. In Python 3, it performs floating-point division unconditionally instead. To overcome this difference and get a consistent behavior, integers were converted to floats explicitly in a few places. Instead, use a simpler 'from __future__ import division' statement that enables floating-point division globally in Python 2. The updated patch is in git now. -- Best regards, Michał Górny signature.asc Description: PGP signature
Re: [gentoo-portage-dev] [PATCH] QA-warn about systemd units using /etc/conf.d.
Dnia 2014-07-25, o godz. 00:25:38 Michał Górny mgo...@gentoo.org napisał(a): --- bin/misc-functions.sh | 15 +++ 1 file changed, 15 insertions(+) This one's in git now. -- Best regards, Michał Górny signature.asc Description: PGP signature
Re: [gentoo-portage-dev] [PATCH] Use __future__ to enable floating-point division of integers in Python 2.
Dnia 2014-08-11, o godz. 21:51:34 Michał Górny mgo...@gentoo.org napisał(a): In Python 2, the division ('/') operator defaults to integer (truncating) division when given integer argument. In Python 3, it performs floating-point division unconditionally instead. To overcome this difference and get a consistent behavior, integers were converted to floats explicitly in a few places. Instead, use a simpler 'from __future__ import division' statement that enables floating-point division globally in Python 2. Use it in all relevant files to get a consistent behavior, and use '//' appropriately whenever integer division is desired. More specifically, this one's in git. Sorry for the extra thread. -- Best regards, Michał Górny signature.asc Description: PGP signature