* [PATCH] tools: fix date parsing in patchwork polling
@ 2025-03-31 11:19 David Marchand
2025-04-08 18:42 ` Ali Alnubani
0 siblings, 1 reply; 2+ messages in thread
From: David Marchand @ 2025-03-31 11:19 UTC (permalink / raw)
To: ci; +Cc: thomas, aconole, alialnu
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@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
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: [PATCH] tools: fix date parsing in patchwork polling
2025-03-31 11:19 [PATCH] tools: fix date parsing in patchwork polling David Marchand
@ 2025-04-08 18:42 ` Ali Alnubani
0 siblings, 0 replies; 2+ messages in thread
From: Ali Alnubani @ 2025-04-08 18:42 UTC (permalink / raw)
To: David Marchand, ci; +Cc: NBU-Contact-Thomas Monjalon (EXTERNAL), aconole
> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Sent: Monday, March 31, 2025 2:19 PM
> To: ci@dpdk.org
> Cc: NBU-Contact-Thomas Monjalon (EXTERNAL) <thomas@monjalon.net>;
> aconole@redhat.com; Ali Alnubani <alialnu@nvidia.com>
> Subject: [PATCH] tools: fix date parsing in patchwork polling
>
> Though it is not fully understood why (maybe some system upgrade..?),
> parsing date is now failing on some long running Debian system.
It's because the last date and time that were written to the file coincide with the Daylight-Saving Time transition.
That timestamp was invalid in the server's timezone.
>
> Specify date format earlier in the command line.
I think what fixed it was adding the --utc arg.
>
> Fixes: baaec1836189 ("tools: filter new patchwork IDs by date")
>
> Signed-off-by: David Marchand <david.marchand@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
Thanks for addressing this, David.
Acked-by: Ali Alnubani <alialnu@nvidia.com>
- Ali
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-04-08 18:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-31 11:19 [PATCH] tools: fix date parsing in patchwork polling David Marchand
2025-04-08 18:42 ` Ali Alnubani
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).