[Toybox] Probably another release over the weekend.

2012-06-13 Thread Rob Landley
Now that I've built the static binaries for all the targets (which took a day and a half on my netbook, left running overnight), I'm noticing some cross-platform bugs. For example, ls -l in x86-64 works fine (even built against uClibc), but on i686 it prints (null) for the time field, and on

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

2012-06-13 Thread Rob Landley
On 06/13/2012 09:58 AM, orc wrote: This patch adds support for specifying HOSTCFLAGS, for something like make menuconfig HOSTCFLAGS=-D_GNU_SOURCE on musl systems. Seems reasonable. There is one issue remain on musl systems. musl has no crypt.h, But it has shadow.h? Weird. but I don't

[Toybox] Found the ls bug on 32 bit targets.

2012-06-13 Thread Rob Landley
It's that printf was treating st-blah fields as integers, which had various behavior based on endianness and word size. (on x86-64 it coincidentally worked out great, i686 always got null, arm segfaulted, powerpc corrupted the stack and behaved _really_weird_...) Fixed. I'm bringing the roadmap

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

2012-06-14 Thread Rob Landley
On 06/14/2012 04:04 AM, orc wrote: And crypt.h exists because you only get crypt() defined out of that if you #define a feature test macro nobody ever uses. (Feature test macros in standard C headers: still an EPICALLY STUPID IDEA.) I agree. Btw sed -i '/crypt.h/d' ... recursively on other

Re: [Toybox] Editors and such.

2012-06-17 Thread Rob Landley
On 06/16/2012 10:47 AM, David Seikel wrote: On Fri, 15 Jun 2012 21:20:11 +1000 David Seikel onef...@gmail.com wrote: Then there would be a toy I'm calling toyboxes. Hmm, seems toybox does not like toy names that partially match the names of other toys. Every time I try to use toyboxes,

Re: [Toybox] Archive features.

2012-06-18 Thread Rob Landley
On 06/18/2012 10:55 AM, Ashwini Sharma wrote: Hi Rob, I was wondering if you would like to use comression/decompression libraries like libbzip2, zlib etc... for the implementation of archive features *tar *and *gzip.* Nope. Those are external dependencies, I don't want any outside of

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

Re: [Toybox] Notes about netcat toy

2012-06-20 Thread Rob Landley
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

[Toybox] And 0.3.1 is out.

2012-06-25 Thread Rob Landley
Trying to do the release early, release often thing more. I got a new laptop to switch to (with _more_ than 2 gigs of ram, woo!), and I'm _not_ setting up thunderbird on it (piece of garbage) so my email may be a bit funky until I find a new email client I can tolerate. I'll save my 39 pending

Re: [Toybox] Editors and such.

2012-07-01 Thread Rob Landley
On 07/01/2012 01:13 AM, David Seikel wrote: On Sat, 30 Jun 2012 20:02:55 -0500 Rob Landley r...@landley.net wrote: On 06/30/2012 07:01 PM, David Seikel wrote: Oh yeah, my infrastructure is aiming at sed to. All fairly similar at the basic level anyway. What does interactive line editing

Re: [Toybox] od (was: Editors and such.)

2012-07-03 Thread Rob Landley
On 07/01/2012 02:47 PM, Andre Renaud wrote: If the output of od gets dropped (-EPIPE), what happens? Should it retry short writes, which implies xprintf() should do an xmprintf() into a malloc buffer and then do a writeall() on it, although I really am trying to get automatic retry in there

Re: [Toybox] Defect in Argument parsing for # and -

2012-07-03 Thread Rob Landley
On 07/02/2012 10:05 PM, Ashwini Sharma wrote: Hi Rob, I was using '#' for accepting a integer parameter. As per the parsing logic you used function atolx(), for converting the string to long. This function assumes suffixes with the supplied string. There are possibilities that user may not

Re: [Toybox] Defect in Argument parsing for # and -

2012-07-04 Thread Rob Landley
On 07/03/2012 11:49 PM, Ashwini Sharma wrote: I can grab a third character (maybe %) for literal long. The tradeoff here is between generic behavior (which can share code) and precise behavior that does exactly what you want. Some things need suffixes, so I made everything accept suffixes by

Re: [Toybox] cmp.c EOF notice on stderr vs stdout

2012-07-07 Thread Rob Landley
On 07/05/2012 01:19 PM, Elie De Brauwer wrote: Hi all, In this changeset http://www.landley.net/hg/toybox/rev/e7c742f78361 the EOF notification of cmp.c went to stdout iso of to stderr. This however causes the cmp tests to fail, since on my debian laptop with the fsf cmp it goes to stderr:

Re: [Toybox] tail and trailing newlines

2012-07-07 Thread Rob Landley
On 07/05/2012 04:08 PM, Elie De Brauwer wrote: Hello all, In attachment a small patch. I touches two things (i can always split the patch in two). Applied, thanks. Back to wrestling with od... Rob -- GNU/Linux isn't: Linux=GPLv2, GNU=GPLv3+, they can't share code. Either it's mere

Re: [Toybox] Newtoy: modinfo

2012-07-09 Thread Rob Landley
On 07/09/2012 12:24 AM, Andre Renaud wrote: Hi, Attached is a simple implementation of modinfo. Assuming this is ok, it lends itself pretty closely to the depmod (and possibly modprobe) tool as well, in that they basically involve scanning /lib/modules for .ko files and processing them.

Re: [Toybox] new toy : w command

2012-07-18 Thread Rob Landley
On 07/18/2012 08:40 AM, Gaurang Shastri wrote: Hi All, Please find attached the initial implementation of w command. Output after compiling my code with toybox : {{{ [root@stark toybox-0.3.0]# ./toybox w USER TTY LOGIN@ FROM roottty2 Wed Jul

Re: [Toybox] new toy: taskset

2012-07-18 Thread Rob Landley
On 07/18/2012 02:53 AM, Elie De Brauwer wrote: On 07/18/2012 04:26 AM, Rob Landley wrote: On 07/15/2012 06:34 AM, Elie De Brauwer wrote: Hello all, In attach you can find an initial version of 'taskset'. It allows setting the cpu affinity of a given PID (or all tasks related with a given

Re: [Toybox] new toy : w command

2012-07-19 Thread Rob Landley
On 07/18/2012 04:09 PM, David Seikel wrote: On Wed, 18 Jul 2012 11:40:59 -0700 Tim Bird tbird...@gmail.com wrote: On Wed, Jul 18, 2012 at 6:40 AM, Gaurang Shastri gmshas...@gmail.com wrote: Hi All, Please find attached the initial implementation of w command. Output after compiling my

Re: [Toybox] Preferred submission format (was Re: new toy : w command)

2012-07-19 Thread Rob Landley
On 07/18/2012 04:45 PM, Tim Bird wrote: On 07/18/2012 02:09 PM, David Seikel wrote: On Wed, 18 Jul 2012 11:40:59 -0700 Tim Bird tbird...@gmail.com wrote: It is better to provide the patch inline, in the message body, rather than as an attachment. This allows people to easily respond to

Re: [Toybox] patch: make login use the shared read_passwd function

2012-07-20 Thread Rob Landley
On 07/20/2012 01:47 AM, Elie De Brauwer wrote: All, In attach a patch which make the entire things actually smaller ;), login.c used a function to read a password which was virtually identical to a more globally defined function in lib/password.c, so I removed the one in login.c and made

Re: [Toybox] patch: taskset-work-as-nice (was Re: new toy: taskset)

2012-07-20 Thread Rob Landley
On 07/20/2012 02:51 AM, Elie De Brauwer wrote: On 07/19/2012 03:41 AM, Rob Landley wrote: Meaning to works as renice, rather than nice. I'm open to suggestions, I can as well the 'work-as-nice' functionality, Is there more to it than: if (opt.argc2) xexec(toys.optargs+2); Well, taskset

[Toybox] Notes about mount: VFS flags.

2012-08-12 Thread Rob Landley
The mount system call takes five arguments: int mount(char *source, char *target, char *filesystemtype, unsigned long mountflags, void *data); The first is what to mount, the second where to mount it, and the third is filesystem type. The simplest variant of this is a block device, a

Re: [Toybox] linenoise

2012-10-27 Thread Rob Landley
On 12/05/2011 05:11:52 PM, David Seikel wrote: On Mon, 5 Dec 2011 14:41:06 +0100 Jens Staal staal1...@gmail.com wrote: Would this be interesting for some toybox utilities? https://github.com/antirez/linenoise Rob was looking at that before, plus a few other similar readline alternatives.

Re: [Toybox] [df] percentage different from GNU df

2012-11-09 Thread Rob Landley
On 11/09/2012 12:24:39 AM, Roy Tam wrote: Hello, 2012/11/9 Roy Tam roy...@gmail.com: Hello, 2012/11/9 Rob Landley r...@landley.net: On 10/28/2012 10:50:50 PM, Roy Tam wrote: Hello, I noticed that toybox df shows different percentage from GNU df. GNU df calculates percentage by used

[Toybox] 0.4.1 is out.

2012-11-15 Thread Rob Landley
Release notes are on the website, and this time I remembered to build the static binaries. This release was a giant backlog-clearing exercise. Aboriginal Linux is now converted over to build toybox by default, so I've got a built in regression test that I can plug each new version of

Re: [Toybox] Compile errors when compiling for ARM

2012-11-28 Thread Rob Landley
On 11/28/2012 10:59:38 PM, Ashwini Sharma wrote: Hi Rob, I am getting few other warnings related to portability.h. When compiling for ARM target it throws warning: implicit declaration of function 'getsid' warning: implicit declaration of function 'getpgid' I'm not finding either of those in

Re: [Toybox] Compile errors when compiling for ARM

2012-11-28 Thread Rob Landley
On 11/28/2012 10:59:38 PM, Ashwini Sharma wrote: Hi Rob, I am getting few other warnings related to portability.h. When compiling for ARM target it throws warning: implicit declaration of function 'getsid' warning: implicit declaration of function 'getpgid' I tried the code sourcery armv7l

Re: [Toybox] More expand cleanups

2012-11-30 Thread Rob Landley
On 11/28/2012 03:34:59 AM, Jonathan Clairembault wrote: Back to expand_file(). The downside of using readall() is that interactive granularity goes way down. I had this problem with tee once upon a time, it meant that piping the output of anything through tee made it appear in 4k

Re: [Toybox] long options support and yesno()

2012-12-07 Thread Rob Landley
On 12/04/2012 11:34:16 PM, Ashwini Sharma wrote: Hi Rob, As for the command options FLAG_xxx macros are auto generated. Is the long options support in there and working? It generates FLAG_ macros for the short options, but not yet for the long options. This comes up if you have long

Re: [Toybox] implementation of stat for toybox

2012-12-07 Thread Rob Landley
On 12/06/2012 04:24:59 AM, Kamlendu Shekhar wrote: Hi Rob, I tried to implement stat command as per toybox's standards. Please find it as attachment. It has been tested on x86 CentOS 32 bit and ubuntu 64 bit systems. Option -Z has not been implemented as of now. I am working on that. Can

Re: [Toybox] sha1sum tests

2012-12-09 Thread Rob Landley
On 12/08/2012 07:35:31 AM, Elie De Brauwer wrote: Hello all, In attach you can find some tests for sha1sum, these are mainly based on http://tools.ietf.org/html/rfc3174. I just placed them in sha1sum.test, but apparently sha1sum.c has recently been consumed by md5sum.c so it might or might

Re: [Toybox] implementation of stat for toybox

2012-12-10 Thread Rob Landley
On 12/08/2012 02:24:09 AM, Kamlendu Shekhar wrote: Sorry Rob. I am extremely sorry for that. I had modified toys.h in my local system. I missed to attach that file. Please find the patch for toys.h as attachment. I can clean up the technical bits myself, but I can't answer this question

Re: [Toybox] Fix, killall is not allowed to kill itself

2012-12-17 Thread Rob Landley
On 12/16/2012 11:31:49 AM, David Seikel wrote: On Sun, 16 Dec 2012 16:54:24 +0100 Elie De Brauwer eliedebrau...@gmail.com wrote: The LSB specification of killall says A killall process never kills itself (but may kill other killall processes). The current implementation of killall does not

Re: [Toybox] Add -m option to mkdir

2012-12-23 Thread Rob Landley
On 12/23/2012 01:31:10 PM, Bastian Bittorf wrote: * Felix Janda felix.ja...@posteo.de [23.12.2012 20:23]: Hi, of created directory), the other adds a test script for it. The test script uses the non-standard command stat since it seems to be the right tool for determining permissions

Re: [Toybox] Fix, killall is not allowed to kill itself

2012-12-23 Thread Rob Landley
On 12/16/2012 11:12:59 AM, Elie De Brauwer wrote: All, In my previous patch, the pif shouldn't be stored inside the GLOBAL(), it should be just a regular global variable. In attach a patch which corrects this. Ok, I finally took a proper look at this, and I don't understand why can't

Re: [Toybox] Fix, killall is not allowed to kill itself

2012-12-23 Thread Rob Landley
On 12/23/2012 02:45:57 PM, Elie De Brauwer wrote: On 12/23/2012 09:42 PM, Rob Landley wrote: On 12/16/2012 11:12:59 AM, Elie De Brauwer wrote: All, In my previous patch, the pif shouldn't be stored inside the GLOBAL(), it should be just a regular global variable. In attach a patch which

Re: [Toybox] Fix, killall is not allowed to kill itself

2012-12-23 Thread Rob Landley
On 12/23/2012 11:44:27 PM, David Seikel wrote: On Sun, 23 Dec 2012 23:25:46 -0600 Rob Landley r...@landley.net wrote: On 12/23/2012 08:45:07 PM, David Seikel wrote: Like rm'ing something that does not exist, the end result is the same, except for the useless error. Using

Re: [Toybox] [groups] : ! More than one in group is error

2012-12-27 Thread Rob Landley
On 12/26/2012 10:24:53 PM, Ashwini Sharma wrote: Hey Rob, Options mutual exclusion handling is having a Seg Fault in function gotflag. I think that means you referenced an option that doesn't exist. (If you enable TOYBOX_DEBUG in the config, it's supposed to catch this and spit out an

Re: [Toybox] [groups] : ! More than one in group is error

2012-12-27 Thread Rob Landley
On 12/27/2012 11:06:37 AM, Felix Janda wrote: When trying to implement the remaining options for pwd I could also test toybox's group option handling. The option string I wanted to use is: 0LP[!LP] (It's the same for LP[!LP].) With the current argparsing I get a segfault for pwd -L -P. When

Re: [Toybox] [groups] : ! More than one in group is error

2012-12-29 Thread Rob Landley
On 12/27/2012 10:32:51 PM, Ashwini Sharma wrote: Hi Rob, With your fix, it doesn't segfault now. But does it matter, to give the proper option name in error message. If yes, then the fix fails in that. e.g. when running *./toybox touch -d 12 -r f2 f1* it throws the error message as *touch:

Re: [Toybox] Add remaining pwd options

2012-12-29 Thread Rob Landley
On 12/28/2012 03:24:17 PM, Felix Janda wrote: Hi, the first patch adds the -L and -P options to pwd as specified by POSIX. The test script again uses stat. This time in order to get inode numbers of directories. For future reference adding the test in the same commit as the changes

Re: [Toybox] Add remaining pwd options

2012-12-29 Thread Rob Landley
On 12/29/2012 07:38:24 AM, Felix Janda wrote: On 12/29/12 at 03:53am, Rob Landley wrote: On 12/28/2012 03:24:17 PM, Felix Janda wrote: Hi, the first patch adds the -L and -P options to pwd as specified by POSIX. The test script again uses stat. This time in order to get inode

Re: [Toybox] Add remaining pwd options

2012-12-30 Thread Rob Landley
On 12/29/2012 07:38:24 AM, Felix Janda wrote: POSIX says that pwd should behave the same as pwd -L. The current pwd -P should behave the same way as the previous version of pwd. It just returns the getcwd() output. pwd -L does just check whether the environment variable PWD is also a valid

Re: [Toybox] Add remaining pwd options

2012-12-30 Thread Rob Landley
On 12/30/2012 04:47:13 AM, Felix Janda wrote: Thanks for the various clarifications and making pwd -L check for dot and dot-dot as described in the standard. Looking at the POSIX man page toysh should set $PWD at some point, too. Right now we have toysh is hugely incomplete and I just

Re: [Toybox] Segfault in cd

2012-12-30 Thread Rob Landley
On 12/30/2012 05:05:48 AM, Felix Janda wrote: Right now using toybox's version of cd from toysh with no argument gives me a segfault, apparently from freeing an invalid pointer in run_pipeline(). The attached patch fixes it for me. Yeah, it looks like commit 121 broke it back in 2007. (I

Re: [Toybox] Add remaining pwd options

2013-01-13 Thread Rob Landley
distracted and sleep deprived...), so I'm wrong a lot. I just try to fix it when I notice. On 01/12/13 at 11:33pm, Rob Landley wrote: On 01/10/2013 02:25:13 PM, Felix Janda wrote: On 01/02/13 at 12:41am, Rob Landley wrote: What I did was disable #3 in the case where cwd doesn't exist. So

Re: [Toybox] toybox initd

2013-01-31 Thread Rob Landley
On 01/29/2013 12:43:38 AM, Ilya Kuzmich wrote: Hi Rob. Thank you for your repy. Mind if I forward this response to the toybox mailing list? Sure, why not. Sorry this is taking so long. I started a new job a couple weeks back, and it's away from home so there was travel and apartment

Re: [Toybox] Issues with 'xexec()', 'losetup' and 'cp'

2013-02-04 Thread Rob Landley
Sorry for the delay answering, still working out work/life balance at my new contract. On 01/30/2013 03:11:58 AM, Ashwini Sharma wrote: Hi Rob, 1. I was using 'xexec()' function. It gives me the coredump from function toy_init() in main.c at line #82. My use case is as follows. I

Re: [Toybox] toybox initd

2013-02-04 Thread Rob Landley
And I got permission! (Second attempt. If balsa eats this one, I'm taking a hex editor to it.) Rob On 01/24/2013 11:36:48 AM, Rob Landley wrote: On 01/17/2013 02:50:38 PM, Ilya Kuzmich wrote: Hi Rob. Can you please share with me your vision on what exactly toybox initd should look like

Re: [Toybox] Introduction

2013-02-22 Thread Rob Landley
Sorry for the delay. Crazy month, writing this from an Android panel at CELF I really should be paying attention to. :) On 02/06/2013 10:10:18 AM, Bas Pape wrote: Hi all, Speaking to him on IRC yesterday, Rob requested I send a mail to this list, so here goes. Having looked at the toybox

Re: [Toybox] Working on unxz-some questions

2013-03-03 Thread Rob Landley
On 03/01/2013 01:10:36 AM, Isaac Dunham wrote: I'm looking into adding an unxz based on xz-embedded, which is public domain. Cool! I noticed this recently (due to the busybox thread about it) and was pondering the same myself. I downloaded the git repo but am not going to have time to

Re: [Toybox] Working on unxz-some questions

2013-03-04 Thread Rob Landley
On 03/04/2013 01:55:32 AM, Bastian Bittorf wrote: * Rob Landley r...@landley.net [04.03.2013 08:45]: On the compression side, we've got a quick streaming compressor already (gzip) which gets the low hanging fruit of compression and is going to be faster than anything else (fits in L1

Re: [Toybox] xzcat initial implementation (based on xz-embedded)

2013-03-06 Thread Rob Landley
On 03/04/2013 06:28:40 PM, Isaac Dunham wrote: Hello, This is the code we were discussing, ready to apply. I've made some changes (merging a couple headers and the CRC implementations, removing a few definitions that were meant for compatability with use in the kernel, plus what was

[Toybox] Pending tweak to license text.

2013-03-13 Thread Rob Landley
Nobody but me is likely to care, but I'd like to simplify the first paragraph from the current: Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice

