All of lore.kernel.org
 help / color / mirror / Atom feed
* "portable" sh is not...
@ 2007-10-23 11:54 John Levon
  2007-10-23 12:14 ` Christoph Egger
  0 siblings, 1 reply; 8+ messages in thread
From: John Levon @ 2007-10-23 11:54 UTC (permalink / raw)
  To: xen-devel; +Cc: Christoph.Egger


This commit:

http://xenbits.xensource.com/staging/xen-unstable.hg?rev/08295dc13166

broke our build. The script is not portable as claimed (e.g. traditional
Bourne shell has no $( ... ) construct). Christoph, why is this
necessary? Surely *BSD have /bin/bash

thanks
john

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: "portable" sh is not...
  2007-10-23 11:54 "portable" sh is not John Levon
@ 2007-10-23 12:14 ` Christoph Egger
  2007-10-23 12:20   ` John Levon
  0 siblings, 1 reply; 8+ messages in thread
From: Christoph Egger @ 2007-10-23 12:14 UTC (permalink / raw)
  To: John Levon; +Cc: xen-devel

On Tuesday 23 October 2007 13:54:43 John Levon wrote:
> This commit:
>
> http://xenbits.xensource.com/staging/xen-unstable.hg?rev/08295dc13166
>
> broke our build. The script is not portable as claimed (e.g. traditional
> Bourne shell has no $( ... ) construct).

The only one bash-specific thing I could find was the [:alpha:] notion.
This changeset makes it work on BSD's /bin/sh.
Looks like BSD's /bin/sh is not that traditional... :)

> Christoph, why is this necessary? Surely *BSD have /bin/bash

No, they have not. They have /bin/sh, /bin/ksh and /bin/csh.
bash is a third-party package.

Christoph

-- 
AMD Saxony, Dresden, Germany
Operating System Research Center

Legal Information:
AMD Saxony Limited Liability Company & Co. KG
Sitz (Geschäftsanschrift):
   Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland
Registergericht Dresden: HRA 4896
vertretungsberechtigter Komplementär:
   AMD Saxony LLC (Sitz Wilmington, Delaware, USA)
Geschäftsführer der AMD Saxony LLC:
   Dr. Hans-R. Deppe, Thomas McCoy

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: "portable" sh is not...
  2007-10-23 12:14 ` Christoph Egger
@ 2007-10-23 12:20   ` John Levon
  2007-10-23 12:27     ` Christoph Egger
  0 siblings, 1 reply; 8+ messages in thread
From: John Levon @ 2007-10-23 12:20 UTC (permalink / raw)
  To: Christoph Egger; +Cc: xen-devel

On Tue, Oct 23, 2007 at 02:14:38PM +0200, Christoph Egger wrote:

> > http://xenbits.xensource.com/staging/xen-unstable.hg?rev/08295dc13166
> >
> > broke our build. The script is not portable as claimed (e.g. traditional
> > Bourne shell has no $( ... ) construct).
> 
> The only one bash-specific thing I could find was the [:alpha:] notion.
> This changeset makes it work on BSD's /bin/sh.
> Looks like BSD's /bin/sh is not that traditional... :)
> 
> > Christoph, why is this necessary? Surely *BSD have /bin/bash
> 
> No, they have not. They have /bin/sh, /bin/ksh and /bin/csh.
> bash is a third-party package.

Can we make it use $SHELL? We have that set to bash.

