Re: scripts/makelst: bc -> shell Re: sed _s_gnu_alternatives_ (Re: [rft] (g)awk substitution)

2007-02-03 Thread Oleg Verych
On Sat, Feb 03, 2007 at 12:24:59PM +0100, David Weinehall wrote:
> On Sat, Jan 27, 2007 at 06:38:36AM +, Oleg Verych wrote:
> [snip]
> > ,-*- diff snip -*-
> > |-t4=`echo $t3 | gawk '{ print $1 }'`
> > |-t5=`echo $t1 | gawk '{ print $1 }'`
> > |+t4=`pos_param 1 $t3`
> > |+t5=`pos_param 1 $t1`
> > 5 t6=`echo $t4 - $t5 | tr a-f A-F`
> > 6 t7=`( echo  ibase=16 ; echo $t6 ) | bc`
> > `-*-
> > 
> > I've just noticed, that things on lines 5 and 6 may be optimized.
> > 
> > t7=`printf "%lu" $(( 0x$t4 - 0x$t5 ))`
> 
> %lu does not seem to agree with SuSv3:
> 
> http://www.opengroup.org/onlinepubs/009695399/utilities/printf.html
> http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap05.html

,-*- xbd_chap05.html -*-
| The EXTENDED DESCRIPTION section almost exactly matches the
| printf() function in the ISO C standard, although it is described
| in terms of the file format notation in the Base Definitions volume
| of IEEE Std 1003.1-2001, Chapter 5, File Format Notation.
`-*-
In other words, it does *not* match it at all. How it can without
the length modifiers?

As for me, "shalls" and "shoulds", "Implementations are encouraged" are
standard terms of The Standards.

Thus, i think, "%ul" is more "implementation wise":

,-*- printf test on bash, dash, busybox -*-
|[EMAIL PROTECTED]:~$
|[EMAIL PROTECTED]:~$ printf "%u \n" 0x
|18446744073709551615
|[EMAIL PROTECTED]:~$ printf "%u \n" 0xA
|bash: printf: warning: 0xA: Numerical result out of range
|18446744073709551615
|[EMAIL PROTECTED]:~$
|[EMAIL PROTECTED]:~$ echo $BASH_VERSION
|3.1.17(1)-release
|[EMAIL PROTECTED]:~$
|[EMAIL PROTECTED]:~$ /bin/dash
|flower:-$ printf "%u \n" 0x
|18446744073709551615
|flower:-$ printf "%u \n" 0xA
|printf: 2: 0xA: Numerical result out of range
|18446744073709551615
|flower:-$
|flower:-$ /bin/busybox sh
|
|
|BusyBox v1.1.3 (Debian 1:1.1.3-4) Built-in shell (ash)
|Enter 'help' for a list of built-in commands.
|
|flower:-$
|flower:-$
|flower:-$ printf "%u \n" 0x
|4294967295
|flower:-$ printf "%u \n" 0xA
|0xA4294967295
|flower:-$ printf "%lu \n" 0x
|18446744073709551615
|flower:-$ printf "%lu \n" 0xA
|0xA18446744073709551615
|flower:-$
|flower:-$
`-*-


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: scripts/makelst: bc -> shell Re: sed _s_gnu_alternatives_ (Re: [rft] (g)awk substitution)

2007-02-03 Thread David Weinehall
On Sat, Jan 27, 2007 at 06:38:36AM +, Oleg Verych wrote:
[snip]
> ,-*- diff snip -*-
> |-t4=`echo $t3 | gawk '{ print $1 }'`
> |-t5=`echo $t1 | gawk '{ print $1 }'`
> |+t4=`pos_param 1 $t3`
> |+t5=`pos_param 1 $t1`
> 5 t6=`echo $t4 - $t5 | tr a-f A-F`
> 6 t7=`( echo  ibase=16 ; echo $t6 ) | bc`
> `-*-
> 
> I've just noticed, that things on lines 5 and 6 may be optimized.
> 
> t7=`printf "%lu" $(( 0x$t4 - 0x$t5 ))`

%lu does not seem to agree with SuSv3:

http://www.opengroup.org/onlinepubs/009695399/utilities/printf.html
http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap05.html

[snip]


Regards: David Weinehall
-- 
 /) David Weinehall <[EMAIL PROTECTED]> /) Northern lights wander  (\
//  Maintainer of the v2.0 kernel   //  Dance across the winter sky //
\)  http://www.acc.umu.se/~tao/(/   Full colour fire   (/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: sed _s_gnu_alternatives_ (Re: [rft] (g)awk substitution)

2007-02-03 Thread David Weinehall
On Thu, Jan 25, 2007 at 07:14:07PM +, Oleg Verych wrote:
> On Thu, Jan 25, 2007 at 01:03:32PM -0500, Rob Landley wrote:
> > On Thursday 25 January 2007 4:40 am, Oleg Verych wrote:
> > > > Your objection is a bit like saying "and don't use cat".  I'm saying 
> > > > don't 
> > > > call cat "gcat" when you just mean plain old cat.
> > > 
> > > No it's not, really. I don't want to see pipes, fork()s, disk seek,
> > > when task can be done without it. I know, what awk is, and i hope it
> > > will have its better time.
> > 
> > *shrug*  Making the need for "gawk" go away was my goal, and gawk->awk was 
> > the 
> > minimal change.  If you want more than that, I'm not objecting, just not 
> > personally interested.
> 
> Yes making uclibc as a bit more work, than rename things ;D. And my
> change is mainly from optimization point of view (say modern embedded ;)
> 
> > I believe "shift 5" is also SUSv3. :)
> 
> If you have tested, please send ack or nack to us.

Yes, shift [n] is available in SuSv3:

http://www.opengroup.org/onlinepubs/009695399/utilities/shift.html


Regards: David
-- 
 /) David Weinehall <[EMAIL PROTECTED]> /) Northern lights wander  (\
//  Maintainer of the v2.0 kernel   //  Dance across the winter sky //
\)  http://www.acc.umu.se/~tao/(/   Full colour fire   (/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: sed _s_gnu_alternatives_ (Re: [rft] (g)awk substitution)

2007-02-03 Thread David Weinehall
On Thu, Jan 25, 2007 at 07:14:07PM +, Oleg Verych wrote:
 On Thu, Jan 25, 2007 at 01:03:32PM -0500, Rob Landley wrote:
  On Thursday 25 January 2007 4:40 am, Oleg Verych wrote:
Your objection is a bit like saying and don't use cat.  I'm saying 
don't 
call cat gcat when you just mean plain old cat.
   
   No it's not, really. I don't want to see pipes, fork()s, disk seek,
   when task can be done without it. I know, what awk is, and i hope it
   will have its better time.
  
  *shrug*  Making the need for gawk go away was my goal, and gawk-awk was 
  the 
  minimal change.  If you want more than that, I'm not objecting, just not 
  personally interested.
 
 Yes making uclibc as a bit more work, than rename things ;D. And my
 change is mainly from optimization point of view (say modern embedded ;)
 
  I believe shift 5 is also SUSv3. :)
 
 If you have tested, please send ack or nack to us.

Yes, shift [n] is available in SuSv3:

http://www.opengroup.org/onlinepubs/009695399/utilities/shift.html


Regards: David
-- 
 /) David Weinehall [EMAIL PROTECTED] /) Northern lights wander  (\
//  Maintainer of the v2.0 kernel   //  Dance across the winter sky //
\)  http://www.acc.umu.se/~tao/(/   Full colour fire   (/
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: scripts/makelst: bc - shell Re: sed _s_gnu_alternatives_ (Re: [rft] (g)awk substitution)

2007-02-03 Thread David Weinehall
On Sat, Jan 27, 2007 at 06:38:36AM +, Oleg Verych wrote:
[snip]
 ,-*- diff snip -*-
 |-t4=`echo $t3 | gawk '{ print $1 }'`
 |-t5=`echo $t1 | gawk '{ print $1 }'`
 |+t4=`pos_param 1 $t3`
 |+t5=`pos_param 1 $t1`
 5 t6=`echo $t4 - $t5 | tr a-f A-F`
 6 t7=`( echo  ibase=16 ; echo $t6 ) | bc`
 `-*-
 
 I've just noticed, that things on lines 5 and 6 may be optimized.
 
 t7=`printf %lu $(( 0x$t4 - 0x$t5 ))`

%lu does not seem to agree with SuSv3:

http://www.opengroup.org/onlinepubs/009695399/utilities/printf.html
http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap05.html

[snip]


Regards: David Weinehall
-- 
 /) David Weinehall [EMAIL PROTECTED] /) Northern lights wander  (\
//  Maintainer of the v2.0 kernel   //  Dance across the winter sky //
\)  http://www.acc.umu.se/~tao/(/   Full colour fire   (/
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: scripts/makelst: bc - shell Re: sed _s_gnu_alternatives_ (Re: [rft] (g)awk substitution)

2007-02-03 Thread Oleg Verych
On Sat, Feb 03, 2007 at 12:24:59PM +0100, David Weinehall wrote:
 On Sat, Jan 27, 2007 at 06:38:36AM +, Oleg Verych wrote:
 [snip]
  ,-*- diff snip -*-
  |-t4=`echo $t3 | gawk '{ print $1 }'`
  |-t5=`echo $t1 | gawk '{ print $1 }'`
  |+t4=`pos_param 1 $t3`
  |+t5=`pos_param 1 $t1`
  5 t6=`echo $t4 - $t5 | tr a-f A-F`
  6 t7=`( echo  ibase=16 ; echo $t6 ) | bc`
  `-*-
  
  I've just noticed, that things on lines 5 and 6 may be optimized.
  
  t7=`printf %lu $(( 0x$t4 - 0x$t5 ))`
 
 %lu does not seem to agree with SuSv3:
 
 http://www.opengroup.org/onlinepubs/009695399/utilities/printf.html
 http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap05.html

,-*- xbd_chap05.html -*-
| The EXTENDED DESCRIPTION section almost exactly matches the
| printf() function in the ISO C standard, although it is described
| in terms of the file format notation in the Base Definitions volume
| of IEEE Std 1003.1-2001, Chapter 5, File Format Notation.
`-*-
In other words, it does *not* match it at all. How it can without
the length modifiers?

As for me, shalls and shoulds, Implementations are encouraged are
standard terms of The Standards.

Thus, i think, %ul is more implementation wise:

,-*- printf test on bash, dash, busybox -*-
|[EMAIL PROTECTED]:~$
|[EMAIL PROTECTED]:~$ printf %u \n 0x
|18446744073709551615
|[EMAIL PROTECTED]:~$ printf %u \n 0xA
|bash: printf: warning: 0xA: Numerical result out of range
|18446744073709551615
|[EMAIL PROTECTED]:~$
|[EMAIL PROTECTED]:~$ echo $BASH_VERSION
|3.1.17(1)-release
|[EMAIL PROTECTED]:~$
|[EMAIL PROTECTED]:~$ /bin/dash
|flower:-$ printf %u \n 0x
|18446744073709551615
|flower:-$ printf %u \n 0xA
|printf: 2: 0xA: Numerical result out of range
|18446744073709551615
|flower:-$
|flower:-$ /bin/busybox sh
|
|
|BusyBox v1.1.3 (Debian 1:1.1.3-4) Built-in shell (ash)
|Enter 'help' for a list of built-in commands.
|
|flower:-$
|flower:-$
|flower:-$ printf %u \n 0x
|4294967295
|flower:-$ printf %u \n 0xA
|0xA4294967295
|flower:-$ printf %lu \n 0x
|18446744073709551615
|flower:-$ printf %lu \n 0xA
|0xA18446744073709551615
|flower:-$
|flower:-$
`-*-


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


scripts/makelst: bc -> shell Re: sed _s_gnu_alternatives_ (Re: [rft] (g)awk substitution)

2007-01-26 Thread Oleg Verych
Hallo.

On Sat, Jan 27, 2007 at 01:18:30AM +0100, Tim Schmielau wrote:
> On Fri, 26 Jan 2007, Oleg Verych wrote:
> 
> > In Debian's version it has no `bc', while native `bc' is producing
> > crap like that:
> > ,-*- bash -*-
> > |[EMAIL PROTECTED]:~$ printf "%u" $(( -1 )) ; echo
> > |18446744073709551615
> > |[EMAIL PROTECTED]:~$ echo -1 | bc
> > |-1
> > |[EMAIL PROTECTED]:~$ printf "%u" $(( 0xFF )) ; echo
> > |255
> > |[EMAIL PROTECTED]:~$ echo FF | bc
> > |99
> > |[EMAIL PROTECTED]:~$ echo F | bc
> > |15
> > |[EMAIL PROTECTED]:~$
> > `-*-
> > 
> > i can't understand the result... I think linux/scripts/makelst may be
> > updated to have sh's version of address calculation ;)
> 
> No, IMHO that should not be a reason to change anything in the kernel.
> Just set ibase=16 or read the fine manual:

Thank you very much ;) Maybe i must use XSLT with 0.99 kernel, or
what?

I'm talking about patch posted here:
Message-ID: <[EMAIL PROTECTED]>
Archived-At: 

,-*- diff snip -*-
|-t4=`echo $t3 | gawk '{ print $1 }'`
|-t5=`echo $t1 | gawk '{ print $1 }'`
|+t4=`pos_param 1 $t3`
|+t5=`pos_param 1 $t1`
5 t6=`echo $t4 - $t5 | tr a-f A-F`
6 t7=`( echo  ibase=16 ; echo $t6 ) | bc`
`-*-

I've just noticed, that things on lines 5 and 6 may be optimized.

t7=`printf "%lu" $(( 0x$t4 - 0x$t5 ))`

No tr, no bc, no pipes -- magic!
Better know and use our *fine shell*.

And if you jouined us, Tim, maybe can share your experience and test
patch above and this one, please?
Message-ID: <[EMAIL PROTECTED]>
Archived-At: 

It's just my optimization hint. I have no bc, and i'm sure
things, like that will cause silent misinformation.

Anyway, what is so bad in `sh'?

Thanks.

-*- OT -*-
>   info '(bc)About Expressions and Special Variables'
GFDL. Enough of that bull, even Documentation/ is *free* from it.

Good bye.
--
-o--=O`C  info emacs : not found  /. .\ ( is there any reason to live? )
 #oo'L O  info make  : not found  o (yes --- R.I.P. FSF+RMS)
<___=E M  man gcc: not found`-- ( viva Debian Operating System )
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: sed _s_gnu_alternatives_ (Re: [rft] (g)awk substitution)

2007-01-26 Thread Tim Schmielau
On Fri, 26 Jan 2007, Oleg Verych wrote:

> In Debian's version it has no `bc', while native `bc' is producing
> crap like that:
> ,-*- bash -*-
> |[EMAIL PROTECTED]:~$ printf "%u" $(( -1 )) ; echo
> |18446744073709551615
> |[EMAIL PROTECTED]:~$ echo -1 | bc
> |-1
> |[EMAIL PROTECTED]:~$ printf "%u" $(( 0xFF )) ; echo
> |255
> |[EMAIL PROTECTED]:~$ echo FF | bc
> |99
> |[EMAIL PROTECTED]:~$ echo F | bc
> |15
> |[EMAIL PROTECTED]:~$
> `-*-
> 
> i can't understand the result... I think linux/scripts/makelst may be
> updated to have sh's version of address calculation ;)

No, IMHO that should not be a reason to change anything in the kernel.
Just set ibase=16 or read the fine manual:
  info '(bc)About Expressions and Special Variables'

Tim
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: sed _s_gnu_alternatives_ (Re: [rft] (g)awk substitution)

2007-01-26 Thread Oleg Verych
On Fri, Jan 26, 2007 at 12:47:20PM -0500, Rob Landley wrote:
> On Thursday 25 January 2007 4:18 pm, Oleg Verych wrote:
> 
> > > As I said, I'm not particularly interested in a more intrusive solution 
> > > solving a problem I haven't actually seen.  I don't see any obvious 
> > > reason 
> > > why it wouldn't work, and yes it would probably also solve my problem, but
> > > I still don't see why you think it's "better" than the three byte fix.
> > 
> > Ehhh. "I'm not guilty" issue. Well, fine ;)
> 
> "guilty"?
> 
> You attempted to hijack my simple observation ("awk is the standard name, 
> gawk 
> is not") into an attempt to replace susv3 standard utilities with extra shell 
> script.  This is a separate agenda, and I have _no_ idea why you think I'm 
> obligated to pursue it for you.
> 
> The motivation for my patch is taht circa 2.6.12 I didn't need gawk on my 
> system to build; the need for it cropped up fairly recently.  This is A) an 
> artificial requirement, B) a regression, C) trivial to fix.
> 
> I could also teach busybox awk to be called as "gawk", but awk is the 
> standard 
> name and gawk is not, and gawk can already be called as awk.  The _clean_ 
> thing to do is send a patch to get Linux to use the standard name, which I 
> did.  This is the minimally intrusive change, and since gawk's install 
> creates an awk symlink it shouldn't affect any existing systems.
> 
> That's what I did.  I am simply not interested in your attempts to do 
> something else, in hopes of fixing a problem I haven't seen and which I'm not 
> convinced actually exists.

IMHO every embedded developer besides size cares about speed and
reducing complexity of simple things. Yes, this is orthogonal to that,
you want to say to me.

Only thing i wanted to have as reasult is ack or nack on my patch.
Everything else is outside LKML.

> > If your current system is IA-32, or you have access to one, would you
> > like to test scripts/makelst for me, as i'm seeing `bc' there. But my 
> > system have not one, i would like to replace it with shell or awk or
> > whatever. TIA.
> 
> According to Posix and SUSv3, a development environment can be expected to 
> have bc:
> http://www.opengroup.org/onlinepubs/009695399/utilities/bc.html
> 
> Would you like to try the one in busybox?

In Debian's version it has no `bc', while native `bc' is producing
crap like that:
,-*- bash -*-
|[EMAIL PROTECTED]:~$ printf "%u" $(( -1 )) ; echo
|18446744073709551615
|[EMAIL PROTECTED]:~$ echo -1 | bc
|-1
|[EMAIL PROTECTED]:~$ printf "%u" $(( 0xFF )) ; echo
|255
|[EMAIL PROTECTED]:~$ echo FF | bc
|99
|[EMAIL PROTECTED]:~$ echo F | bc
|15
|[EMAIL PROTECTED]:~$
`-*-

i can't understand the result... I think linux/scripts/makelst may be
updated to have sh's version of address calculation ;)

> The minimal development environment I can build a working system in is 7 
> packages: linux, gcc, binutils, make, busybox, uClibc, bash.  This is not 
> theoretical: I have actually done this, and I was building systems under this 
> as far back as 2003.  (I became busybox maintainer after spending 2 years 
> upgrading busybox to make this _work_.  I started by rewriting sed.  I didn't 
> _know_ sed at the time, but binutils ./configure used some rather advanced 
> sed scripts to build, so I fixed it.  It works now.)

I'm glad. All i can say in this context: do you know `dash' shell.
It's pretty much OK for not interactive use, small, fast, POSIX
compliant (or should be ;).

> I'm using this to get a minimal native environment on non-x86 target 
> platforms, to minimize the amount of cross compiling I have to do when 
> bootstrapping a new platform.  (I submitted an OLS tutorial proposal on this, 
> although I dunno if they're interested.)

Goodluck!


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: sed _s_gnu_alternatives_ (Re: [rft] (g)awk substitution)

2007-01-26 Thread Rob Landley
On Thursday 25 January 2007 4:18 pm, Oleg Verych wrote:

> > As I said, I'm not particularly interested in a more intrusive solution 
> > solving a problem I haven't actually seen.  I don't see any obvious reason 
> > why it wouldn't work, and yes it would probably also solve my problem, but
> > I still don't see why you think it's "better" than the three byte fix.
> 
> Ehhh. "I'm not guilty" issue. Well, fine ;)

"guilty"?

You attempted to hijack my simple observation ("awk is the standard name, gawk 
is not") into an attempt to replace susv3 standard utilities with extra shell 
script.  This is a separate agenda, and I have _no_ idea why you think I'm 
obligated to pursue it for you.

The motivation for my patch is taht circa 2.6.12 I didn't need gawk on my 
system to build; the need for it cropped up fairly recently.  This is A) an 
artificial requirement, B) a regression, C) trivial to fix.

I could also teach busybox awk to be called as "gawk", but awk is the standard 
name and gawk is not, and gawk can already be called as awk.  The _clean_ 
thing to do is send a patch to get Linux to use the standard name, which I 
did.  This is the minimally intrusive change, and since gawk's install 
creates an awk symlink it shouldn't affect any existing systems.

That's what I did.  I am simply not interested in your attempts to do 
something else, in hopes of fixing a problem I haven't seen and which I'm not 
convinced actually exists.

> If your current system is IA-32, or you have access to one, would you
> like to test scripts/makelst for me, as i'm seeing `bc' there. But my 
> system have not one, i would like to replace it with shell or awk or
> whatever. TIA.

According to Posix and SUSv3, a development environment can be expected to 
have bc:
http://www.opengroup.org/onlinepubs/009695399/utilities/bc.html

Would you like to try the one in busybox?

The minimal development environment I can build a working system in is 7 
packages: linux, gcc, binutils, make, busybox, uClibc, bash.  This is not 
theoretical: I have actually done this, and I was building systems under this 
as far back as 2003.  (I became busybox maintainer after spending 2 years 
upgrading busybox to make this _work_.  I started by rewriting sed.  I didn't 
_know_ sed at the time, but binutils ./configure used some rather advanced 
sed scripts to build, so I fixed it.  It works now.)

