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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id D649F158009 for ; Thu, 29 Jun 2023 08:23:00 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E69DBE081A; Thu, 29 Jun 2023 08:22:59 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C8777E081A for ; Thu, 29 Jun 2023 08:22:59 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C4221340F87 for ; Thu, 29 Jun 2023 08:22:58 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 4962DA9B for ; Thu, 29 Jun 2023 08:22:57 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1688026973.59973d0f5829ebbae615a001a97abb652431a61b.sam@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/ X-VCS-Repository: proj/portage X-VCS-Files: lib/portage/gpkg.py X-VCS-Directories: lib/portage/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 59973d0f5829ebbae615a001a97abb652431a61b X-VCS-Branch: master Date: Thu, 29 Jun 2023 08:22:57 +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-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 657765fe-8fcf-423a-acef-208475df5a19 X-Archives-Hash: 5533aaa9cd8f14e61064e25fe4a2139f commit: 59973d0f5829ebbae615a001a97abb652431a61b Author: Sheng Yu protonmail com> AuthorDate: Sat Jun 24 20:28:20 2023 +0000 Commit: Sam James gentoo org> CommitDate: Thu Jun 29 08:22:53 2023 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=59973d0f gpkg: fix incorrect gpkg timestamp [sam: Quoting dwfreed from the bug: "utcnow() produces a naive datetime object, and most methods of datetime objects treat naive datetime objects as local time."] Bug: https://bugs.gentoo.org/909067 Signed-off-by: Sheng Yu protonmail.com> Closes: https://github.com/gentoo/portage/pull/1060 Signed-off-by: Sam James gentoo.org> lib/portage/gpkg.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/portage/gpkg.py b/lib/portage/gpkg.py index 7451c68c2..6ed2a6d00 100644 --- a/lib/portage/gpkg.py +++ b/lib/portage/gpkg.py @@ -1012,7 +1012,7 @@ class gpkg: gpkg_version_file = tarfile.TarInfo( os.path.join(self.basename, self.gpkg_version) ) - gpkg_version_file.mtime = datetime.utcnow().timestamp() + gpkg_version_file.mtime = datetime.now().timestamp() container.addfile(gpkg_version_file) checksum_info = checksum_helper(self.settings) checksum_info.finish() @@ -1032,7 +1032,7 @@ class gpkg: checksum_info = checksum_helper(self.settings) image_tarinfo = self._create_tarinfo("image") - image_tarinfo.mtime = datetime.utcnow().timestamp() + image_tarinfo.mtime = datetime.now().timestamp() with tar_stream_writer( image_tarinfo, container, image_tar_format, compression_cmd, checksum_info ) as image_writer: @@ -1114,7 +1114,7 @@ class gpkg: gpkg_version_file = tarfile.TarInfo( os.path.join(new_basename, self.gpkg_version) ) - gpkg_version_file.mtime = datetime.utcnow().timestamp() + gpkg_version_file.mtime = datetime.now().timestamp() container.addfile(gpkg_version_file) checksum_info = checksum_helper(self.settings) checksum_info.finish() @@ -1182,7 +1182,7 @@ class gpkg: gpkg_version_file = tarfile.TarInfo( os.path.join(self.prefix, self.gpkg_version) ) - gpkg_version_file.mtime = datetime.utcnow().timestamp() + gpkg_version_file.mtime = datetime.now().timestamp() container.addfile(gpkg_version_file) checksum_info = checksum_helper(self.settings) checksum_info.finish() @@ -1253,7 +1253,7 @@ class gpkg: if metadata is None: metadata = {} metadata_tarinfo = self._create_tarinfo("metadata") - metadata_tarinfo.mtime = datetime.utcnow().timestamp() + metadata_tarinfo.mtime = datetime.now().timestamp() if self.create_signature: checksum_info = checksum_helper( @@ -1274,7 +1274,7 @@ class gpkg: ) as metadata_tar: for m in metadata: m_info = tarfile.TarInfo(os.path.join("metadata", m)) - m_info.mtime = datetime.utcnow().timestamp() + m_info.mtime = datetime.now().timestamp() if isinstance(metadata[m], bytes): m_data = io.BytesIO(metadata[m]) @@ -1329,7 +1329,7 @@ class gpkg: gpkg_version_file = tarfile.TarInfo( os.path.join(self.basename, self.gpkg_version) ) - gpkg_version_file.mtime = datetime.utcnow().timestamp() + gpkg_version_file.mtime = datetime.now().timestamp() container.addfile(gpkg_version_file) checksum_info = checksum_helper(self.settings) checksum_info.finish() @@ -1350,7 +1350,7 @@ class gpkg: paths = list(contents) paths.sort() image_tarinfo = self._create_tarinfo("image") - image_tarinfo.mtime = datetime.utcnow().timestamp() + image_tarinfo.mtime = datetime.now().timestamp() with tar_stream_writer( image_tarinfo, container, image_tar_format, compression_cmd, checksum_info ) as image_writer: @@ -1518,7 +1518,7 @@ class gpkg: manifest_tarinfo = tarfile.TarInfo(os.path.join(basename, "Manifest")) manifest_tarinfo.size = manifest.tell() - manifest_tarinfo.mtime = datetime.utcnow().timestamp() + manifest_tarinfo.mtime = datetime.now().timestamp() manifest.seek(0) container.addfile(manifest_tarinfo, manifest) manifest.close() @@ -1562,7 +1562,7 @@ class gpkg: signature = io.BytesIO(checksum_info.gpg_output) signature_tarinfo = tarfile.TarInfo(f"{tarinfo.name}.sig") signature_tarinfo.size = len(signature.getvalue()) - signature_tarinfo.mtime = datetime.utcnow().timestamp() + signature_tarinfo.mtime = datetime.now().timestamp() container.addfile(signature_tarinfo, signature) if manifest: