public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: /, lib/portage/dbapi/
Date: Sun, 14 Sep 2025 09:33:18 +0000 (UTC)	[thread overview]
Message-ID: <1757842383.ccebae2e51cbbd03a30d5e3599ee82f974643fd2.sam@gentoo> (raw)

commit:     ccebae2e51cbbd03a30d5e3599ee82f974643fd2
Author:     Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 14 08:15:21 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Sep 14 09:33:03 2025 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ccebae2e

bintree: Prefer 'Last-Modified' over 'timestamp' header

The Last-Modified header is a standard header and seems to be more in
sync accross different mirrors than 'timestamp'. Prefer it over
'timestamp'.

Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>
Part-of: https://github.com/gentoo/portage/pull/1466
Closes: https://github.com/gentoo/portage/pull/1466
Signed-off-by: Sam James <sam <AT> gentoo.org>

 NEWS                         | 5 ++++-
 lib/portage/dbapi/bintree.py | 6 +++---
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index 71edb962fa..04e47696d4 100644
--- a/NEWS
+++ b/NEWS
@@ -9,7 +9,10 @@ Release notes take the form of the following optional categories:
 portage-3.0.70 (UNRELEASED)
 --------------
 
-TODO
+Features
+
+* Prefer the 'Last-Modified' over the 'timestamp' HTTP header when
+  querying binhosts.
 
 portage-3.0.69 (2025-09-14)
 --------------

diff --git a/lib/portage/dbapi/bintree.py b/lib/portage/dbapi/bintree.py
index 2fdb08d44b..8e69fe3b89 100644
--- a/lib/portage/dbapi/bintree.py
+++ b/lib/portage/dbapi/bintree.py
@@ -1466,13 +1466,13 @@ class binarytree:
                                     proxies=proxies,
                                 )
                                 if hasattr(f, "headers"):
-                                    if f.headers.get("timestamp", ""):
-                                        remote_timestamp = f.headers.get("timestamp")
-                                    elif f.headers.get("Last-Modified", ""):
+                                    if f.headers.get("Last-Modified", ""):
                                         last_modified = f.headers.get("Last-Modified")
                                         remote_timestamp = http_to_timestamp(
                                             last_modified
                                         )
+                                    elif f.headers.get("timestamp", ""):
+                                        remote_timestamp = f.headers.get("timestamp")
                                 if (
                                     remote_timestamp
                                     and local_timestamp


             reply	other threads:[~2025-09-14  9:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-14  9:33 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-10-27 23:13 [gentoo-commits] proj/portage:master commit in: /, lib/portage/dbapi/ Zac Medico
2024-01-02  4:46 Sam James
2023-09-26 20:54 Sam James
2023-04-07  9:52 Sam James
2022-11-30 22:29 Sam James

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1757842383.ccebae2e51cbbd03a30d5e3599ee82f974643fd2.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox