commit:     6edcd37b0c8514a5b7c9d9c5600194caa1049be8
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Thu Jul  3 16:46:59 2025 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Thu Jul  3 16:49:08 2025 +0000
URL:        
https://gitweb.gentoo.org/proj/pkgcore/pkgcore.git/commit/?id=6edcd37b

rsync: fix computing of current timestamp with timezone offset

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 NEWS.rst                  | 7 +++++++
 src/pkgcore/sync/rsync.py | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/NEWS.rst b/NEWS.rst
index 7c4e4be9..eef5e6ef 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -2,6 +2,13 @@
 Release Notes
 =============
 
+----------------------------
+pkgcore 0.12.31 (????-??-??)
+----------------------------
+
+- rsync: fix bug in computing the current timestamp when the timezone is not
+  UTC (Arthur Zamarin)
+
 ----------------------------
 pkgcore 0.12.30 (2025-06-02)
 ----------------------------

diff --git a/src/pkgcore/sync/rsync.py b/src/pkgcore/sync/rsync.py
index 4869ac6a..6c2e81d7 100644
--- a/src/pkgcore/sync/rsync.py
+++ b/src/pkgcore/sync/rsync.py
@@ -193,7 +193,7 @@ class rsync_timestamp_syncer(rsync_syncer):
                 date, offset = f.read().strip().rsplit("+", 1)
             date = time.mktime(time.strptime(date, "%a, %d %b %Y %H:%M:%S "))
             # add the hour/minute offset
-            date += int(offset[:2] * 60) + int(offset[2:])
+            date += int(offset[:2]) * 60 + int(offset[2:])
             return date
         except (FileNotFoundError, NotADirectoryError):
             return None

Reply via email to