From: Tomi Ollila <tomi.ollila@iki.fi>
To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org
Subject: Re: setting LIBDIR_IN_LDCONFIG fails if /lib is a symlink to /usr/lib
Date: Mon, 28 May 2018 14:41:48 +0300 [thread overview]
Message-ID: <m2k1roj9c3.fsf@guru.guru-group.fi> (raw)
In-Reply-To: <871sdwu4ew.fsf@tethera.net>
On Sun, May 27 2018, David Bremner wrote:
> Tomi Ollila <tomi.ollila@iki.fi> writes:
>
>> we could try:
>>
>> for path in $ldconfig_paths; do
>> if [ "$path" = "$libdir_expanded" ]; then
>> libdir_in_ldconfig=1
>> break
>> fi
>> if [ "$path" -ef "$libdir_expanded" ]; then
>> libdir_in_ldconfig=1
>> break
>> fi
>> done
>>
>
> That looks less horrible than my idea. How portable is it? I guess test
> -ef is not POSIX.
-ef is not POSIX; but probably all shells that are used when executing this
line have builtin test which groks -ef .
$ dash -c 'test / -ef /' || echo noef
$ bash -c 'test / -ef /' || echo noef
$ zsh -c 'test / -ef /' || echo noef
$ ksh -c 'test / -ef /' || echo noef
but, problem arises when test does not support -ef -- script may exit
prematurely...
$ ./heirloom-sh/sh -c 'if test / -ef /; then echo foo; else echo bar; fi'
./heirloom-sh/sh: test: unknown operator -ef
zsh: exit 1 ./heirloom-sh/sh -c 'if test / -ef /; then echo foo; ...
OTOH:
$ dash -c 'if test / -exf /; then echo foo; else echo bar; fi' /home/too
test: 1: /: unexpected operator
bar
... so probably the shells that can succesfully execute our configure
scripts (heirloom sh definitely will not) will not fail if, for some
reason it could not handle the -ef -option -- that particular test
just would not ever pass.
Tomi
PS: the test/[ problems that had to be mitigated with [ x"$var" = x ]
has been fixed decades ago -- but still we se these in modern scripts
that require bash...
>
> d
next prev parent reply other threads:[~2018-05-28 11:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-26 22:23 setting LIBDIR_IN_LDCONFIG fails if /lib is a symlink to /usr/lib David Bremner
2018-05-27 16:33 ` Tomi Ollila
2018-05-27 22:20 ` David Bremner
2018-05-28 11:41 ` Tomi Ollila [this message]
2018-05-30 3:04 ` [PATCH] configure: check for links to/from libdir in ldconfig output David Bremner
2018-05-30 11:37 ` Tomi Ollila
2018-05-30 12:24 ` David Bremner
2018-05-30 13:03 ` Tomi Ollila
2018-06-02 11:12 ` David Bremner
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: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2k1roj9c3.fsf@guru.guru-group.fi \
--to=tomi.ollila@iki.fi \
--cc=david@tethera.net \
--cc=notmuch@notmuchmail.org \
/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://yhetil.org/notmuch.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).