commit:     c9cfe2ae7ab33c20cb4d7f90fda01275136eae4d
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Fri Jul  4 05:11:37 2025 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Fri Jul  4 05:11:37 2025 +0000
URL:        
https://gitweb.gentoo.org/proj/pkgcore/pkgcore.git/commit/?id=c9cfe2ae

rsync: fix logical bug with negative sync delta

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

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

diff --git a/NEWS.rst b/NEWS.rst
index eef5e6ef..8cc97eed 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -9,6 +9,8 @@ pkgcore 0.12.31 (????-??-??)
 - rsync: fix bug in computing the current timestamp when the timezone is not
   UTC (Arthur Zamarin)
 
+- rsync: fix logical bug with negative sync delta (Arthur Zamarin)
+
 ----------------------------
 pkgcore 0.12.30 (2025-06-02)
 ----------------------------

diff --git a/src/pkgcore/sync/rsync.py b/src/pkgcore/sync/rsync.py
index 6c2e81d7..8f470b9f 100644
--- a/src/pkgcore/sync/rsync.py
+++ b/src/pkgcore/sync/rsync.py
@@ -221,7 +221,7 @@ class rsync_timestamp_syncer(rsync_syncer):
                         if delta >= 0:
                             doit = delta > self.forward_sync_delay
                         else:
-                            doit = delta > self.negative_sync_delay
+                            doit = -delta > self.negative_sync_delay
             if not doit:
                 return True
             ret = super()._sync(verbosity)

Reply via email to