git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] t7800 readlink not found

From
Torsten Bögershausen <tboegi@web.de>
Date
May 31, 2016, 05:06 UTC
Message-ID
<574D1BEA.5020409@web.de>
In-Reply-To
<574CDA24.1020906@googlemail.com>
On 05/31/2016 02:26 AM, Armin Kunaschik wrote:
Show 46 quoted lines
> On 05/27/2016 06:19 AM, David Aguilar wrote:
>> On Wed, May 25, 2016 at 11:33:33AM +0200, Armin Kunaschik wrote:
>>
>> Would you mind submitting a patch so that we can support these
>> tests when running on AIX/HP-UX?
> I don't feel comfortable to submit patches for tests I can't verify. I
> don't have valgrind and python/p4 here. Looking to the code I'd say,
> patching the p4 tests with "ls -ld | sed" looks quite save.
> But I'm not sure about the test-lib.sh. When you are really super
> paranoid, as written in the comment, you should probably use perl like
>
> perl -e 'print readlink $ARGV[0]' $name
>
> as a replacement.
>
> So, as suggested by Junio, here the readlink workaround for t7800 only.
> (hopefully whitespace clean this time)
>
> --- 8< --- 8< ---
> From: Armin Kunaschik <megabreit@googlemail.com>
> Subject: t7800: readlink is not portable
>
> The readlink(1) command is not available on all platforms (notably not
> on AIX and HP-UX) and can be replaced in this test with the "workaround"
>
> ls -ld <name> | sed -e 's/.* -> //'
>
> This is no universal readlink replacement but works in the controlled
> test environment good enough.
>
> Signed-off-by: Armin Kunaschik <megabreit@googlemail.com>
> ---
>
> diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
> index 7ce4cd7..905035c 100755
> --- a/t/t7800-difftool.sh
> +++ b/t/t7800-difftool.sh
> @@ -446,7 +446,7 @@ write_script .git/CHECK_SYMLINKS <<\EOF
>   for f in file file2 sub/sub
>   do
>   	echo "$f"
> -	readlink "$2/$f"
> +	ls -ld "$2/$f" | sed -e 's/.* -> //'
>   done >actual
>   EOF
>

I don't know how portable #ls -ld" really is. If there is one platform, that doesn't support readlink, would it make sense to implement readlink() in test-lib.sh, similar to what we have for MINGW, e.g. sort() or find() ? And keep t7800 as it is ?

Previous: Armin KunaschikNext: Junio C Hamano
Message 10 of 14 in “t7800 test failure”
  1. Armin KunaschikMay 24, 2016
  2. Matthieu MoyMay 24, 2016
  3. Junio C HamanoMay 24, 2016
  4. Armin KunaschikMay 24, 2016
  5. Junio C HamanoMay 24, 2016
  6. Armin KunaschikMay 25, 2016
  7. David AguilarMay 27, 2016
  8. Matthieu MoyMay 27, 2016
  9. t7800 readlink not foundArmin Kunaschik, May 31, 2016
  10. Torsten BögershausenMay 31, 2016
  11. Junio C HamanoMay 31, 2016
  12. Armin KunaschikJun 21, 2016
  13. Junio C HamanoJun 21, 2016
  14. Torsten BögershausenJun 21, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.