{"thread":{"id":"920","subject":"[PATCH] Unset TZ in t5000","startedAt":"2005-06-13T00:24:44Z","lastAt":"2005-06-14T17:09:39Z","messageCount":6,"participants":["Mark Allen","Rene Scharfe"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"4908","messageId":"20050613002444.80848.qmail@web41213.mail.yahoo.com","threadId":"920","inReplyTo":null,"subject":"[PATCH] Unset TZ in t5000","fromName":"Mark Allen","fromEmail":"mrallen1@yahoo.com","sentAt":"2005-06-13T00:24:44Z","receivedAt":"2005-06-13T00:24:44Z","isPatch":true,"sender":{"key":"mrallen1@yahoo.com","avatar":null},"body":"Unset TZ in t5000 and remove GNU awkism\n\nThe t5000 test script fails at test #4 on my box because my copy of tar adjusts the time\nin the tarfile for local time if TZ is set. Explicitly unset TZ so that it reports GMT\ntime.  Additionally, my version of AWK doesn't like the \"length\" directive, so this patch\nremoves it.\n\nSigned-off-by: Mark Allen <mrallen1@yahoo.com>\n\ndiff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\n--- a/t/t5000-tar-tree.sh\n+++ b/t/t5000-tar-tree.sh\n@@ -50,8 +50,8 @@ test_expect_success \\\n \n test_expect_success \\\n     'validate file modification time' \\\n-    'tar tvf b.tar a/a |\n-     awk \\{print\\ \\$4,\\ length\\(\\$5\\)\\<7\\ ?\\ \\$5\\\":00\\\"\\ :\\ \\$5\\} >b.mtime &&\n+    'TZ= tar tvf b.tar a/a |\n+     awk \\{print\\ \\$4\\\"\\ \\\"\\$5\\} >b.mtime &&\n      echo \"2005-05-27 22:00:00\" >expected.mtime &&\n      diff expected.mtime b.mtime'\n"},{"id":"4911","messageId":"42ADAC4D.7050408@lsrfire.ath.cx","threadId":"920","inReplyTo":"20050613002444.80848.qmail@web41213.mail.yahoo.com","subject":"Re: [PATCH] Unset TZ in t5000","fromName":"Rene Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2005-06-13T15:54:53Z","receivedAt":"2005-06-13T15:54:53Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Mark Allen schrieb:\n> Unset TZ in t5000 and remove GNU awkism\n> \n> The t5000 test script fails at test #4 on my box because my copy of \n> tar adjusts the time in the tarfile for local time if TZ is set. \n> Explicitly unset TZ so that it reports GMT time.\n\nGood idea.\n\n> Additionally, my version of AWK doesn't like the \"length\" directive, \n> so this patch removes it.\n\nWhat kind of AWK is that?  The One True AWK certainly has a length\nfunction for strings and POSIX mandates it, too, so it's not a GNUism.\n\nThe expression\n\n   length($5)<7 ? $5\":00\" : $5\n\n(where $5 is a time value) is there to cope with tars that format the\ntime like hh:mm instead of the expected hh:mm:ss.  If you have to remove\nthe call to \"length\", please replace the thing with something\nequivalent, like\n\n   match($5, /:.*:/) ? $5 : $5\":00\"\n\nor similar, instead of simply dropping that test.\n\nThanks,\nRene\n"},{"id":"4913","messageId":"20050613172757.41222.qmail@web41215.mail.yahoo.com","threadId":"920","inReplyTo":"42ADAC4D.7050408@lsrfire.ath.cx","subject":"Re: [PATCH] Unset TZ in t5000","fromName":"Mark Allen","fromEmail":"mrallen1@yahoo.com","sentAt":"2005-06-13T17:27:57Z","receivedAt":"2005-06-13T17:27:57Z","isPatch":true,"sender":{"key":"mrallen1@yahoo.com","avatar":null},"body":"--- Rene Scharfe <rene.scharfe@lsrfire.ath.cx> wrote:\n> What kind of AWK is that?  The One True AWK certainly has a length\n> function for strings and POSIX mandates it, too, so it's not a GNUism.\n> \n> The expression\n> \n>    length($5)<7 ? $5\":00\" : $5\n> \n> (where $5 is a time value) is there to cope with tars that format the\n> time like hh:mm instead of the expected hh:mm:ss.  If you have to remove\n> the call to \"length\", please replace the thing with something\n> equivalent, like\n> \n>    match($5, /:.*:/) ? $5 : $5\":00\"\n> \n> or similar, instead of simply dropping that test.\n\nHi Rene,\n\nI'll test your suggestion later tonight (US time) when I get home from work.  Sorry I\ndon't know much about awk. (I usually break out perl for any job I used to give awk) When\nI ran the t5000 script in --verbose mode, all I could see was awk complaining about the\nlength directive.\n\nIt *is* possible that there's some kind of quoting/character escape problem which Linux\ntolerates but is causing the syntax error on my home system. (It's Mac OS 10.4.1/Darwin)\n\nThanks,\n\n--Mark\n"},{"id":"4944","messageId":"20050614131727.23011.qmail@web41211.mail.yahoo.com","threadId":"920","inReplyTo":"42ADAC4D.7050408@lsrfire.ath.cx","subject":"Re: [PATCH] Unset TZ in t5000","fromName":"Mark Allen","fromEmail":"mrallen1@yahoo.com","sentAt":"2005-06-14T13:17:27Z","receivedAt":"2005-06-14T13:17:27Z","isPatch":true,"sender":{"key":"mrallen1@yahoo.com","avatar":null},"body":"--- Rene Scharfe <rene.scharfe@lsrfire.ath.cx> wrote:> Mark Allen schrieb:\n > The expression\n> \n>    length($5)<7 ? $5\":00\" : $5\n> \n> (where $5 is a time value) is there to cope with tars that format the\n> time like hh:mm instead of the expected hh:mm:ss.\n\nI put (escaped) parenthesis around the length function and now it works as expected.\nHere's a new patch. Please ack if you approve. \n\nThanks,\n\n--Mark\n\nSigned-off-by: Mark Allen <mrallen1@yahoo.com>\n\n\n\ndiff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\n--- a/t/t5000-tar-tree.sh\n+++ b/t/t5000-tar-tree.sh\n@@ -50,8 +50,9 @@ test_expect_success \\\n \n test_expect_success \\\n     'validate file modification time' \\\n-    'tar tvf b.tar a/a |\n-     awk \\{print\\ \\$4,\\ length\\(\\$5\\)\\<7\\ ?\\ \\$5\\\":00\\\"\\ :\\ \\$5\\} >b.mtime &&\n+    'TZ= tar tvf b.tar a/a |\n+     awk \\{print\\ \\$4,\\ \\(length\\(\\$5\\)\\<7\\)\\ ?\\ \\$5\\\":00\\\"\\ :\\ \\$5\\} \\\n+     >b.mtime &&\n      echo \"2005-05-27 22:00:00\" >expected.mtime &&\n      diff expected.mtime b.mtime'\n \n"},{"id":"4950","messageId":"42AEF512.5040107@lsrfire.ath.cx","threadId":"920","inReplyTo":"20050614131727.23011.qmail@web41211.mail.yahoo.com","subject":"Re: [PATCH] Unset TZ in t5000","fromName":"Rene Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2005-06-14T15:17:38Z","receivedAt":"2005-06-14T15:17:38Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Mark Allen schrieb:\n> --- Rene Scharfe <rene.scharfe@lsrfire.ath.cx> wrote:> Mark Allen schrieb:\n>  > The expression\n> \n>>   length($5)<7 ? $5\":00\" : $5\n>>\n>>(where $5 is a time value) is there to cope with tars that format the\n>>time like hh:mm instead of the expected hh:mm:ss.\n> \n> \n> I put (escaped) parenthesis around the length function and now it works as expected.\n> Here's a new patch. Please ack if you approve. \n> \n> Thanks,\n> \n> --Mark\n> \n> Signed-off-by: Mark Allen <mrallen1@yahoo.com>\n> \n> \n> ------------------------------------------------------------------------\n> \n> diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\n> --- a/t/t5000-tar-tree.sh\n> +++ b/t/t5000-tar-tree.sh\n> @@ -50,8 +50,9 @@ test_expect_success \\\n>  \n>  test_expect_success \\\n>      'validate file modification time' \\\n> -    'tar tvf b.tar a/a |\n> -     awk \\{print\\ \\$4,\\ length\\(\\$5\\)\\<7\\ ?\\ \\$5\\\":00\\\"\\ :\\ \\$5\\} >b.mtime &&\n> +    'TZ= tar tvf b.tar a/a |\n> +     awk \\{print\\ \\$4,\\ \\(length\\(\\$5\\)\\<7\\)\\ ?\\ \\$5\\\":00\\\"\\ :\\ \\$5\\} \\\n> +     >b.mtime &&\n>       echo \"2005-05-27 22:00:00\" >expected.mtime &&\n>       diff expected.mtime b.mtime'\n>  \n\nAcked-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>\n"},{"id":"4953","messageId":"20050614170939.69223.qmail@web41206.mail.yahoo.com","threadId":"920","inReplyTo":"42AEF512.5040107@lsrfire.ath.cx","subject":"Re: [PATCH] Unset TZ in t5000","fromName":"Mark Allen","fromEmail":"mrallen1@yahoo.com","sentAt":"2005-06-14T17:09:39Z","receivedAt":"2005-06-14T17:09:39Z","isPatch":true,"sender":{"key":"mrallen1@yahoo.com","avatar":null},"body":"Linus,\n\nPlease apply this patch to make t5000 more portable.\n\nThanks,\n\n--Mark\n\n---\n\nUnset TZ to force GMT in test #4 and add a set of parens around\nthe length function in the awk script.\n\nSigned-off-by: Mark Allen <mrallen1@yahoo.com>\nAcked-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>\n \n\n\ndiff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\n--- a/t/t5000-tar-tree.sh\n+++ b/t/t5000-tar-tree.sh\n@@ -50,8 +50,9 @@ test_expect_success \\\n \n test_expect_success \\\n     'validate file modification time' \\\n-    'tar tvf b.tar a/a |\n-     awk \\{print\\ \\$4,\\ length\\(\\$5\\)\\<7\\ ?\\ \\$5\\\":00\\\"\\ :\\ \\$5\\} >b.mtime &&\n+    'TZ= tar tvf b.tar a/a |\n+     awk \\{print\\ \\$4,\\ \\(length\\(\\$5\\)\\<7\\)\\ ?\\ \\$5\\\":00\\\"\\ :\\ \\$5\\} \\\n+     >b.mtime &&\n      echo \"2005-05-27 22:00:00\" >expected.mtime &&\n      diff expected.mtime b.mtime'\n \n"}]}