[PATCH] tools: fix date parsing in patchwork polling
David Marchand
david.marchand at redhat.com
Mon Mar 31 13:19:26 CEST 2025
Though it is not fully understood why (maybe some system upgrade..?),
parsing date is now failing on some long running Debian system.
Specify date format earlier in the command line.
Fixes: baaec1836189 ("tools: filter new patchwork IDs by date")
Signed-off-by: David Marchand <david.marchand at redhat.com>
---
tools/poll-pw | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/poll-pw b/tools/poll-pw
index c1df012..4c7fafd 100755
--- a/tools/poll-pw
+++ b/tools/poll-pw
@@ -47,7 +47,7 @@ if [ ! -f "$since_file" ] ; then
exit 1
fi
-if ! date -d "$(cat $since_file | tr '\n' ' ')" >/dev/null 2>&1 ; then
+if ! date --utc '+%FT%T' -d $(cat $since_file | tr '\n' ' ') >/dev/null 2>&1 ; then
printf "The file '$since_file' doesn't contain a valid date format.\n\n" >&2
exit 1
fi
@@ -77,7 +77,7 @@ callcmd () # <patchwork id>
while true ; do
date_now=$(date --utc '+%FT%T')
- since=$(date -d $(cat $since_file | tr '\n' ' ') '+%FT%T')
+ since=$(date --utc '+%FT%T' -d $(cat $since_file | tr '\n' ' '))
page=1
while true ; do
ids=$(curl -s "${URL}&page=${page}&since=${since}" |
--
2.48.1
More information about the ci
mailing list