Bug 5278 - Solaris fixes are not portable
Summary: Solaris fixes are not portable
Status: RESOLVED FIXED
Alias: None
Product: pkg-config
Classification: Unclassified
Component: src (show other bugs)
Version: unspecified
Hardware: All All
: high normal
Assignee: Tollef Fog Heen
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-08 09:10 UTC by Daniel Macks
Modified: 2009-12-06 13:23 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Make Solaris fixes more portable (3.10 KB, patch)
2008-09-01 14:01 UTC, Tim Rice
Details | Splinter Review

Description Daniel Macks 2005-12-08 09:10:46 UTC
The check scripts all begin:

#! /bin/sh

# Do the Solaris Dance:
if [ ! -d ~root ]  ; then
    exec /usr/xpg4/bin/sh $0 "$@" 
fi

The condition being fixed is "non-POSIX shell" (according to ChangeLog), the fix
is specific to Solaris in its standard installation, and the test is "does user
'root' exist and does its home directory exist". Why not test for the problem
itself or for the platform where the problem is known? I have reports from users
who have no ~root (for various reasons) on machines that are not Solaris and
that do not have xpg4.

./configure should check $host for being solaris and either write the check
scripts directly or pass a token to check/Makefile that sets and env var that
the check scripts check to determine whether to relauch. Even better would be to
have ./configure check /bin/sh itself, and then fall through to an alternate
shell if needed, checking that it exists. That way any user who has non-POSIX
/bin/sh benefits, and such a person could use a flag to pass the correct shell path.
Comment 1 Alan Coopersmith 2008-08-04 19:35:10 UTC
That check actually seems to be attempting to test "Is this shell advanced
enough to translate ~root into root's home directory?"   (The Solaris /bin/sh
does not, and few sites have a directory literally named ~root.)

It would seem a safer check would be 
 if [ ! -d ~root -a -x /usr/xpg4/bin/sh ] ; then
Comment 2 Tim Rice 2008-09-01 14:01:30 UTC
Created attachment 18619 [details] [review]
Make Solaris fixes more portable

I've changed the Hardware & OS to all because it is not OSX specific and
there isn't a catagory for bash pretending to be /bin/sh.

The attached patch should make the fix much more portable.
Comment 3 Tollef Fog Heen 2009-12-06 13:23:30 UTC
I have changed this to use getconf PATH instead, which is the POSIX way of going about this.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.