Re: t7800 test failure
- From
Armin Kunaschik <megabreit@googlemail.com>
- Date
- May 24, 2016, 17:20 UTC
- Message-ID
- <CALR6jEj67MA7CCHQ_jfdtAuGoo9wjPie0+a=e-BqJjoYtJ9oHw@mail.gmail.com>
- In-Reply-To
- <xmqq1t4r75sv.fsf@gitster.mtv.corp.google.com>
On Tue, May 24, 2016 at 6:57 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 8 quoted lines
> Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes: > >> Armin Kunaschik <megabreit@googlemail.com> writes: >> >>> t7800 fails on systems where readlink (GNUism?) is not available. >> >> I don't think it's POSIX, but it is present on all POSIX-like systems I >> know. On which system did you get the issue?
It's not available in AIX or HP-UX.
Show 9 quoted lines
>>> +readlink() { ls -ld "$1" | sed 's/.* -> //'; }
>>
>> This is much less robust than the actual readlink. For example, if ->
>> appears in the link name, it breaks.
>
> I wouldn't allow it in our scripted Porcelain, but the environment
> of our test scripts are under our control, so I do not think it is a
> problem ("ls piped to sed" has been an established idiom before
> readlink(1) was widely accepted, by the way).I think so too. Maybe I can improve the sed expression a bit, but it will never be a universal readlink replacement. But it doesn't have to. It's defined locally for this one test only and it does the specific job.
>> It would be acceptable as a fall-back if readlink is not present, but >> shouldn't activate the "ls" hack by default. > > Yup.
Ok, how can this be implemented within the test environment?