From: "Torsten Bögershausen" <tboegi@web.de>
To: Armin Kunaschik <megabreit@googlemail.com>,
David Aguilar <davvid@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>,
Git List <git@vger.kernel.org>
Subject: Re: [PATCH] t7800 readlink not found
Date: Tue, 31 May 2016 07:06:50 +0200 [thread overview]
Message-ID: <574D1BEA.5020409@web.de> (raw)
In-Reply-To: <574CDA24.1020906@googlemail.com>
On 05/31/2016 02:26 AM, Armin Kunaschik wrote:
> 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 ?
next prev parent reply other threads:[~2016-05-31 5:08 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-24 15:53 t7800 test failure Armin Kunaschik
2016-05-24 16:48 ` Matthieu Moy
2016-05-24 16:57 ` Junio C Hamano
2016-05-24 17:20 ` Armin Kunaschik
2016-05-24 17:36 ` Junio C Hamano
2016-05-25 9:33 ` Armin Kunaschik
2016-05-27 4:19 ` David Aguilar
2016-05-27 7:48 ` Matthieu Moy
2016-05-31 0:26 ` [PATCH] t7800 readlink not found Armin Kunaschik
2016-05-31 5:06 ` Torsten Bögershausen [this message]
2016-05-31 5:51 ` Junio C Hamano
2016-06-21 14:44 ` Armin Kunaschik
2016-06-21 18:39 ` Junio C Hamano
2016-06-21 20:30 ` Torsten Bögershausen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=574D1BEA.5020409@web.de \
--to=tboegi@web.de \
--cc=Matthieu.Moy@grenoble-inp.fr \
--cc=davvid@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=megabreit@googlemail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).