regards
john

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: "portable" sh is not...
  2007-10-23 12:20   ` John Levon
@ 2007-10-23 12:27     ` Christoph Egger
  2007-10-23 12:34       ` John Levon
  0 siblings, 1 reply; 8+ messages in thread
From: Christoph Egger @ 2007-10-23 12:27 UTC (permalink / raw)
  To: John Levon; +Cc: xen-devel

On Tuesday 23 October 2007 14:20:14 John Levon wrote:
> On Tue, Oct 23, 2007 at 02:14:38PM +0200, Christoph Egger wrote:
> > > http://xenbits.xensource.com/staging/xen-unstable.hg?rev/08295dc13166
> > >
> > > broke our build. The script is not portable as claimed (e.g.
> > > traditional Bourne shell has no $( ... ) construct).
> >
> > The only one bash-specific thing I could find was the [:alpha:] notion.
> > This changeset makes it work on BSD's /bin/sh.
> > Looks like BSD's /bin/sh is not that traditional... :)

Looking through get-fields.sh, it seems the $( ... ) constructs can be
replaced with backticks. This should make Solaris' /bin/sh happy.

> > > Christoph, why is this necessary? Surely *BSD have /bin/bash
> >
> > No, they have not. They have /bin/sh, /bin/ksh and /bin/csh.
> > bash is a third-party package.
>
> Can we make it use $SHELL? We have that set to bash.

This is an alternative solution to mine above.

Christoph


-- 
AMD Saxony, Dresden, Germany
Operating System Research Center

Legal Information:
AMD Saxony Limited Liability Company & Co. KG
Sitz (Geschäftsanschrift):
   Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland
Registergericht Dresden: HRA 4896
vertretungsberechtigter Komplementär:
   AMD Saxony LLC (Sitz Wilmington, Delaware, USA)
Geschäftsführer der AMD Saxony LLC:
   Dr. Hans-R. Deppe, Thomas McCoy

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Re: "portable" sh is not...
  2007-10-23 12:27     ` Christoph Egger
@ 2007-10-23 12:34       ` John Levon
  2007-10-23 12:41         ` Christoph Egger
  0 siblings, 1 reply; 8+ messages in thread
From: John Levon @ 2007-10-23 12:34 UTC (permalink / raw)
  To: Christoph Egger; +Cc: xen-devel

On Tue, Oct 23, 2007 at 02:27:07PM +0200, Christoph Egger wrote:

> On Tuesday 23 October 2007 14:20:14 John Levon wrote:
> > On Tue, Oct 23, 2007 at 02:14:38PM +0200, Christoph Egger wrote:
> > > > http://xenbits.xensource.com/staging/xen-unstable.hg?rev/08295dc13166
> > > >
> > > > broke our build. The script is not portable as claimed (e.g.
> > > > traditional Bourne shell has no $( ... ) construct).
> > >
> > > The only one bash-specific thing I could find was the [:alpha:] notion.
> > > This changeset makes it work on BSD's /bin/sh.
> > > Looks like BSD's /bin/sh is not that traditional... :)
> 
> Looking through get-fields.sh, it seems the $( ... ) constructs can be
> replaced with backticks. This should make Solaris' /bin/sh happy.