I'm using this to get a minimal native environment on non-x86 target 
platforms, to minimize the amount of cross compiling I have to do when 
bootstrapping a new platform.  (I submitted an OLS tutorial proposal on this, 
although I dunno if they're interested.)

Rob
-- 
"Perfection is reached, not when there is no longer anything to add, but
when there is no longer anything to take away." - Antoine de Saint-Exupery
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: sed _s_gnu_alternatives_ (Re: [rft] (g)awk substitution)

2007-01-26 Thread Rob Landley
On Thursday 25 January 2007 4:18 pm, Oleg Verych wrote:

  As I said, I'm not particularly interested in a more intrusive solution 
  solving a problem I haven't actually seen.  I don't see any obvious reason 
  why it wouldn't work, and yes it would probably also solve my problem, but
  I still don't see why you think it's better than the three byte fix.
 
 Ehhh. I'm not guilty issue. Well, fine ;)

guilty?

You attempted to hijack my simple observation (awk is the standard name, gawk 
is not) into an attempt to replace susv3 standard utilities with extra shell 
script.  This is a separate agenda, and I have _no_ idea why you think I'm 
obligated to pursue it for you.

The motivation for my patch is taht circa 2.6.12 I didn't need gawk on my 
system to build; the need for it cropped up fairly recently.  This is A) an 
artificial requirement, B) a regression, C) trivial to fix.

I could also teach busybox awk to be called as gawk, but awk is the standard 
name and gawk is not, and gawk can already be called as awk.  The _clean_ 
thing to do is send a patch to get Linux to use the standard name, which I 
did.  This is the minimally intrusive change, and since gawk's install 
creates an awk symlink it shouldn't affect any existing systems.

That's what I did.  I am simply not interested in your attempts to do 
something else, in hopes of fixing a problem I haven't seen and which I'm not 
convinced actually exists.

 If your current system is IA-32, or you have access to one, would you
 like to test scripts/makelst for me, as i'm seeing `bc' there. But my 
 system have not one, i would like to replace it with shell or awk or
 whatever. TIA.

According to Posix and SUSv3, a development environment can be expected to 
have bc:
http://www.opengroup.org/onlinepubs/009695399/utilities/bc.html

Would you like to try the one in busybox?

The minimal development environment I can build a working system in is 7 
packages: linux, gcc, binutils, make, busybox, uClibc, bash.  This is not 
theoretical: I have actually done this, and I was building systems under this 
as far back as 2003.  (I became busybox maintainer after spending 2 years 
upgrading busybox to make this _work_.  I started by rewriting sed.  I didn't 
_know_ sed at the time, but binutils ./configure used some rather advanced 
sed scripts to build, so I fixed it.  It works now.)

I'm using this to get a minimal native environment on non-x86 target 
platforms, to minimize the amount of cross compiling I have to do when 
bootstrapping a new platform.  (I submitted an OLS tutorial proposal on this, 
although I dunno if they're interested.)

Rob
-- 
Perfection is reached, not when there is no longer anything to add, but
when there is no longer anything to take away. - Antoine de Saint-Exupery
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: sed _s_gnu_alternatives_ (Re: [rft] (g)awk substitution)

2007-01-26 Thread Oleg Verych
On Fri, Jan 26, 2007 at 12:47:20PM -0500, Rob Landley wrote:
 On Thursday 25 January 2007 4:18 pm, Oleg Verych wrote:
 
   As I said, I'm not particularly interested in a more intrusive solution 
   solving a problem I haven't actually seen.  I don't see any obvious 
   reason 
   why it wouldn't work, and yes it would probably also solve my problem, but
   I still don't see why you think it's better than the three byte fix.
  
  Ehhh. I'm not guilty issue. Well, fine ;)
 
 guilty?
 
 You attempted to hijack my simple observation (awk is the standard name, 
 gawk 
 is not) into an attempt to replace susv3 standard utilities with extra shell 
 script.  This is a separate agenda, and I have _no_ idea why you think I'm 
 obligated to pursue it for you.
 
 The motivation for my patch is taht circa 2.6.12 I didn't need gawk on my 
 system to build; the need for it cropped up fairly recently.  This is A) an 
 artificial requirement, B) a regression, C) trivial to fix.
 
 I could also teach busybox awk to be called as gawk, but awk is the 
 standard 
 name and gawk is not, and gawk can already be called as awk.  The _clean_ 
 thing to do is send a patch to get Linux to use the standard name, which I 
 did.  This is the minimally intrusive change, and since gawk's install 
 creates an awk symlink it shouldn't affect any existing systems.
 
 That's what I did.  I am simply not interested in your attempts to do 
 something else, in hopes of fixing a problem I haven't seen and which I'm not 
 convinced actually exists.

IMHO every embedded developer besides size cares about speed and
reducing complexity of simple things. Yes, this is orthogonal to that,
you want to say to me.

Only thing i wanted to have as reasult is ack or nack on my patch.
Everything else is outside LKML.

  If your current system is IA-32, or you have access to one, would you
  like to test scripts/makelst for me, as i'm seeing `bc' there. But my 
  system have not one, i would like to replace it with shell or awk or
  whatever. TIA.
 
 According to Posix and SUSv3, a development environment can be expected to 
 have bc:
 http://www.opengroup.org/onlinepubs/009695399/utilities/bc.html
 
 Would you like to try the one in busybox?

