Re: bootstrap patch

2014-01-27 Thread Eric Blake
On 01/26/2014 11:08 AM, Bruce Korb wrote:
> Hi,
> 
> "test -f .git"?  Do you mean "test -d .git"?

No, because .git can be a symlink, in which case test -d .git fails but
test -f .git passes.

-- 
Eric Blake   eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
___
https://lists.gnu.org/mailman/listinfo/libtool


Re: bootstrap patch

2014-01-27 Thread Bruce Korb
Hi Gary,

On Sun, Jan 26, 2014 at 6:21 PM, Gary V. Vaughan  wrote:
>> Anyway, if you want to test for "are we in a git repo hierarchy?"
>> would not "git rev-parse --git-dir" be better?
>
> No, because bootstrap absolutely has to run in $srcdir, and I don't want to

$top_srcdir, I would guess.  I was using it to answer the question,
"Are we in a git repo hierarchy?", not to actually use the git dir.
Anyway, thanks for fixing it.

Cheers - Bruce

___
https://lists.gnu.org/mailman/listinfo/libtool


Re: bootstrap patch

2014-01-27 Thread Gary V. Vaughan
Hi Eric,

> On Jan 28, 2014, at 2:30 AM, Eric Blake  wrote:
> 
>> On 01/26/2014 11:08 AM, Bruce Korb wrote:
>> Hi,
>> 
>> "test -f .git"?  Do you mean "test -d .git"?
> 
> No, because .git can be a symlink, in which case test -d .git fails but
> test -f .git passes.

Urgh. Now I'm confused... the manual page for test on my Mac says that
-f passes if the argument exists and is a regular file. A directory is not a
regular file, so -f would fail (on MacOS at least), no?

Also, by default, I thought links were followed and the destination was
tested not the link itself?

I'll do some more tests when I get back to my computer, and adjust again
If necessary.

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)

___
https://lists.gnu.org/mailman/listinfo/libtool


Re: bootstrap patch

2014-01-27 Thread Eric Blake
On 01/27/2014 12:24 PM, Gary V. Vaughan wrote:
> Hi Eric,
> 
>> On Jan 28, 2014, at 2:30 AM, Eric Blake  wrote:
>>
>>> On 01/26/2014 11:08 AM, Bruce Korb wrote:
>>> Hi,
>>>
>>> "test -f .git"?  Do you mean "test -d .git"?
>>
>> No, because .git can be a symlink, in which case test -d .git fails but
>> test -f .git passes.
> 
> Urgh. Now I'm confused... the manual page for test on my Mac says that
> -f passes if the argument exists and is a regular file. A directory is not a
> regular file, so -f would fail (on MacOS at least), no?

Uggh.  'test -e' tests for existence of both regular files, symlinks,
and directories; but is not portable.  'test -r' is a reasonable
substitute.  But gnulib seems to be doing just fine with 'test -d .git',
rather than worrying about the case when .git is a symlink rather than
an actual directory.  At this point, I say we just stick to 'test -d'
until someone provides a counterexample that doesn't work, rather than
worrying about theory.

Sorry for the added confusion.

-- 
Eric Blake   eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
___
https://lists.gnu.org/mailman/listinfo/libtool


Re: bootstrap patch

2014-01-27 Thread Gary V. Vaughan
Hi Eric,

On Jan 28, 2014, at 8:35 AM, Eric Blake  wrote:
> On 01/27/2014 12:24 PM, Gary V. Vaughan wrote:
>>> On Jan 28, 2014, at 2:30 AM, Eric Blake  wrote:
>>> 
 On 01/26/2014 11:08 AM, Bruce Korb wrote:
 Hi,
 
 "test -f .git"?  Do you mean "test -d .git"?
>>> 
>>> No, because .git can be a symlink, in which case test -d .git fails but
>>> test -f .git passes.
>> 
>> Urgh. Now I'm confused... the manual page for test on my Mac says that
>> -f passes if the argument exists and is a regular file. A directory is not a
>> regular file, so -f would fail (on MacOS at least), no?
> 
> Uggh.  'test -e' tests for existence of both regular files, symlinks,
> and directories; but is not portable.  'test -r' is a reasonable
> substitute.  But gnulib seems to be doing just fine with 'test -d .git',
> rather than worrying about the case when .git is a symlink rather than
> an actual directory.  At this point, I say we just stick to 'test -d'
> until someone provides a counterexample that doesn't work, rather than
> worrying about theory.
> 
> Sorry for the added confusion.

No worries.  And thanks for clearing it up so quickly :)

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)


signature.asc
Description: Message signed with OpenPGP using GPGMail
___
https://lists.gnu.org/mailman/listinfo/libtool