Subject: Re: sed and pkg_rolling-replace on Solaris/SPARC
To: Tobias Nygren <tnn@NetBSD.org>
From: Mehul N. Sanghvi <mehul.sanghvi@gmail.com>
List: pkgsrc-users
Date: 06/29/2007 13:16:10
Tobias Nygren said the following on 6/29/2007 12:36 PM:
> On Fri, 29 Jun 2007 11:10:11 -0400
> "Mehul N. Sanghvi" <mehul.sanghvi@gmail.com> wrote:
> 
>> Matthias Scheler said the following on 6/29/2007 8:09 AM:
>>> On Fri, Jun 29, 2007 at 12:20:13AM -0400, Mehul N. Sanghvi wrote:
>>>> pkg_rolling-replace uses 'sed -E' which seems to fail when running on 
>>>> Solaris. I've tried both 'gsed' and the Solaris supplied 'sed'.  Neither 
>>>>  has an option
>>>> called -E.  Does anyone know how to get about this ?
>>> Does using "nbsed" fix the problem?
>>>
>>> 	Kind regards
>>>
>>
>> Yes that fixed the problem.  How do I report "bugs" or "enhancement" requests 
>> for tools ?
>>
> 
> No need to make a report, I will repair it.
> 
> -Tobias
> 
> 

There was another issue also besides the fact that "-E" is not supported by all 
implementations of sed.

The script is a /bin/sh script, but uses constructs like $(...) instead of 
`...`, which is not supported by /bin/sh on Solaris, and I believe AIX and HPUX 
as well.

I suspect that it works on NetBSD and probably on Linux as well since, at least 
on Debian Linux anyway, because /bin/sh is a hard link to /bin/bash or is a 
restricted version of bash which supports the $(...) construct.

My suggestion is to either change the shell that is uses, or use the `...` 
construct to make the script portable.


cheers,

      mehul

-- 
Mehul N. Sanghvi
email: mehul.sanghvi@gmail.com