[Toybox] 0.4.4 is out.

2013-03-14 Thread Rob Landley
And I checked in the license file simplification afterwards. Rob (By the way, if anybody were to object to the change, who _didn't_ send me a copy of the entire license file with their code submission... I would be confused.) ___ Toybox mailing

Re: [Toybox] Min/Max bug fix

2013-03-17 Thread Rob Landley
On 03/14/2013 03:46:02 PM, Andre Renaud wrote: There is a minor bug in the min/max macros that can result in unexpected results when doing things like: 5 + min(a,b) This currently essentially becomes (5 + a) (b) ? (a) : (b) instead of: 5 + ((a b) ? a : b) Attached patch resolves it with the

Re: [Toybox] new toy: uuencode

2013-03-17 Thread Rob Landley
On 03/14/2013 05:35:30 PM, Andre Renaud wrote: Hi, Attached is a simple implementation of uuencode. It isn't the prettiest, but it seems to do the job for all of the input I've thrown at it. Any feedback? At this stage, I haven't done uudecode. I see the one from you, and I see the one from

Re: [Toybox] uuen/decode

2013-03-17 Thread Rob Landley
On 03/14/2013 09:04:18 PM, Erich Plondke wrote: Looks like I might be a bit late on this browsing the archives... but uuencode and uudecode implementations are attached. Both passed basic tests. Support both base64 and traditional format. Also, I needed to put parens around min/max, but I

Re: [Toybox] toybox: Rough edges in pending

2013-03-19 Thread Rob Landley
On 03/19/2013 01:50:43 AM, Isaac Dunham wrote: Hello, I don't expect these to be very high priority, but I ran into a few rough edges when enabling almost all the toys in pending: Um, yes. Until recently half the stuff in pending didn't even _compile_. There's a _reason_ the default to

Re: [Toybox] [musl] toybox: Rough edges in pending

2013-03-19 Thread Rob Landley
On 03/19/2013 06:09:39 AM, Szabolcs Nagy wrote: * Szabolcs Nagy n...@port70.net [2013-03-19 10:42:25 +0100]: * Isaac Dunham idun...@lavabit.com [2013-03-18 23:50:43 -0700]: execve(./toybox-musl, [./toybox-musl, sh, -c, ls], [/* 22 vars */]) = 0 ... ioctl(0, SNDCTL_TMR_TIMEBASE or

[Toybox] My CELF talk on toybox.

2013-03-19 Thread Rob Landley
Video is up! http://www.youtube.com/watch?v=SGmtP5Lg_t0 90% of it is really Why is toybox, rather than what is. The what is parts don't go into anything that you wouldn't get from roadmap.html and status.html (with maybe a little of http://landley.net/aboriginal/about.html). Rob

Re: [Toybox] [musl] Re: toybox: Rough edges in pending

2013-03-20 Thread Rob Landley
On 03/19/2013 02:32:21 PM, Isaac Dunham wrote: A couple things that would have cleared this up for me-- Either a note in toys/pending/README that said: Code in this directory may or may not work. (somehow, ...await review and/or cleanup doesn't seem to communicate this) Good point. I'll add

Re: [Toybox] new toy: logger

2013-03-24 Thread Rob Landley
On 03/22/2013 09:47:38 AM, Ilya Kuzmich wrote: Implements -t -p ans -s. Same functionality as busybox logger sans numeric facility. Do we really need this? There is one sublte corner case though: logger , logger , or even logger /dev/null gnu silently ignores all of them busybox logs logger

Re: [Toybox] new toy: logger

2013-03-24 Thread Rob Landley
On 03/22/2013 10:11:52 AM, Georgi Chorbadzhiyski wrote: Around 03/22/2013 04:47 PM, Ilya Kuzmich scribbled: Implements -t -p ans -s. Same functionality as busybox logger sans numeric facility. Do we really need this? There is one sublte corner case though: logger , logger , or even logger

Re: [Toybox] new toy: logger

2013-03-24 Thread Rob Landley
On 03/22/2013 10:11:52 AM, Georgi Chorbadzhiyski wrote: Around 03/22/2013 04:47 PM, Ilya Kuzmich scribbled: Implements -t -p ans -s. Same functionality as busybox logger sans numeric facility. Do we really need this? There is one sublte corner case though: logger , logger , or even logger

Re: [Toybox] complaining about 'ifconfig' - better use 'ip'

2013-04-03 Thread Rob Landley
On 04/03/2013 09:05:26 AM, Bastian Bittorf wrote: it needed some days to find the right arguments, but i try to make it short: dont implement 'ifconfig'. I didn't. A third party submitted it, because they use it. Nobody's ever bothered to submit ip. it's totally obsolete since nearly

Re: [Toybox] complaining about 'ifconfig' - better use 'ip'

2013-04-03 Thread Rob Landley
On 04/03/2013 10:28:00 AM, Bastian Bittorf wrote: * Isaac Dunham idun...@lavabit.com [03.04.2013 17:16]: I learned Linux in 2006, and use ifconfig all the time. It's much more informative, much more obvious to use ofcourse this is always, from which side you are looking. if you are used to

Re: [Toybox] complaining about 'ifconfig' - better use 'ip'

2013-04-03 Thread Rob Landley
On 04/03/2013 03:21:17 PM, Bastian Bittorf wrote: * Rob Landley r...@landley.net [03.04.2013 21:44]: it's totally obsolete since nearly 10 years. nobody uses it anymore, *shrug* I use it. So did the people who submitted their implementation of it. It's in the $PATH on ubuntu LTS without

Re: [Toybox] bc, etc.

2013-04-04 Thread Rob Landley
On 04/03/2013 10:38:28 PM, Isaac Dunham wrote: Hello, After seeing that the ifconfig storm was because someone had implemented it I read the development log again, and this email is in response to a couple things on there. First, regarding bc:

[Toybox] Error messages and internationalization.

2013-04-04 Thread Rob Landley
Ok, I need to ask an opinion here. The authors of the recent ifconfig submission are from Japan (I think) but they're using longish english error messages. I've been trying to keep my error strings as concise as possible. A chunk of examples from the current code turned up by a quick grep:

Re: [Toybox] complaining about 'ifconfig' - better use 'ip'

2013-04-04 Thread Rob Landley
On 04/04/2013 03:09:39 AM, Bastian Bittorf wrote: * Rob Landley r...@landley.net [04.04.2013 10:03]: $ man ip | wc -l 1853 $ man ifconfig | wc -l 185 here: bastian@box:~$ for F in ifconfig arp netstat route; do man $F; done | wc -l 756 Ok. bastian@box:~$ man ip | wc -l 150 bastian

Re: [Toybox] complaining about 'ifconfig' - better use 'ip'

2013-04-04 Thread Rob Landley
On 04/04/2013 03:17:17 AM, Bastian Bittorf wrote: * Rob Landley r...@landley.net [04.04.2013 10:03]: I've used ip a couple times. I mostly use ifconfig, because it's there and I see no upside in using ip. I also use iwlist and iwlist is also dead since a long time, the successor is 'iw' which

Re: [Toybox] complaining about 'ifconfig' - better use 'ip'

2013-04-04 Thread Rob Landley
On 04/04/2013 04:25:03 AM, Bastian Bittorf wrote: * Rob Landley r...@landley.net [04.04.2013 10:03]: Yup, just pulled up my old Red Hat 9 image under qemu and did ifconfig eth0 10.0.2.15/31 and it worked fine. you are right, shame on me. Sorry for complaining about it in the last email

Re: [Toybox] complaining about 'ifconfig' - better use 'ip'

2013-04-04 Thread Rob Landley
On 04/04/2013 04:42:00 AM, Bastian Bittorf wrote: * David Seikel onef...@gmail.com [04.04.2013 11:25]: My copy of the ifconfig man page does not mention the ip command, and certainly does not say to switch. http://linux.die.net/man/8/ifconfig So a third random guy has an opinion, on the

Re: [Toybox] complaining about 'ifconfig' - better use 'ip'

2013-04-04 Thread Rob Landley
On 04/04/2013 09:52:47 AM, Isaac Dunham wrote: On Thu, 4 Apr 2013 10:17:17 +0200 Bastian Bittorf bitt...@bluebottle.com wrote: if you are really using 'ifconfig', you should better switch now. the pain will be much worse if you wait again 2 years... In what way? I vaguely recall first

Re: [Toybox] Github mirror

2013-04-06 Thread Rob Landley
On 04/05/2013 10:50:53 AM, Jeremy Huntwork wrote: Hello, After talking with Rob on IRC, I decided to experiment with setting up a github mirror of the mercurial repository. The benefits, hopefully, would be failover plus easy access for those that like/prefer git. Cool! Here's how I

Re: [Toybox] --help

2013-04-08 Thread Rob Landley
On 04/05/2013 03:12:18 PM, Jeremy Huntwork wrote: Hi, I'm a bit confused about how help text should operate. To me it would make sense to be a universal option which toybox handled for every command, but I'm seeing unexpected results. There's a help command. ./toybox help cat In bash (and

[Toybox] Explaining the ifconfig cleanup: part I.

2013-04-09 Thread Rob Landley
I blogged a bit (http://landley.net/notes-2013.html#31-03-2013) about how I'd like more cleanup submissions. Possibly if I explain the kind of cleanup I'm going for, it might help with that. When ifconfig was submitted, it touched a half-dozen files. I glued it together into a single

Re: [Toybox] towards xzcat cleanup

2013-04-10 Thread Rob Landley
On 04/10/2013 01:33:12 AM, Isaac Dunham wrote: Hello, First, I'd like to thank Landley for explaining the ifconfig cleanup... Yay! Glad it was useful. Would a similar description of the recent uuencode/uudecode cleanup help? That was fairly good code made tighter, so it's a less-obvious

Re: [Toybox] Towards find cleanup

2013-04-10 Thread Rob Landley
On 04/10/2013 12:41:35 PM, Felix Janda wrote: Hello, attached is some cleanup of the find toy inspired by Rob's (very cool) mails on how he proceeds when cleaning up toys. (and Isaac's recent partial cleanup of xzcat) The patch contains a commit message. Very nice. :) Applied. Thank you.

Re: [Toybox] Towards find cleanup

2013-04-10 Thread Rob Landley
On 04/10/2013 12:41:35 PM, Felix Janda wrote: The toy also does not follow the whitespace conventions in toybox. But I think that someone has scripts lying around to fix that. That would be me. :) My blog entry from when I did the reindent has some basic sed invocations to do a

Re: [Toybox] Towards find cleanup

2013-04-10 Thread Rob Landley
On 04/10/2013 01:12:40 PM, Tim Bird wrote: On 04/10/2013 10:41 AM, Felix Janda wrote: Hello, attached is some cleanup of the find toy inspired by Rob's (very cool) mails on how he proceeds when cleaning up toys. (and Isaac's recent partial cleanup of xzcat) The patch contains a commit

Re: [Toybox] Towards find cleanup

2013-04-10 Thread Rob Landley
On 04/10/2013 01:55:58 PM, Tim Bird wrote: - dump_node is not used anywhere It used to be used in debug code that was recently removed by Rob. It's a bit of a pain to examine the expression tree in a debugger, Simplifying the expression tree is something I need to look at. so an ascii dump

[Toybox] [CLEANUP] More fun with find.

2013-04-10 Thread Rob Landley
It occurs to me I should have a tag for these. http://landley.net/hg/toybox/rev/849 The only user of toybuf[] was copying constant strings into it. Environment strings never get freed, and constant . never gets freed either, so we can just use a char * and assign to it. Since it's

Re: [Toybox] towards xzcat cleanup

2013-04-11 Thread Rob Landley
On 04/11/2013 01:28:05 AM, Isaac Dunham wrote: More of same. Actually, it's not quite the same: -use crc_init(xz_crc32_table,1) -- I guessed on this one based on a match between magic constants, then tested it. First try was wrong, but this works.* (This is the sole difference in terms of

[Toybox] [CLEANUP] yank bool from xzcat

2013-04-11 Thread Rob Landley
Smallish one this time, http://landley.net/hg/toybox/rev/851 In theory toys.h does all the #includes we need. In practice this isn't always the case, but when you see stdlib, stdint, string.h... they can probably be yanked. The one that broke the build was stdbool.h, and that's because I

