"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
-portable regress: avoid date -r
To:
gameoftrees@openbsd.org
Date:
Tue, 5 Jul 2022 22:17:37 +0200

Download raw body.

Thread
This fixes test failures in log.sh on Ubuntu. ok?

diff /home/stsp/src/got-portable
commit - a8fa2ba8469e013475c403304989843b7fc17ae8
path + /home/stsp/src/got-portable
blob - fc218eff521a465dc36ca25aad4973aa104fbb4c
file + regress/cmdline/log.sh
--- regress/cmdline/log.sh
+++ regress/cmdline/log.sh
@@ -319,9 +319,9 @@ no" > /dev/null)
 	local commit_id2=`git_show_head $testroot/repo`
 	local author_time2=`git_show_author_time $testroot/repo`
 
-	d=`date -u -r $author_time1 +"%G-%m-%d"`
+	d=`date -u -d "@${author_time1}" +"%G-%m-%d"`
 	printf "$d %-7s test oneline\n" master > $testroot/stdout.expected
-	d=`date -u -r $author_time2 +"%G-%m-%d"`
+	d=`date -u -d "@${author_time2}" +"%G-%m-%d"`
 	printf "$d %.7s test oneline\n" $commit_id1 >> $testroot/stdout.expected
 
 	(cd $testroot/repo && got log -s | head -n 2 > $testroot/stdout)