In Debian's version it has no `bc', while native `bc' is producing
crap like that:
,-*- bash -*-
|[EMAIL PROTECTED]:~$ printf %u $(( -1 )) ; echo
|18446744073709551615
|[EMAIL PROTECTED]:~$ echo -1 | bc
|-1
|[EMAIL PROTECTED]:~$ printf %u $(( 0xFF )) ; echo
|255
|[EMAIL PROTECTED]:~$ echo FF | bc
|99
|[EMAIL PROTECTED]:~$ echo F | bc
|15
|[EMAIL PROTECTED]:~$
`-*-

i can't understand the result... I think linux/scripts/makelst may be
updated to have sh's version of address calculation ;)

 The minimal development environment I can build a working system in is 7 
 packages: linux, gcc, binutils, make, busybox, uClibc, bash.  This is not 
 theoretical: I have actually done this, and I was building systems under this 
 as far back as 2003.  (I became busybox maintainer after spending 2 years 
 upgrading busybox to make this _work_.  I started by rewriting sed.  I didn't 
 _know_ sed at the time, but binutils ./configure used some rather advanced 
 sed scripts to build, so I fixed it.  It works now.)

I'm glad. All i can say in this context: do you know `dash' shell.
It's pretty much OK for not interactive use, small, fast, POSIX
compliant (or should be ;).

 I'm using this to get a minimal native environment on non-x86 target 
 platforms, to minimize the amount of cross compiling I have to do when 
 bootstrapping a new platform.  (I submitted an OLS tutorial proposal on this, 
 although I dunno if they're interested.)

Goodluck!


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: sed _s_gnu_alternatives_ (Re: [rft] (g)awk substitution)

2007-01-26 Thread Tim Schmielau
On Fri, 26 Jan 2007, Oleg Verych wrote:

 In Debian's version it has no `bc', while native `bc' is producing
 crap like that:
 ,-*- bash -*-
 |[EMAIL PROTECTED]:~$ printf %u $(( -1 )) ; echo
 |18446744073709551615
 |[EMAIL PROTECTED]:~$ echo -1 | bc
 |-1
 |[EMAIL PROTECTED]:~$ printf %u $(( 0xFF )) ; echo
 |255
 |[EMAIL PROTECTED]:~$ echo FF | bc
 |99
 |[EMAIL PROTECTED]:~$ echo F | bc
 |15
 |[EMAIL PROTECTED]:~$
 `-*-
 
 i can't understand the result... I think linux/scripts/makelst may be
 updated to have sh's version of address calculation ;)

No, IMHO that should not be a reason to change anything in the kernel.
Just set ibase=16 or read the fine manual:
  info '(bc)About Expressions and Special Variables'

Tim
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


scripts/makelst: bc - shell Re: sed _s_gnu_alternatives_ (Re: [rft] (g)awk substitution)

2007-01-26 Thread Oleg Verych
Hallo.

On Sat, Jan 27, 2007 at 01:18:30AM +0100, Tim Schmielau wrote:
 On Fri, 26 Jan 2007, Oleg Verych wrote:
 
  In Debian's version it has no `bc', while native `bc' is producing
  crap like that:
  ,-*- bash -*-
  |[EMAIL PROTECTED]:~$ printf %u $(( -1 )) ; echo
  |18446744073709551615
  |[EMAIL PROTECTED]:~$ echo -1 | bc
  |-1
  |[EMAIL PROTECTED]:~$ printf %u $(( 0xFF )) ; echo
  |255
  |[EMAIL PROTECTED]:~$ echo FF | bc
  |99
  |[EMAIL PROTECTED]:~$ echo F | bc
  |15
  |[EMAIL PROTECTED]:~$
  `-*-
  
  i can't understand the result... I think linux/scripts/makelst may be
  updated to have sh's version of address calculation ;)
 
 No, IMHO that should not be a reason to change anything in the kernel.
 Just set ibase=16 or read the fine manual:

Thank you very much ;) Maybe i must use XSLT with 0.99 kernel, or
what?

I'm talking about patch posted here:
Message-ID: [EMAIL PROTECTED]
Archived-At: http://permalink.gmane.org/gmane.linux.kernel/485999

,-*- diff snip -*-
|-t4=`echo $t3 | gawk '{ print $1 }'`
|-t5=`echo $t1 | gawk '{ print $1 }'`
|+t4=`pos_param 1 $t3`
|+t5=`pos_param 1 $t1`
5 t6=`echo $t4 - $t5 | tr a-f A-F`
6 t7=`( echo  ibase=16 ; echo $t6 ) | bc`
`-*-

I've just noticed, that things on lines 5 and 6 may be optimized.

t7=`printf %lu $(( 0x$t4 - 0x$t5 ))`

No tr, no bc, no pipes -- magic!
Better know and use our *fine shell*.

And if you jouined us, Tim, maybe can share your experience and test
patch above and this one, please?
Message-ID: [EMAIL PROTECTED]
Archived-At: http://permalink.gmane.org/gmane.linux.kernel/485984

It's just my optimization hint. I have no bc, and i'm sure
things, like that will cause silent misinformation.

Anyway, what is so bad in `sh'?

Thanks.

-*- OT -*-
   info '(bc)About Expressions and Special Variables'
GFDL. Enough of that bull, even Documentation/ is *free* from it.

Good bye.
--
-o--=O`C  info emacs : not found  /. .\ ( is there any reason to live? )
 #oo'L O  info make  : not found  o (yes --- R.I.P. FSF+RMS)
___=E M  man gcc: not found`-- ( viva Debian Operating System )
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: sed _s_gnu_alternatives_ (Re: [rft] (g)awk substitution)

2007-01-25 Thread Oleg Verych
On Thu, Jan 25, 2007 at 02:38:02PM -0500, Rob Landley wrote:
> On Thursday 25 January 2007 2:14 pm, Oleg Verych wrote:
> > > I believe "shift 5" is also SUSv3. :)
> > 
> > If you have tested, please send ack or nack to us.
> 
> I have not.  I tested the one I sent.  Today I'm at a different location than 
> that test environment.  All I can try it on here is Ubuntu, and so could you 
> just as easily.
> 
> As I said, I'm not particularly interested in a more intrusive solution 
> solving a problem I haven't actually seen.  I don't see any obvious reason 
> why it wouldn't work, and yes it would probably also solve my problem, but I 
> still don't see why you think it's "better" than the three byte fix.

Ehhh. "I'm not guilty" issue. Well, fine ;)

If your current system is IA-32, or you have access to one, would you
like to test scripts/makelst for me, as i'm seeing `bc' there. But my
system have not one, i would like to replace it with shell or awk or
whatever. TIA.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: sed _s_gnu_alternatives_ (Re: [rft] (g)awk substitution)

2007-01-25 Thread Rob Landley
On Thursday 25 January 2007 2:14 pm, Oleg Verych wrote:
> > I believe "shift 5" is also SUSv3. :)
> 
> If you have tested, please send ack or nack to us.

I have not.  I tested the one I sent.  Today I'm at a different location than 
that test environment.  All I can try it on here is Ubuntu, and so could you 
just as easily.

As I said, I'm not particularly interested in a more intrusive solution 
solving a problem I haven't actually seen.  I don't see any obvious reason 
why it wouldn't work, and yes it would probably also solve my problem, but I 
still don't see why you think it's "better" than the three byte fix.

Rob
-- 
"Perfection is reached, not when there is no longer anything to add, but
when there is no longer anything to take away." - Antoine de Saint-Exupery
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: sed _s_gnu_alternatives_ (Re: [rft] (g)awk substitution)

2007-01-25 Thread Oleg Verych
On Thu, Jan 25, 2007 at 01:03:32PM -0500, Rob Landley wrote:
> On Thursday 25 January 2007 4:40 am, Oleg Verych wrote:
> > > Your objection is a bit like saying "and don't use cat".  I'm saying 
> > > don't 
> > > call cat "gcat" when you just mean plain old cat.
> > 
> > No it's not, really. I don't want to see pipes, fork()s, disk seek,
> > when task can be done without it. I know, what awk is, and i hope it
> > will have its better time.
> 
> *shrug*  Making the need for "gawk" go away was my goal, and gawk->awk was 
> the 
> minimal change.  If you want more than that, I'm not objecting, just not 
> personally interested.

Yes making uclibc as a bit more work, than rename things ;D. And my
change is mainly from optimization point of view (say modern embedded ;)

> I believe "shift 5" is also SUSv3. :)

If you have tested, please send ack or nack to us.

Thanks.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: sed _s_gnu_alternatives_ (Re: [rft] (g)awk substitution)

2007-01-25 Thread Rob Landley
On Thursday 25 January 2007 4:40 am, Oleg Verych wrote:
> > Your objection is a bit like saying "and don't use cat".  I'm saying don't 
> > call cat "gcat" when you just mean plain old cat.
> 
> No it's not, really. I don't want to see pipes, fork()s, disk seek,
> when task can be done without it. I know, what awk is, and i hope it
> will have its better time.

*shrug*  Making the need for "gawk" go away was my goal, and gawk->awk was the 
minimal change.  If you want more than that, I'm not objecting, just not 
personally interested.

I believe "shift 5" is also SUSv3. :)

Rob
-- 
"Perfection is reached, not when there is no longer anything to add, but
when there is no longer anything to take away." - Antoine de Saint-Exupery
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


sed _s_gnu_alternatives_ (Re: [rft] (g)awk substitution)

2007-01-25 Thread Oleg Verych
On Wed, Jan 24, 2007 at 08:51:32PM -0500, Rob Landley wrote:
> On Wednesday 24 January 2007 4:03 pm, Oleg Verych wrote:
> 
> > Let me propose you to test this as solution, that need no awk, only shell:
> 
> Actually awk is one of the standard Single Unix Specification (version 3) 
> utilities and the kernel build uses it in a number of places, such as 
> arch/alpha/boot/Makefile, drivers/eisa/Makefile, scripts/ver_linux.

I saw that. If you will test my first replacements and it will be ok,
i will go to this.

> Your objection is a bit like saying "and don't use cat".  I'm saying don't 
> call cat "gcat" when you just mean plain old cat.

No it's not, really. I don't want to see pipes, fork()s, disk seek,
when task can be done without it. I know, what awk is, and i hope it
will have its better time.

> > p.s. who is going to make alternative to GNU make ? ;D
> 
> Me.  Seriously.  It's on my todo list, as part of the Firmware Linux project:

Well. I didn't expect such answer! So, after my trying to deal with
makefiles (there so many to cleanup and structure), i think it will be
easy to do so. I did contacted (ft)jam developers, but didn't get any
answer on current state of it vs GNU make.

> http://lwn.net/Articles/215941/
> 
> Although as major projects go, it's about fifth down on the list after 
> getting 
> toybox up to speed, writing a proper bash replacement shell, getting tcc to 
> build an unmodified Linux kernel, convincing the uClibc guys to HAVE ANOTHER 
> RELEASE ALREADY (it's been a year and a half, I _sent_ a cake)...

Thanks for information.

> Today, I'm writing a gene2fs that produces streaming output (I.E. it works 
> like tar).  It's not done yet...

Good luck !


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


sed _s_gnu_alternatives_ (Re: [rft] (g)awk substitution)

2007-01-25 Thread Oleg Verych
On Wed, Jan 24, 2007 at 08:51:32PM -0500, Rob Landley wrote:
 On Wednesday 24 January 2007 4:03 pm, Oleg Verych wrote:
 
  Let me propose you to test this as solution, that need no awk, only shell:
 
 Actually awk is one of the standard Single Unix Specification (version 3) 
 utilities and the kernel build uses it in a number of places, such as 
 arch/alpha/boot/Makefile, drivers/eisa/Makefile, scripts/ver_linux.

I saw that. If you will test my first replacements and it will be ok,
i will go to this.

 Your objection is a bit like saying and don't use cat.  I'm saying don't 
 call cat gcat when you just mean plain old cat.

No it's not, really. I don't want to see pipes, fork()s, disk seek,
when task can be done without it. I know, what awk is, and i hope it
will have its better time.

  p.s. who is going to make alternative to GNU make ? ;D
 
 Me.  Seriously.  It's on my todo list, as part of the Firmware Linux project:

Well. I didn't expect such answer! So, after my trying to deal with
makefiles (there so many to cleanup and structure), i think it will be
easy to do so. I did contacted (ft)jam developers, but didn't get any
answer on current state of it vs GNU make.

 http://lwn.net/Articles/215941/
 
 Although as major projects go, it's about fifth down on the list after 
 getting 
 toybox up to speed, writing a proper bash replacement shell, getting tcc to 
 build an unmodified Linux kernel, convincing the uClibc guys to HAVE ANOTHER 
 RELEASE ALREADY (it's been a year and a half, I _sent_ a cake)...

Thanks for information.

 Today, I'm writing a gene2fs that produces streaming output (I.E. it works 
 like tar).  It's not done yet...

Good luck !


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: sed _s_gnu_alternatives_ (Re: [rft] (g)awk substitution)

2007-01-25 Thread Rob Landley
On Thursday 25 January 2007 4:40 am, Oleg Verych wrote:
  Your objection is a bit like saying and don't use cat.  I'm saying don't 
  call cat gcat when you just mean plain old cat.
 
 No it's not, really. I don't want to see pipes, fork()s, disk seek,
 when task can be done without it. I know, what awk is, and i hope it
 will have its better time.

*shrug*  Making the need for gawk go away was my goal, and gawk-awk was the 
minimal change.  If you want more than that, I'm not objecting, just not 
personally interested.

I believe shift 5 is also SUSv3. :)

Rob
-- 
Perfection is reached, not when there is no longer anything to add, but
when there is no longer anything to take away. - Antoine de Saint-Exupery
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: sed _s_gnu_alternatives_ (Re: [rft] (g)awk substitution)

2007-01-25 Thread Oleg Verych
On Thu, Jan 25, 2007 at 01:03:32PM -0500, Rob Landley wrote:
 On Thursday 25 January 2007 4:40 am, Oleg Verych wrote:
   Your objection is a bit like saying and don't use cat.  I'm saying 
   don't 
   call cat gcat when you just mean plain old cat.
  
  No it's not, really. I don't want to see pipes, fork()s, disk seek,
  when task can be done without it. I know, what awk is, and i hope it
  will have its better time.
 
 *shrug*  Making the need for gawk go away was my goal, and gawk-awk was 
 the 
 minimal change.  If you want more than that, I'm not objecting, just not 
 personally interested.

Yes making uclibc as a bit more work, than rename things ;D. And my
change is mainly from optimization point of view (say modern embedded ;)

 I believe shift 5 is also SUSv3. :)

If you have tested, please send ack or nack to us.

Thanks.

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: sed _s_gnu_alternatives_ (Re: [rft] (g)awk substitution)

2007-01-25 Thread Rob Landley
On Thursday 25 January 2007 2:14 pm, Oleg Verych wrote:
  I believe shift 5 is also SUSv3. :)
 
 If you have tested, please send ack or nack to us.

I have not.  I tested the one I sent.  Today I'm at a different location than 
that test environment.  All I can try it on here is Ubuntu, and so could you 
just as easily.

As I said, I'm not particularly interested in a more intrusive solution 
solving a problem I haven't actually seen.  I don't see any obvious reason 
why it wouldn't work, and yes it would probably also solve my problem, but I 
still don't see why you think it's better than the three byte fix.

Rob
-- 
Perfection is reached, not when there is no longer anything to add, but
when there is no longer anything to take away. - Antoine de Saint-Exupery
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: sed _s_gnu_alternatives_ (Re: [rft] (g)awk substitution)

2007-01-25 Thread Oleg Verych
On Thu, Jan 25, 2007 at 02:38:02PM -0500, Rob Landley wrote:
 On Thursday 25 January 2007 2:14 pm, Oleg Verych wrote:
   I believe shift 5 is also SUSv3. :)
  
  If you have tested, please send ack or nack to us.
 
 I have not.  I tested the one I sent.  Today I'm at a different location than 
 that test environment.  All I can try it on here is Ubuntu, and so could you 
 just as easily.
 
 As I said, I'm not particularly interested in a more intrusive solution 
 solving a problem I haven't actually seen.  I don't see any obvious reason 
 why it wouldn't work, and yes it would probably also solve my problem, but I 
 still don't see why you think it's better than the three byte fix.

Ehhh. I'm not guilty issue. Well, fine ;)

If your current system is IA-32, or you have access to one, would you
like to test scripts/makelst for me, as i'm seeing `bc' there. But my
system have not one, i would like to replace it with shell or awk or
whatever. TIA.


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/