From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 65C59138206 for ; Wed, 17 Jan 2018 19:39:34 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6B719E0932; Wed, 17 Jan 2018 19:39:33 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 4930EE0932 for ; Wed, 17 Jan 2018 19:39:32 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 37E36335C3E for ; Wed, 17 Jan 2018 19:39:32 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id CE2B11BA for ; Wed, 17 Jan 2018 19:39:28 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1516217924.e81497dec819dbfc8e85e533db30d751fadaad81.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/doins.py X-VCS-Directories: bin/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: e81497dec819dbfc8e85e533db30d751fadaad81 X-VCS-Branch: master Date: Wed, 17 Jan 2018 19:39:28 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 30ad9b7c-1d06-49d1-b32c-9b379c6fd91e X-Archives-Hash: 50196a49103b86953cbdd7d3a5702170 commit: e81497dec819dbfc8e85e533db30d751fadaad81 Author: Zac Medico gentoo org> AuthorDate: Mon Jan 15 04:36:39 2018 +0000 Commit: Zac Medico gentoo org> CommitDate: Wed Jan 17 19:38:44 2018 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=e81497de bin/doins.py: avoid timestamp precision loss with python2 (bug 642632) Since conversion to/from float results in timestamp precision loss with less than Python 3.3, do not use the python implementation in this case. Bug: https://bugs.gentoo.org/642632 Fixes: d459f05ff71f ("bin/doins.py: implement install -p option (bug 642632)") bin/doins.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/doins.py b/bin/doins.py index 9e6566097..6bc30c90b 100644 --- a/bin/doins.py +++ b/bin/doins.py @@ -110,6 +110,10 @@ def _parse_install_options( parser.add_argument('-p', '--preserve-timestamps', action='store_true') split_options = shlex.split(options) namespace, remaining = parser.parse_known_args(split_options) + if namespace.preserve_timestamps and sys.version_info < (3, 3): + # -p is not supported in this case, since timestamps cannot + # be preserved with full precision + remaining.append('-p') # Because parsing '--mode' option is partially supported. If unknown # arg for --mode is passed, namespace.mode is set to None. if remaining or namespace.mode is None: