Re: CVS commit: src/external/bsd/kyua-atf-compat/dist

2013-02-25 Thread David Holland
On Mon, Feb 25, 2013 at 06:49:51PM +, Julio Merino wrote:
  Log Message:
  Cherry-pick upstream change d0daf9983f5a0e635f1127dbc827aa114daa90d8:
  
  Fix broken variable parsing with NetBSD's /bin/sh
  
  Quote the expansion of a $() command that was not properly surrounded
  by quotes so that this runs properly with NetBSD's /bin/sh.

In what way was it broken? (And where's the PR?)

-- 
David A. Holland
dholl...@netbsd.org


Re: CVS commit: src/external/bsd/kyua-atf-compat/dist

2013-02-25 Thread Paul Goyette

On Mon, 25 Feb 2013, David Holland wrote:


On Mon, Feb 25, 2013 at 06:49:51PM +, Julio Merino wrote:
 Log Message:
 Cherry-pick upstream change d0daf9983f5a0e635f1127dbc827aa114daa90d8:

 Fix broken variable parsing with NetBSD's /bin/sh

 Quote the expansion of a $() command that was not properly surrounded
 by quotes so that this runs properly with NetBSD's /bin/sh.

In what way was it broken? (And where's the PR?)


And when do we get a regression test case to detect it?

:)



-
| Paul Goyette | PGP Key fingerprint: | E-mail addresses:   |
| Customer Service | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com|
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net |
| Kernel Developer |  | pgoyette at netbsd.org  |
-


Re: CVS commit: src/external/bsd/kyua-atf-compat/dist

2013-02-25 Thread Julio Merino
On Mon, Feb 25, 2013 at 1:54 PM, David Holland
dholland-sourcechan...@netbsd.org wrote:
 On Mon, Feb 25, 2013 at 06:49:51PM +, Julio Merino wrote:
   Log Message:
   Cherry-pick upstream change d0daf9983f5a0e635f1127dbc827aa114daa90d8:
  
   Fix broken variable parsing with NetBSD's /bin/sh
  
   Quote the expansion of a $() command that was not properly surrounded
   by quotes so that this runs properly with NetBSD's /bin/sh.

 In what way was it broken? (And where's the PR?)

I was assuming my code was broken, not sh.  But I can file a PR with
the observed difference between sh and bash.

-- 
Julio Merino / @jmmv


Re: CVS commit: src/external/bsd/kyua-atf-compat/dist

2013-02-25 Thread David Laight
On Mon, Feb 25, 2013 at 06:54:13PM +, David Holland wrote:
 On Mon, Feb 25, 2013 at 06:49:51PM +, Julio Merino wrote:
   Log Message:
   Cherry-pick upstream change d0daf9983f5a0e635f1127dbc827aa114daa90d8:
   
   Fix broken variable parsing with NetBSD's /bin/sh
   
   Quote the expansion of a $() command that was not properly surrounded
   by quotes so that this runs properly with NetBSD's /bin/sh.
 
 In what way was it broken? (And where's the PR?)

I suspect that field splitting is applied to the RHS of assignments
when they are on local or export lines.

eg:
  (x=a b; b=fubar; export y=$x; echo $y; (echo $b))
outputs a and fubar (on two lines).

David

-- 
David Laight: da...@l8s.co.uk


Re: CVS commit: src/external/bsd/kyua-atf-compat/dist

2013-02-25 Thread David Laight
On Mon, Feb 25, 2013 at 08:43:51PM +, David Laight wrote:
 On Mon, Feb 25, 2013 at 06:54:13PM +, David Holland wrote:
  On Mon, Feb 25, 2013 at 06:49:51PM +, Julio Merino wrote:
Log Message:
Cherry-pick upstream change d0daf9983f5a0e635f1127dbc827aa114daa90d8:

Fix broken variable parsing with NetBSD's /bin/sh

Quote the expansion of a $() command that was not properly surrounded
by quotes so that this runs properly with NetBSD's /bin/sh.
  
  In what way was it broken? (And where's the PR?)
 
 I suspect that field splitting is applied to the RHS of assignments
 when they are on local or export lines.
 
 eg:
   (x=a b; b=fubar; export y=$x; echo $y; (echo $b))
 outputs a and fubar (on two lines).

Sorry - that doesn't do what I intended, try:
(x=a b; b=fubar; export y=$x; echo $y; sh -c 'echo $b')

David

-- 
David Laight: da...@l8s.co.uk


Re: CVS commit: src/external/bsd/kyua-atf-compat/dist

2013-02-25 Thread Valeriy E. Ushakov
On Mon, Feb 25, 2013 at 18:49:51 +, Julio Merino wrote:

 Module Name:  src
 Committed By: jmmv
 Date: Mon Feb 25 18:49:51 UTC 2013
 
 Modified Files:
   src/external/bsd/kyua-atf-compat/dist: atf-run.sh
 
 Log Message:
 Cherry-pick upstream change d0daf9983f5a0e635f1127dbc827aa114daa90d8:
 
 Fix broken variable parsing with NetBSD's /bin/sh
 
 Quote the expansion of a $() command that was not properly surrounded
 by quotes so that this runs properly with NetBSD's /bin/sh.

grep|sed pipeline is ok on a command line where one is lazy, in a
script it should be just sed :)

Your $ws doesn't do what you expect it to do.  Try your command on a
line that actually has tabs.  This is because backslash has no special
meaning inside [], so your \t is not a tab, but either a backslash or
a letter 't'.

-uwe