Re: [Toybox] Editors and such.

2012-06-20 Thread Rob Landley
On 06/18/2012 10:10 PM, Andre Renaud wrote:
 No, they have an implementation of screen. The first one I used (circa
 1993) was from Sun.

 The wonkypedia article says the first pair of maintainers handed it over
 to a second pair of maintainers who handed it over to the gnu project.
 So it's a bit like Gold and Patch and Grub and EGCS so on: somebody
 wrote a thing that worked and the Gnu project managed to take it over
 and plaster their name all over it as the versions they ship bloat and
 lose reliability.
 
 There is a BSD-licensed terminal multiplexer - 'tmux'. It's
 conceptually the same as GNU screen, but I'm assuming it's a
 completely clean code base.

I wrote a terminal multiplexer for my old chamelyn bulletin board
system as a teenager. (DOS with Desqview. Those were the days. Well,
some of 'em anyway.)

All the tabbed browsing terminals are also terminal multiplexers. In
Linux, ptys make it easy.

The fiddly part is curses output, but the line handling stuff for
editing a shell command line and doing command line history is 90% of
the work, and then stacking those vertically gets you something like vi.
(That was my general plan of attack, anyway.)

Keep in mind that Unix doesn't implement backspace sanely (like the
commodore 64 did), thus you have to figure out when you're at the left
edge of the screen (keeping track of your cursor position)

That's why if you do echo -n this will screw bash up and then cursor
up a few times bash's command history gets all wonky because it _thinks_
it knows where the cursor is but actually started farther to the right.
 (I contributed ansi escape screen position querying code to busybox to
improve the situation for ash.)

I'm pretty sure I blogged about this... Recentish:

http://landley.net/notes-2011.html#15-11-2011

During toybox's first regeneration:

http://landley.net/notes-2007.html#19-10-2007

Rob
-- 
GNU/Linux isn't: Linux=GPLv2, GNU=GPLv3+, they can't share code.
Either it's mere aggregation, or a license violation.  Pick one.
___
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net


Re: [Toybox] Notes about netcat toy

2012-06-20 Thread Rob Landley
On 06/19/2012 06:18 AM, orc wrote:
 Hm, seems to be that toybox netcat does not support udp mode and
 ipv6.

Yup.  Those are todo items.

Genericizing the code so I can use the same engine for telnet would be
nice too.

 I'm using ipv6 for internal purposes so I see that if I want
 ipv6-aware netcat in toybox I need to follow one of two ways here:

I want udp support so I can do:

http://sarah.thesharps.us/2009-02-22-09-00

I'd also like to resolve this command line argument incompatability:

http://lists.busybox.net/pipermail/busybox/2009-July/069920.html

http://landley.net/hg/aboriginal/rev/1218

 - Rewrite current netcat.c logic that it will support ipv6

It's on my todo list, and not actually that big a code change.

 - Port openbsd's netcat.c into toybox (much work needed plus stripping
   unneeded code, 3-clause BSD)

 (Another way is to use openbsd netcat.c directly)

In which case how is toybox involved?

 I have dirty (with #if 0 parts) code that supports ipv6 in current
 toybox netcat via getaddrinfo, but with udp mode I'm stuck.

If you send me the patch and I can probably clean it up.

 Implementing udp option will be useful too.
 Rob, do you have some plans about this toy?

I have many, many plans.  My todo list runneth over.

Finishing netcat is left over from my 2009 todo list:

http://landley.net/toybox/todos/notes.txt

 netcat/nc: Implement remaining command line options.

I got buried in new command submissions for a bit (until I lost track of
what already merged code needed what cleanups), and then buried in
non-toybox stuff, and am now slowly trying to catch back up.

I'm prioritizing having the code that's implemented be _good_ over
having buckets of features quickly, because otherwise what's the point
of doing yet another implementation of all this stuff that's already out
there?

 Then, some other notes:
 
 - busybox and openbsd netcats doesn't require to specify source
 address and port for listen mode. Maybe rewrite netcat that it will
 accept something like 'netcat -L 127.0.0.1 8033'?

See above.

 - Toybox netcat says that it executes program from -e option, but
   actually executes it via toys.optargs.

It executes the rest of the command line after -e.  If you give it -e
one two three it's just like typing one two three on the command
line and you'd better have a command with spaces in its name in your $PATH.

 - New network toys should be ready for ipv6 by default.

Note the date:

changeset:   189:22d22427dec6
user:Rob Landley r...@landley.net
date:Mon Dec 03 18:53:00 2007 -0600
files:   toys/Config.in toys/netcat.c toys/toylist.h
description:
Add first pass at netcat.  Base applet, -f, and -w implemented.

world ipv6 launch day was earlier this month, and was once again
resoundingly ignored:

http://www.fiercetelecom.com/story/world-ipv6-launch-results-what-effect-did-event-have-internet/2012-06-18

Global ipv4 traffic, 189.81 Tbps (terabits? terabytes?  Terasomething.)
 ipv6 traffic: 24.07 giga-whatevers. So ipv4 is still about 10,000 times
as much traffic as ipv6.

Yay the future and all that.  I'd like to support ipv6 on general
principles. But unless you're in korea (the whole country sharing an old
class B 16 bit IP address block last I checked), it's still coming
soon now 15 years after I first heard about it when somebody did a
presentation at a LUG meeting back in the 90's.

