running `emerge --sync` with LANG=de_DE.utf8 fails timestamp.chk verification since this code fails: timestamp = time.mktime(time.strptime(content[0],TIMESTAMP_FORMAT)) for some reason strptime fails with "ValueError: time data 'Thu, 23 Apr 2020 14:45:01 +0000' does not match format '%a %b %d %H:%M:%S %Y'" `LANG=en_GB.UTF8 emerge --sync` or `LANG=C emerge --sync` works fine Reproducible: Always Steps to Reproduce: Run `emerge --sync` with `LANG=de_DE.utf8` in environment Actual Results: emerge doesn't check timestamp.chk and performs full resync Expected Results: emerge does check timestamp.chk and performs full resync only if needed
I have modified rsync.py, adding these lines: print("timestamp: " + str(time.strptime(content[0],TIMESTAMP_FORMAT))) print("TIMESTAMP_FORMAT: " + str(TIMESTAMP_FORMAT)) print("timestamp: " + str(time.mktime(time.strptime(content[0],TIMESTAMP_FORMAT)))) Results are as follows: LANG=en_GB.UTF8 emerge --sync gentoo >>> Syncing repository 'gentoo' into '/var/db/repos/gentoo'... * Using keys from /usr/share/openpgp-keys/gentoo-release.asc * Refreshing keys via WKD ... [ ok ] timestamp: time.struct_time(tm_year=2020, tm_mon=4, tm_mday=23, tm_hour=18, tm_min=15, tm_sec=1, tm_wday=3, tm_yday=114, tm_isdst=-1) TIMESTAMP_FORMAT: %a, %d %b %Y %H:%M:%S +0000 timestamp: 1587654901.0 >>> Starting rsync with rsync://*/gentoo-portage... >>> Checking server timestamp ... LANG=C emerge --sync gentoo >>> Syncing repository 'gentoo' into '/var/db/repos/gentoo'... * Using keys from /usr/share/openpgp-keys/gentoo-release.asc * Refreshing keys via WKD ... [ ok ] timestamp: time.struct_time(tm_year=2020, tm_mon=4, tm_mday=23, tm_hour=18, tm_min=15, tm_sec=1, tm_wday=3, tm_yday=114, tm_isdst=-1) TIMESTAMP_FORMAT: %a, %d %b %Y %H:%M:%S +0000 timestamp: 1587654901.0 >>> Starting rsync with rsync://*/gentoo-portage... >>> Checking server timestamp ... LANG=de_DE.UTF8 emerge --sync gentoo >>> Syncing repository 'gentoo' into '/var/db/repos/gentoo'... * Using keys from /usr/share/openpgp-keys/gentoo-release.asc * Refreshing keys via WKD ... [ ok ] Traceback (most recent call last): File "/usr/lib64/python3.6/site-packages/portage/util/_async/AsyncFunction.py", line 39, in _run result = self.target(*(self.args or []), **(self.kwargs or {})) File "/usr/lib64/python3.6/site-packages/portage/sync/controller.py", line 169, in sync taskmaster.run_tasks(tasks, func, status, options=task_opts) File "/usr/lib64/python3.6/site-packages/portage/sync/controller.py", line 68, in run_tasks result = getattr(inst, func)(**kwargs) File "/usr/lib64/python3.6/site-packages/portage/sync/syncbase.py", line 311, in sync return self.update() File "/usr/lib64/python3.6/site-packages/portage/sync/modules/rsync/rsync.py", line 176, in update print("timestamp: " + str(time.strptime(content[0],TIMESTAMP_FORMAT))) File "/usr/lib64/python3.6/_strptime.py", line 559, in _strptime_time tt = _strptime(data_string, format)[0] File "/usr/lib64/python3.6/_strptime.py", line 362, in _strptime (data_string, format)) ValueError: time data 'Thu, 23 Apr 2020 18:15:01 +0000' does not match format '%a, %d %b %Y %H:%M:%S +0000'