From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 1D6F16DE01E8 for ; Mon, 28 May 2018 04:42:01 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.473 X-Spam-Level: X-Spam-Status: No, score=0.473 tagged_above=-999 required=5 tests=[AWL=-0.179, SPF_NEUTRAL=0.652] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id a1vEA1hQAC3O for ; Mon, 28 May 2018 04:42:00 -0700 (PDT) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by arlo.cworth.org (Postfix) with ESMTP id C8BE46DE0164 for ; Mon, 28 May 2018 04:41:59 -0700 (PDT) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id B2DFC100084; Mon, 28 May 2018 14:41:48 +0300 (EEST) From: Tomi Ollila To: David Bremner , notmuch@notmuchmail.org Subject: Re: setting LIBDIR_IN_LDCONFIG fails if /lib is a symlink to /usr/lib In-Reply-To: <871sdwu4ew.fsf@tethera.net> References: <87h8mut5sz.fsf@tethera.net> <871sdwu4ew.fsf@tethera.net> User-Agent: Notmuch/0.26.1+22~g888240d (https://notmuchmail.org) Emacs/25.2.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 May 2018 11:42:01 -0000 On Sun, May 27 2018, David Bremner wrote: > Tomi Ollila 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