vim is highlighting stuff like

                                        type=${token#COMPAT_HANDLE?}
                                        type=${type%?}
                                        type=${type#compat_}

as bad, but I don't know what those constructs do.

regards
john

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Re: "portable" sh is not...
  2007-10-23 12:34       ` John Levon
@ 2007-10-23 12:41         ` Christoph Egger
  2007-10-23 13:14           ` John Levon
  0 siblings, 1 reply; 8+ messages in thread
From: Christoph Egger @ 2007-10-23 12:41 UTC (permalink / raw)
  To: John Levon; +Cc: xen-devel

On Tuesday 23 October 2007 14:34:39 John Levon wrote:
> On Tue, Oct 23, 2007 at 02:27:07PM +0200, Christoph Egger wrote:
> > On Tuesday 23 October 2007 14:20:14 John Levon wrote:
> > > On Tue, Oct 23, 2007 at 02:14:38PM +0200, Christoph Egger wrote:
> > > > > http://xenbits.xensource.com/staging/xen-unstable.hg?rev/08295dc131
> > > > >66
> > > > >
> > > > > broke our build. The script is not portable as claimed (e.g.
> > > > > traditional Bourne shell has no $( ... ) construct).
> > > >
> > > > The only one bash-specific thing I could find was the [:alpha:]
> > > > notion. This changeset makes it work on BSD's /bin/sh.
> > > > Looks like BSD's /bin/sh is not that traditional... :)
> >
> > Looking through get-fields.sh, it seems the $( ... ) constructs can be
> > replaced with backticks. This should make Solaris' /bin/sh happy.
>
> vim is highlighting stuff like
>
>                                         type=${token#COMPAT_HANDLE?}
>                                         type=${type%?}
>                                         type=${type#compat_}
>
> as bad,

Does that imply in your case, Solaris' /bin/sh does not support these
constructs?

> but I don't know what those constructs do. 

snippet form "man sh":

     ${name#pattern}
     ${name##pattern}
             If pattern matches the beginning of the value of parameter name,
             the matched text is deleted from the result of substitution.  A
             single `#' results in the shortest match, and two of them result
             in the longest match.

     ${name%pattern}
     ${name%%pattern}
             Like ${..#..} substitution, but it deletes from the end of the
             value.


Christoph


-- 
AMD Saxony, Dresden, Germany
Operating System Research Center

Legal Information:
AMD Saxony Limited Liability Company & Co. KG
Sitz (Geschäftsanschrift):
   Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland
Registergericht Dresden: HRA 4896
vertretungsberechtigter Komplementär:
   AMD Saxony LLC (Sitz Wilmington, Delaware, USA)
Geschäftsführer der AMD Saxony LLC:
   Dr. Hans-R. Deppe, Thomas McCoy

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Re: "portable" sh is not...
  2007-10-23 12:41         ` Christoph Egger
@ 2007-10-23 13:14           ` John Levon
  2007-10-23 13:23             ` Christoph Egger
  0 siblings, 1 reply; 8+ messages in thread
From: John Levon @ 2007-10-23 13:14 UTC (permalink / raw)
  To: Christoph Egger; +Cc: xen-devel

On Tue, Oct 23, 2007 at 02:41:26PM +0200, Christoph Egger wrote:

> Does that imply in your case, Solaris' /bin/sh does not support these
> constructs?

It does seem that way.

john

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Re: "portable" sh is not...
  2007-10-23 13:14           ` John Levon
@ 2007-10-23 13:23             ` Christoph Egger
  0 siblings, 0 replies; 8+ messages in thread
From: Christoph Egger @ 2007-10-23 13:23 UTC (permalink / raw)
  To: John Levon; +Cc: xen-devel

On Tuesday 23 October 2007 15:14:00 John Levon wrote:
> On Tue, Oct 23, 2007 at 02:41:26PM +0200, Christoph Egger wrote:
> > Does that imply in your case, Solaris' /bin/sh does not support these
> > constructs?
>
> It does seem that way.

Thanks to Keir, problem is fixed:
http://xenbits.xensource.com/staging/xen-unstable.hg/rev/9d1d27fddc50

Christoph

-- 
AMD Saxony, Dresden, Germany
Operating System Research Center

Legal Information:
AMD Saxony Limited Liability Company & Co. KG
Sitz (Geschäftsanschrift):
   Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland
Registergericht Dresden: HRA 4896
vertretungsberechtigter Komplementär:
   AMD Saxony LLC (Sitz Wilmington, Delaware, USA)
Geschäftsführer der AMD Saxony LLC:
   Dr. Hans-R. Deppe, Thomas McCoy

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-10-23 13:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-23 11:54 "portable" sh is not John Levon
2007-10-23 12:14 ` Christoph Egger
2007-10-23 12:20   ` John Levon
2007-10-23 12:27     ` Christoph Egger
2007-10-23 12:34       ` John Levon
2007-10-23 12:41         ` Christoph Egger
2007-10-23 13:14           ` John Levon
2007-10-23 13:23             ` Christoph Egger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.