Rob
-- 
GNU/Linux isn't: Linux=GPLv2, GNU=GPLv3+, they can't share code.
Either it's mere aggregation, or a license violation.  Pick one.
___
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net


Re: [Toybox] [PATCH] Support HOSTCFLAGS on musl

2012-06-20 Thread orc
On Wed, 20 Jun 2012 18:56:35 -0500
Rob Landley r...@landley.net wrote:

 On 06/19/2012 02:41 AM, orc wrote:
  Seems no,
  
  cc -o kconfig/mconf kconfig/mconf.c kconfig/zconf.tab.c \
  kconfig/lxdialog/*.c -lcurses
  -DCURSES_LOC=ncurses.h \ -DKBUILD_NO_NLS=1
  -DPROJECT_NAME=\ToyBox\ kconfig/mconf.c:274: error: 'PATH_MAX'
  undeclared here (not in a function)
  ...
  
  setting HOSTCC works, but HOSTCFLAGS still not passed to $CC,
  results in above when doing 'make menuconfig
  HOSTCFLAGS=-D_GNU_SOURCE'.
 
 Ok, with no patch, try:
 
   make distclean
   HOSTCC=cc --static make defconfig
 
 The --static flag gets applied to the compiler.

Okay, I'm see now that I can apply any CFLAGS :-)

 
  (And then ripping out the old CCFLAGS stuff which apparently never
  got documented.)
 
  It seems easiest to just add the flags straight into the one
  variable since it gets expanded and reparsed for whitespace by the
  existing scripts. (Admittedly that means if you have path to
  hostcc with a space in it, it won't work, but that's already the
  case and nobody's complained...)
  
  But scripts are not called before cc called. make -n menuconfig
  shows on top of clean toybox-0.3.0:
 
 You're right, that's why commit 484 set hostcc if it isn't already
 set. Forgot that.
 
 Eventually when menuconfig gets redone the whole kconfig directory
 goes with it, and the new stuff should actually get built by a script
 like the rest of it.  (Makefiles are not my friend.)
 
  And because of that I patched kconfig/Makefile directly, for setting
  HOSTCFLAGS at the menuconfig stage, without HOSTCFLAGS it fails due
  to feature test macros on musl.
  
  (There already was a mail about that and you answered 'Seems
  reasonable.', that one I've sent with attachment was the result of
  corrupted patch pasted into message. Are we talking about 'make
  menuconfig' failure or I missed something?)
 
 Upon further review I noticed that your patch only modified the
 kconfig stuff and not the build for scripts/install.c binary. The
 instlist binary is also built with the host compiler, and already had
 a different variable performing this function. So simply applying
 your patch would have made the code inconsistent.
 
 Your patch added three lines, but upon further review I thought I
 might be able to do it with only one line, and now I suspect i just
 need to add a FAQ entry to add the flags to HOSTCC and not add any
 code to the build scripts at all.

I modified only kconfig, but you can always review and improve/reject
changes. Just did not got that CFLAGS can be set with HOSTCC (many
projects suggest to use CFLAGS). Now the issue with toybox configuring
is solved.

 
 Rob

___
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net