ref: 0ba51329256a470c3c6fe7ac2b48dacd67d29c0c
parent: 9503ac891d1ea5513193c0eb0f857f876eb793d2
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Mon Mar 12 12:39:45 EDT 2018
[tests/ar] Use date to get the unix time This value is going to depend of the timezone where the script is executed, so the best option is to let to the system to guess what is the correct value.
--- a/tests/ar/execute/mkmaster.sh
+++ b/tests/ar/execute/mkmaster.sh
@@ -2,20 +2,21 @@
uid=`id -u`
gid=`id -g`
+time=`date -d "1980-01-01" +%s`
cat <<EOF >master.a
!<arch>
-file1 315532800 `printf "%-6d" $uid``printf "%-6d" $gid`100644 79 \`
+file1 `printf "%-12d" $time``printf "%-6d" $uid``printf "%-6d" $gid`100644 79 \`
This is the first file,
and it should go in the
first position in the archive.
-file2 315532800 `printf "%-6d" $uid``printf "%-6d" $gid`100644 125 \`
+file2 `printf "%-12d" $time``printf "%-6d" $uid``printf "%-6d" $gid`100644 125 \`
But this other one is the second one,
and it shouldn't go in the first position
because it should go in the second position.
-file3 315532800 `printf "%-6d" $uid``printf "%-6d" $gid`100644 118 \`
+file3 `printf "%-12d" $time``printf "%-6d" $uid``printf "%-6d" $gid`100644 118 \`
and at the end, this is the last file
that should go at the end of the file,
thus it should go in the third position.