Re: [Toybox] Broken find [Was: Re: Towards find cleanup]

2013-04-11 Thread Rob Landley
On 04/11/2013 04:37:36 PM, Felix Janda wrote: Now I think that I know better how this toy works and see that my cleanup has broken it. if (filter-op==OP_OR) { -result = evaluate(filter-next, node, fnext); -result2 = evaluate(*fnext, node,

Re: [Toybox] Towards find cleanup

2013-04-11 Thread Rob Landley
On 04/11/2013 04:17:59 PM, Felix Janda wrote: On 04/10/13 at 07:34pm, Rob Landley wrote: snip I think that some function parameters should be made const and that the code could be made less repetitive. I specify static because it allows the compiler to produce better code, but I've

[Toybox] [CLEANUP] uuencode.c, pass 1, traditional encoding

2013-04-11 Thread Rob Landley
Now let's look at traditional encoding. (Same bat-file, same bat-changeset. Oh _wow_ I'm dating myself with that reference, although in my defense I only saw it in reruns.) uu_3bytes() does the same shift input into an int, output encoded 6 bit character but the encoding is just add 32 to

Re: [Toybox] Broken find [Was: Re: Towards find cleanup]

2013-04-11 Thread Rob Landley
On 04/11/2013 07:53:18 PM, Tim Bird wrote: Of maybe the expression tree should actually be put into a binary tree form, instead of serial pre-fix form, for easier traversal. -- Tim The vast majority of my bandwidth is taken up by day job and real life, what's left for toybox I'm cycling

Re: [Toybox] ifconfig: error helper?

2013-04-14 Thread Rob Landley
On 04/13/2013 07:56:34 PM, Isaac Dunham wrote: Hello, I took a look at ifconfig to see about show_help vs toys.exithelp, and I saw this repeated 16 times (string is the only thing that changes): } else if (!strcmp(*argv, string)) { if(*++argv == NULL) { errno = EINVAL;

[Toybox] [CLEANUP] the rest of uuencode.c

2013-04-16 Thread Rob Landley
The rest of the uuencode cleanup was a big opportunity to inline stuff, put common code next to each other, and then eliminate duplication. Alas, if you edit a file and move it in the same commit, mercurial loses track of it. We can beat the patch out of it via: diff -u (hg cat -r 830

Re: [Toybox] ifconfig: simplify exit with help

2013-04-17 Thread Rob Landley
On 04/14/2013 01:03:51 AM, Isaac Dunham wrote: This patch simplifies exiting with help in ifconfig. Has no change on binary size, but loses 37 lines. Also means that ifconfig --help exits cleanly with help disabled. I screwed this up on my first attempt at applying it, but fixed it up in a

[Toybox] [CLEANUP]

2013-04-17 Thread Rob Landley
On 04/16/2013 10:18:59 AM, Kyungwan Han wrote: Hello, I learn programming skill and knowledge from following up code cleaning, so I'm checking the change set: http://www.landley.net/hg/toybox/rev/6be04ec7b7ac Ah, I never did summarize that one, did I? Sorry, my day job at Cray's been

Re: [Toybox] More find cleanup

2013-04-21 Thread Rob Landley
On 04/20/2013 01:39:10 PM, Felix Janda wrote: Hello, some more find cleanup in an attached patch. The main change was to make some code in build_filter_list() less repetitive using a suitable struct and a loop. Huh, it didn't complain building defconfig. (Presumably because it's a pointer

Re: [Toybox] More find cleanup

2013-04-21 Thread Rob Landley
On 04/20/2013 01:39:10 PM, Felix Janda wrote: Hello, some more find cleanup in an attached patch. The main change was to make some code in build_filter_list() less repetitive using a suitable struct and a loop. Problem: you defined a struct locally, then used that structure definition in

Re: [Toybox] [CLEANUP] stat: Some cleanup

2013-04-21 Thread Rob Landley
On 04/19/2013 05:28:27 PM, Felix Janda wrote: Hello, attached are two patches cleaning up stat a bit. The first changes from 4 to 2 space indentation, the second is more interesting. First of all it extends stat to correctly handle format strings. (Previously it considered only the second

[Toybox] [CLEANUP] More ifconfig cleanup.

2013-04-21 Thread Rob Landley
Helping my friend Adrienne pack out her apartment today, but it's still more free time than a weekend with the nieces and nephews. Commit 869 (http://landley.net/hg/toybox/rev/869): Just moving code around, no actual code changes. Reorder functions to eliminate the need for function

Re: [Toybox] [CLEANUP] stat: Some cleanup

2013-04-21 Thread Rob Landley
On 04/21/2013 04:40:16 PM, Felix Janda wrote: If you can come up with a clean way to share the code, go for it. Ok, actually I'd only put something like get_access_str() of stat into the lib. Cool. Although a quick glance at the one in stat implies it doesn't handle the fun combinations of

  1   2   3   4   5   6   7   8   9   10   >