Re: [Toybox] [PATCH] Implement ps -O.

2016-01-24 Thread Rob Landley
On 01/24/2016 08:19 PM, enh wrote: > I should probably expand on the weird -O behavior... The desktop takes > it to mean "insert this list of fields after pid and before a short > fixed list of other fields" (so that's what this patch does for > non-Android), but what I want is a way to move folk

Re: [Toybox] [PATCH] Implement ps -O.

2016-01-24 Thread Rob Landley
On 01/24/2016 10:06 PM, dmccunney wrote: > On Sun, Jan 24, 2016 at 10:41 PM, Rob Landley wrote: >> I'm hoping that in future Android grows a userbase plugging their phone >> into a USB hub with hdmi adapter, mouse, and keyboard (or chromecasting >> to their TV with bl

Re: [Toybox] [PATCH] Implement ps -O

2016-01-31 Thread Rob Landley
> i notice that the header isn't truncated to the terminal size, which > you presumably consider a bug, Ok, think I've fixed that now? > but what _might_ be okay is to say "if > the terminal size is less than the space needed for the requested > fields, trust the fields". I added -M to measure t

Re: [Toybox] [PATCH] Fix directory test in cp.

2016-02-01 Thread Rob Landley
On 02/01/2016 09:57 PM, enh wrote: > ping. Sigh, applied. (Darn web archive holes...) Rob ___ Toybox mailing list Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net

[Toybox] toybox 0.7.0 is out.

2016-02-02 Thread Rob Landley
In the year since the "Android gets a Toybox" article, Android-M shipped with toybox, cyanogenmod switched over from busybox (http://review.cyanogenmod.org/#/c/119819/1), I did an updated ELC status talk (http://landley.net/talks/celf-2015.txt) and a plumber's talk on toybox lwn.net covered, it gre

Re: [Toybox] [TOYBOX][RFC] building toybox on a Yocto enviroment

2016-02-03 Thread Rob Landley
On 02/02/2016 07:51 PM, Joya Cruz, Alejandro wrote: > I have been trying to build toybox with different LSM enviroments > unsing yocto as building tool. > the more persistant error that I got is bellow: > > |DEBUG: Executing shell function do_compile > |NOTE: make -j 8 -e MAKEFLAGS= toybox_unstr

Re: [Toybox] [TOYBOX][RFC] building toybox on a Yocto enviroment

2016-02-03 Thread Rob Landley
On 02/03/2016 01:13 PM, José Bollo wrote: > Le mercredi 03 février 2016 à 16:42 +, Joya Cruz, Alejandro a > écrit : >> I looking the 0.7.0 version and this patch is still not in. > > Have tried if it applies? > Did you patched the patch? > Does it solves the issue? > We are all hungry for answ

Re: [Toybox] grep -A/B/C doesn't respect -n

2016-02-04 Thread Rob Landley
On 02/02/2016 08:53 PM, enh wrote: > i had a quick play with the new -A/B/C and noticed that toybox doesn't > respect -n for the context lines. should look something like: > > ~$ grep -n -C1 CPU /proc/cpuinfo > 4-model : 69 > 5:model name : Intel(R) Core(TM) i7-4600U CPU @ 2.10GHz > 6-stepping : 1

Re: [Toybox] [TOYBOX][RFC] building toybox on a Yocto enviroment

2016-02-04 Thread Rob Landley
On 02/04/2016 03:02 AM, José Bollo wrote: > Le mercredi 03 février 2016 à 22:39 -0600, Rob Landley a écrit : >> On 02/03/2016 01:13 PM, José Bollo wrote: >>> Le mercredi 03 février 2016 à 16:42 +, Joya Cruz, Alejandro a >>> écrit : >>>> I looking the 0.

Re: [Toybox] [TOYBOX][RFC] building toybox on a Yocto enviroment

2016-02-04 Thread Rob Landley
On 02/04/2016 11:43 AM, Joya Cruz, Alejandro wrote: > On jue, 2016-02-04 at 10:02 +0100, José Bollo wrote: >> Le mercredi 03 février 2016 à 22:39 -0600, Rob Landley a écrit : >>> On 02/03/2016 01:13 PM, José Bollo wrote: >>>> Le mercredi 03 février 2016 à 16:42

Re: [Toybox] [PATCH] Fix segfault in `find . -iname`

2016-02-04 Thread Rob Landley
On 02/04/2016 12:54 PM, Josh Gao wrote: > Two patches attached (are github pull requests more convenient for you?) I prefer patches or "git format-patch". If I like it I can apply it, if I have comments I can reply to it. (Github pull requests I wget the git format-patch and "git am" it locally,

Re: [Toybox] [PATCH] Fix segfault in `find . -iname`

2016-02-05 Thread Rob Landley
do my > weekly merge now to AOSP or wait until this evening.) > > On Thu, Feb 4, 2016 at 4:58 PM, Rob Landley wrote: >> On 02/04/2016 12:54 PM, Josh Gao wrote: >>> Two patches attached (are github pull requests more convenient for you?) >> >> I prefer patches or

Re: [Toybox] grep -A/B/C doesn't respect -n

2016-02-10 Thread Rob Landley
On 02/08/2016 03:21 PM, enh wrote: > works for me on Android, though you might be interested to know it > doesn't work on glibc 2.19 --- looks like their printf can't cope with > INT_MAX. making that (INT_MAX/2) worked for me. but presumably you're > running a newer glibc that has this bug fixed, s

Re: [Toybox] [PATCH] ls: add flag-Z Smack support.

2016-02-10 Thread Rob Landley
On 02/08/2016 06:45 PM, Alejandro Joya wrote: > The current state only print question mark for all the cases, this would > let in case of LSM Smack to show the labels. > > Signed-off-by: Alejandro Joya > --- > toys/posix/ls.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff

Re: [Toybox] [PATCH] ls: add flag-Z Smack support.

2016-02-11 Thread Rob Landley
On 02/11/2016 10:43 AM, Joya Cruz, Alejandro wrote: > On mié, 2016-02-10 at 17:28 -0600, Rob Landley wrote: >> >> On 02/08/2016 06:45 PM, Alejandro Joya wrote: >>> The current state only print question mark for all the cases, this >>> would >>> l

Re: [Toybox] [PATCH] Fix wc -c optimization.

2016-02-13 Thread Rob Landley
On 02/12/2016 10:16 AM, enh wrote: > Check the fstat(2) return value rather than read uninitialized memory if > it failed, and add a special case for files that claim to be zero-length > but aren't (as is common in /proc on Linux). > --- > toys/posix/wc.c | 4 ++-- > 1 file changed, 2 insertions(+

Re: [Toybox] [PATCH] Implement file(1).

2016-02-14 Thread Rob Landley
On Sat, Feb 13, 2016 at 3:57 PM, Isaac Dunham wrote: > On Sat, Feb 13, 2016 at 09:56:29AM -0800, enh wrote: >> Unlike the POSIX file(1), there's no magic file here, just hard-coded >> common (non-obsolete) file formats. Personally most of my use of file(1) >> is as a one-line readelf(1) summarizer

Re: [Toybox] [PATCH] Distinguish 32- and 64-bit variants in file(1) for x32.

2016-02-17 Thread Rob Landley
On Wed, Feb 17, 2016 at 10:22 AM, enh wrote: > It's necessary to distinguish x86 and x86-64 to be able to recognize the > way x32 is encoded in ELF. Hmmm. That's not fun. I note that I spent the morning teaching the code to read/display the dynamic linker name, so this patch won't "git am" direc

Re: [Toybox] [PATCH] Add support for getprop -Z

2016-02-17 Thread Rob Landley
On Wed, Feb 17, 2016 at 4:59 PM, Tom Cherry wrote: > Ping - Can this be looked at? > > Thank you > Tom > > On Mon, Feb 8, 2016 at 3:57 PM, Tom Cherry wrote: >> >> Apologies for the previous email mangling the patch. This one should >> be correct... It went on my todo list because #including sel

Re: [Toybox] testing a single command?

2016-02-19 Thread Rob Landley
On Thu, Feb 18, 2016 at 11:48 PM, enh wrote: > On Thu, Feb 18, 2016 at 8:18 PM, Isaac Dunham wrote: >> On Thu, Feb 18, 2016 at 08:09:08PM -0800, enh wrote: >>> On Thu, Feb 18, 2016 at 8:06 PM, Isaac Dunham wrote: >>> > On Wed, Feb 17, 2016 at 10:43:37PM -0800, enh wrote: >>> >> what's the easies

Re: [Toybox] [PATCH] Add xxd -p and -r.

2016-02-19 Thread Rob Landley
On Thu, Feb 18, 2016 at 11:33 PM, enh wrote: > SELinux denials include hex-encoded paths in the log messages; xxd -r -p is > a convenient way to decode them. > > The heuristics are a little weird to my mind, but match the documentation > and observed behavior. I'm guessing optstring shoudl have [

Re: [Toybox] [PATCH] Distinguish 32- and 64-bit variants in file(1) for x32.

2016-02-20 Thread Rob Landley
On Wed, Feb 17, 2016 at 7:02 PM, enh wrote: > On Wed, Feb 17, 2016 at 3:32 PM, Rob Landley wrote: >> On Wed, Feb 17, 2016 at 10:22 AM, enh wrote: >>> It's necessary to distinguish x86 and x86-64 to be able to recognize the >>> way x32 is encoded in ELF. >>

Re: [Toybox] [PATCH] Distinguish 32- and 64-bit variants in file(1) for x32.

2016-02-20 Thread Rob Landley
On Thu, Feb 18, 2016 at 8:31 PM, Owen Shepherd wrote: > > On Wed, Feb 17, 2016 at 11:32 PM Rob Landley wrote: >> >> On Wed, Feb 17, 2016 at 10:22 AM, enh wrote: >> > It's necessary to distinguish x86 and x86-64 to be able to recognize the >> > way x32

Re: [Toybox] [PATCH] Distinguish 32- and 64-bit variants in file(1) for x32.

2016-02-21 Thread Rob Landley
On 02/21/2016 03:39 PM, Rich Felker wrote: > On Sat, Feb 20, 2016 at 02:28:22PM -0600, Rob Landley wrote: >> On Wed, Feb 17, 2016 at 7:02 PM, enh wrote: >>> On Wed, Feb 17, 2016 at 3:32 PM, Rob Landley wrote: >>>> On Wed, Feb 17, 2016 at 10:22 AM, enh

Re: [Toybox] [PATCH] Add xxd -p and -r.

2016-02-22 Thread Rob Landley
On 02/19/2016 12:11 PM, dmccunney wrote: > On Fri, Feb 19, 2016 at 12:53 PM, Rob Landley wrote: > >> Why does posix even bother having od if nobody seems to use it? > > I've used od, though not in some time. > >> (Why does posix still maintain its standard

Re: [Toybox] Implement wget

2016-02-22 Thread Rob Landley
On 02/19/2016 05:44 AM, Felix Janda wrote: > Lipi C. H. Lee wrote: >> implement simple 'wget' and port name can be specified in URL if default >> port 80 is not used. >> It may be added to toys/pending directory. > > Thanks for your submission! > > Some comments below. I gave Lipi a few days to

Re: [Toybox] [PATCH] Distinguish 32- and 64-bit variants in file(1) for x32.

2016-02-22 Thread Rob Landley
On 02/21/2016 11:34 PM, Isaac Dunham wrote: > On Sun, Feb 21, 2016 at 11:30:09PM -0500, Rich Felker wrote: >> On Sun, Feb 21, 2016 at 08:42:06PM -0600, Rob Landley wrote: >>> On 02/21/2016 03:39 PM, Rich Felker wrote: >>>> On Sat, Feb 20, 2016 at 02:28:22PM -0600, R

Re: [Toybox] [toybox] 0.7.0: scripts/make.sh: line 270: wait: pid XYZ is not a child of this shell (#24)

2016-02-25 Thread Rob Landley
I prefer dealing with this sort of thing through the mailing list, I only really use github as repository hosting. On 02/25/2016 01:31 AM, drinkcat wrote: > We use toybox-0.7.0 as part of the Chromium OS project, and sometimes > hit an issue when building it on our automated builders (see this iss

Re: [Toybox] [toybox] 0.7.0: scripts/make.sh: line 270: wait: pid XYZ is not a child of this shell (#24)

2016-02-26 Thread Rob Landley
On 02/26/2016 12:31 AM, Nicolas Boichat wrote: > On Fri, Feb 26, 2016 at 1:53 PM, Rob Landley On 02/25/2016 01:31 AM, drinkcat wrote: > > We use toybox-0.7.0 as part of the Chromium OS project, P.S. Yay! > > and sometimes > > hit an issue when buildin

Re: [Toybox] [PATCH] Distinguish 32- and 64-bit variants in file(1) for x32.

2016-02-27 Thread Rob Landley
On 02/27/2016 03:02 PM, enh wrote: > On Sun, Feb 21, 2016 at 8:30 PM, Rich Felker wrote: >> On Sun, Feb 21, 2016 at 08:42:06PM -0600, Rob Landley wrote: >>> If the script wants to match "Intel 80386" explicitly, then do I have to >>> say that for i686?

Re: [Toybox] [PATCH] Distinguish 32- and 64-bit variants in file(1) for x32.

2016-02-28 Thread Rob Landley
On 02/28/2016 09:48 AM, enh wrote: > On Sat, Feb 27, 2016 at 10:51 PM, Rob Landley wrote: >> Newly introduced platforms tend to have EM_MANUFACTURER_ARCH and then >> later switch it to EM_ARCH. Here's the commit that did that for >> Microblaze, for example: >> >

Re: [Toybox] [PATCH] Distinguish 32- and 64-bit variants in file(1) for x32.

2016-02-28 Thread Rob Landley
On 02/28/2016 10:18 AM, enh wrote: > On Sun, Feb 28, 2016 at 7:48 AM, enh wrote: >> On Sat, Feb 27, 2016 at 10:51 PM, Rob Landley wrote: >>>> (i can also supply hello world ELF binaries for all six architectures >>>> Android supports, which -- even if

Re: [Toybox] [PATCH] Distinguish 32- and 64-bit variants in file(1) for x32.

2016-02-29 Thread Rob Landley
On 02/29/2016 10:51 AM, enh wrote: > On Sun, Feb 28, 2016 at 9:44 AM, Rob Landley wrote: >>> as far as i know, there's only one. i've never come across another, >>> even on Mac OS. >> >> Wikipedia[citation needed] says OpenBSD has its own, > >

Re: [Toybox] [PATCH] Fix file.c build and fix sense of fstat test.

2016-02-29 Thread Rob Landley
Already checked these two in before I saw this. (I checked in the architecture name list redo last night because the changes to file were turning into a rathole, but "I tested this and it worked" only means something if you haven't changed it since. Sigh...) It should be working now. And I can mak

Re: [Toybox] [PATCH] include sys/sysmacros.h

2016-02-29 Thread Rob Landley
On 02/29/2016 12:36 PM, Mike Frysinger wrote: > The major/minor macros are defined in sys/sysmacros.h. This has > historically been pulled in implicitly by sys/types.h, http://man7.org/linux/man-pages/man3/major.3.html says sys/types.h, yes. > but C libs > are moving away from that as they aren'

Re: [Toybox] [PATCH] include sys/sysmacros.h

2016-02-29 Thread Rob Landley
On 02/29/2016 10:16 PM, Mike Frysinger wrote: > On 29 Feb 2016 19:52, enh wrote: >> seems like that glibc thread ground to a halt? > > not really ... mailman is just really really crappy when it comes to > threads across month date lines. so if you look at later months, you > can see more info. >

Re: [Toybox] [PATCH] Fix file.c build and fix sense of fstat test.

2016-02-29 Thread Rob Landley
wrote: >> what's checked in now still doesn't work in the regular file case though... >> >> >> Subject: [PATCH] Fix file "cannot open". >> >> We don't want to _always_ fall through. >> --- >> toys/pending/file.c | 3 ++- >

Re: [Toybox] [PATCH] Fix remounting /system on Android.

2016-03-01 Thread Rob Landley
e...@google.com said: > This adds the missing "relatime" option, Because the last-ever release of uClibc didn't have the #define, so the build breaks there. Fixing it up in portability.h... Rob ___ Toybox mailing list Toybox@lists.landley.net http://l

Re: [Toybox] [PATCH] Use the correct types for recvfrom.

2016-03-01 Thread Rob Landley
On Tue, Mar 1, 2016 at 9:08 PM, enh wrote: > ping. Both applied, sorry for the delay. Rob ___ Toybox mailing list Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net

Re: [Toybox] [PATCH] Fix file for Java class files, improve script detection, and add tests.

2016-03-02 Thread Rob Landley
On 03/01/2016 09:28 PM, enh wrote: > ...and ping on this, the tests part of which should put an end to the > current continual file(1) breakage. The problem is I'm editing file.c at the same time you're editing it. (I'll try to rebase what I've done on top of your stuff...) Thanks, Rob _

Re: [Toybox] [toybox] combine file, blkid/fstype and readelf (#25)

2016-03-04 Thread Rob Landley
On 03/02/2016 12:32 PM, technosaurus wrote: > |file| shares multiple purposes with |blkid|/|fstype| (|file| has > similar functionality for filesystems) and |readelf| (parts of |readelf| > have already been implemented in the current version of |file|) File is still actively being developed to the

Re: [Toybox] [PATCH] Use the correct types for recvfrom.

2016-03-04 Thread Rob Landley
On 03/01/2016 09:18 PM, enh wrote: > No worries. Is it easier to keep track of things if I use github pull > requests? Not really. That's not the problem. Right now I'm trying to figure out how to redo lib/dirtree.c so that rm works with infinite depth. (I have a test in the test suite, but haven

Re: [Toybox] Bug in toybox ls

2016-03-07 Thread Rob Landley
On 03/07/2016 12:58 AM, Tristan Van Berkom wrote: > Hi, > > I ran into a problem building flex today, where the automake provided > mdate-sh script produced garbage output in doc/version.texi causing > make install to break. I've got flex in my LFS 7.8 package list, I'll give it a go later today.

Re: [Toybox] [PATCH] Fix segfault in sed -e 'c\'

2016-03-07 Thread Rob Landley
On 03/06/2016 12:12 PM, Andy Chu wrote: > I forgot to mention that GNU sed behaves differently on this case. > I'm not sure if this is important. Neither am I. I applied your segfault fix, but I think I'll wait for somebody to show something this part breaks? > $ sed --version > sed (GNU sed) 4.

Re: [Toybox] [PATCH] toolbox prlimit is no more.

2016-03-09 Thread Rob Landley
On 03/07/2016 04:52 PM, enh wrote: > Replaced by toybox ulimit -p. > --- > www/roadmap.html | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) Yay! Sorry for falling behind, I'm sick. (The person who gave me this cold had it for a week.) Rob __

[Toybox] NFS mounting with toybox (kernel patch).

2016-03-09 Thread Rob Landley
The question came up about how to mount an nfs server with toybox. I remembered from my contract with parallels in 2010 that I used to do that: http://landley.livejournal.com/49382.html So I gave it a go, and found out that the kernel guys broke the text parsing, and I needed the attached patch (t

Re: [Toybox] [PATCH] Fix segfault in sed -e 'c\'

2016-03-10 Thread Rob Landley
On 03/07/2016 08:38 PM, Andy Chu wrote: >> I applied your segfault fix, but I think I'll wait for somebody to show >> something this part breaks? > > Yeah it doesn't seem like something anyone should rely on, so I think > it makes to do the simple fix first. > >> Thanks for the fix. Did your fuzz

Re: [Toybox] [PATCH] ls new option : b

2016-03-10 Thread Rob Landley
On 03/09/2016 10:40 PM, Sameer Pradhan wrote: > Thanks for your comment Isaac. > > I have modified the patch by addressing to your comments. > Please find the modified patch as attachment. I'm already poking at ls to fix the date format posix thing mentioned earlier, but assuming this patch super

Re: [Toybox] Toybox test image / fuzzing

2016-03-12 Thread Rob Landley
On 03/11/2016 05:12 PM, Andy Chu wrote: > What is the best way to run the toybox tests? If I just run "make > test", I get a lot of failures, some of which are probably because I'm > not running as root, while some I don't understand, like: > > PASS: pgrep -o pattern > pgrep: bad -s '0' >

Re: [Toybox] factor tests broken by commit e8427bfd008be233aadea49e89075451c8a9ceee

2016-03-12 Thread Rob Landley
On 03/11/2016 11:49 PM, Andy Chu wrote: > https://github.com/landley/toybox/commit/e8427bfd008be233aadea49e89075451c8a9ceee > > Before this commit, the first test in tests/factor.test succeeds: > > testing "factor -32" "factor -32" "-32: -1 2 2 2 2 2\n" "" "" > > After this commit, it fails. >

Re: [Toybox] Toybox test image / fuzzing

2016-03-13 Thread Rob Landley
On 03/13/2016 03:34 AM, Andy Chu wrote: >> Unfortunately, the test suite needs as much work as the command >> implementations do. :( >> >> Ok, backstory! > > OK, thanks a lot for all the information! That helps. I will work on > this. I think a good initial goal is just to triage the tests that

Re: [Toybox] Toybox test image / fuzzing

2016-03-13 Thread Rob Landley
On 03/13/2016 01:06 PM, enh wrote: > #include > > only having integration tests is why it's so hard to test toybox ps > and why it's going to be hard to fuzz the code: we're missing the > boundaries that let us test individual pieces. it's one of the major > problems with the toybox design/coding

Re: [Toybox] Toybox test image / fuzzing

2016-03-13 Thread Rob Landley
On 03/13/2016 02:13 PM, Samuel Holland wrote: > On 03/13/2016 01:18 PM, Rob Landley wrote: >> On 03/13/2016 03:34 AM, Andy Chu wrote: >>> FWIW I think the test harness is missing a few concepts: >>> >>> - exit code >> >> blah; echo $? >> >

Re: [Toybox] Toybox test image / fuzzing

2016-03-13 Thread Rob Landley
On 03/13/2016 02:52 PM, Andy Chu wrote: > On Sun, Mar 13, 2016 at 11:55 AM, Rob Landley wrote: >> On 03/13/2016 01:06 PM, enh wrote: >>> #include >>> >>> only having integration tests is why it's so hard to test toybox ps >>> and why it'

Re: [Toybox] Toybox test image / fuzzing

2016-03-13 Thread Rob Landley
On 03/13/2016 05:04 PM, Samuel Holland wrote: > On 03/13/2016 03:32 PM, Rob Landley wrote: >>> but having the return code in the output string can be confusing >>> to the human looking at the test case. Plus, why would you not want >>> to verify the exit code for eve

Re: [Toybox] non-GPLv3 mtools?

2016-03-14 Thread Rob Landley
On 03/14/2016 10:36 PM, enh wrote: > a non-GPLv3 mtools would be nice for UEFI purposes. That's on my todo list, and actually not that hard. I could bump it up, it was just post 1.0 because it's not in any of the priority roadmap categories. (Build tools, posix, lsb, existing android.) > (actuall

[Toybox] Test example: ls -b

2016-03-15 Thread Rob Landley
So I just checked in ls -b support, and improved -q to handle utf8 filenames, and testing it locally what I did was make a "utf8" directory full of torture test files: mkdir utf8 touch utf8/"$(cat toys/files/utf8/bad.txt)" touch utf8/back\\slash touch utf8/"$(cat toys/files/utf8/test1.txt)

Re: [Toybox] [PATCH] Pass the parent make variables when invoking make in scripts/single.sh.

2016-03-15 Thread Rob Landley
On 03/12/2016 02:51 AM, Andy Chu wrote: > single.sh is called when you do 'make test_$COMMAND'. For example, you > can now run tests under a Clang ASAN build like this: > > make CC=clang CFLAGS=-fsanitize=address test_sed I generally do: CC=clang CFLAGS=-fsanitize=address make test_sed Expor

Re: [Toybox] [PATCH] Pass the parent make variables when invoking make in scripts/single.sh.

2016-03-15 Thread Rob Landley
On 03/15/2016 04:12 AM, Andy Chu wrote: >>> Without this patch, the binary will fail with runtime errors. >> >> I don't understand what this patch does: make exported the variables it >> had which should have passed them to its scripts/single.sh child >> process, and then that child process called

Re: [Toybox] [PATCH] Fix the operator precedence in expr.

2016-03-15 Thread Rob Landley
On 03/15/2016 04:15 PM, Andy Chu wrote: > Here is a second patch on top of the first one. Between these two > patches, it's pretty much a complete rewrite -- different algorithm, > data structures, and code structure. > > It's back at 276 lines, which I think compares pretty favorably to > busybo

Re: [Toybox] [PATCH] Fix the operator precedence in expr.

2016-03-16 Thread Rob Landley
On 03/15/2016 04:46 PM, Andy Chu wrote: >> If it's at the end of expr_main() we don't care. However, if leaks >> per-input and we have unlimited input... (I believe the current linux >> environment space limit is INT_MAX arguments each INT_MAX long, modulo >> ulimit applying something to that may

Re: [Toybox] [PATCH] Use the correct types for recvfrom.

2016-03-19 Thread Rob Landley
On 03/18/2016 10:31 PM, enh wrote: > On Fri, Mar 4, 2016 at 2:28 PM, Rob Landley wrote: ... >> My pending cleanup of lsof needs to address the fact it takes 18 seconds >> to produce its first line of output when run with no arguments on my >> netbook (the ubuntu version

Re: [Toybox] [PATCH] Fix "tail -f single_file".

2016-03-19 Thread Rob Landley
Blah, I fixed this on my netbook (and another fix on top of it, he added an extra space before the first ==> line, and added tail -f to the test suite)... But forgot to push it to github. Oops. Rob On 03/18/2016 10:16 PM, enh wrote: > ping... > > (it's friday again :-) ) > > On Wed, Mar 16, 20

Re: [Toybox] [PATCH] Fix the operator precedence in expr.

2016-03-19 Thread Rob Landley
On 03/16/2016 01:34 PM, Andy Chu wrote: >> if (p<*toys.optargs || p>toys.optargs[toys.optc-1]) not_argv(); >> >> It would be nice to free this data ourselves because expr is close to >> $((1+2)) in the shell, and it would be nice if the shell could just >> internall call expr nofork in that cas

Re: [Toybox] [PATCH] Fix the operator precedence in expr.

2016-03-19 Thread Rob Landley
On 03/16/2016 06:44 PM, Andy Chu wrote: > On Wed, Mar 16, 2016 at 3:00 PM, Rob Landley wrote: >> I've already started cleanup on this command, but I'll integrate this >> with what I've got. >> >> Sounds like fun. I hope to have this done and promoted

Re: [Toybox] testing / branching (was Re: [PATCH] Fix the operator precedence in expr.)

2016-03-20 Thread Rob Landley
On 03/16/2016 03:51 PM, Andy Chu wrote: >> I often fix the test case before I fix the code, to remind me to fix the >> code. :) > > Yes I think it's a good idea to add failing tests that are known to be > good, but not done yet. I think we could annotate them as follows: > > testing "name" "comm

Re: [Toybox] [PATCH] Implement mv -n / cp -n (no clobber).

2016-03-20 Thread Rob Landley
On 03/19/2016 02:40 AM, Andy Chu wrote: > This fixes a failing test case in mv.test. There are actually three modes: -n will leave the existing file. -f will delete the existing file only if it can't write to it. --remove-destination will delete the existing file before trying to write to it. Al

Re: [Toybox] [PATCH SET] Fix test harness issues and fix tests

2016-03-20 Thread Rob Landley
On 03/18/2016 08:24 PM, Andy Chu wrote: > This is a pretty big cleanup, still in progress, but I think these > parts are ready to merge. It's a large lump, some bits of which I disagree with. Should I apply and then apply an undo patch, or chip off bits? > I think we should change the test "proto

Re: [Toybox] sed -e '$a\'

2016-03-23 Thread Rob Landley
On 03/23/2016 03:45 AM, Patrick Ohly wrote: > Hello! > > I mentioned on IRC recently that sed -e '$a\' /dev/null segfaults. It > was pointed out that commit 96a5ed118ce8ad fixes the segfault. I've now > tried that fix and it indeed fixes the segfault. > > However, the sed invocation above still

Re: [Toybox] sed -e '$a\'

2016-03-23 Thread Rob Landley
On Wed, Mar 23, 2016 at 1:30 PM, Andy Chu wrote: >> No idea whether that is a valid complaint. coreutils accepts it and >> treats it as "add a newline (but only if needed) and then do nothing". >> >> Debian's update-ca-certificates script uses that to conditionally add a >> newline after a file wh

Re: [Toybox] sed -e '$a\'

2016-03-24 Thread Rob Landley
On 03/23/2016 07:40 PM, Andy Chu wrote: >>> 2) It does indeed seem undocumented -- I can't find any mention of >>> this (unintuitive) behavior in the GNU sed manual or FAQ: >> >> The _fun_ part is that this is doubly nonstandard, because the logic >> I've used so far is if the line of input didn't

Re: [Toybox] [PATCH] Implement mv -n / cp -n (no clobber).

2016-03-25 Thread Rob Landley
On 03/21/2016 02:03 AM, Andy Chu wrote: > On Sun, Mar 20, 2016 at 8:57 PM, Rob Landley wrote: > > That's why this is still on my todo list, I wanted to have > > scripts/install.sh --force do --remove-destination, but can't assume the > > host's cp has it. I sho

Re: [Toybox] [PATCH] Implement mv -n / cp -n (no clobber).

2016-03-26 Thread Rob Landley
On 03/26/2016 12:57 AM, Andy Chu wrote: >> So that's why I was thinking of adding cp --big-long-optinon-name to >> the toybox install.sh, but I just went with "rm -f oldname && cp new oldname" >> in the recent cleanup instead, because I can't trust the host's cp to have >> that option _before_ to

Re: [Toybox] sed -e '$a\'

2016-03-26 Thread Rob Landley
On 03/26/2016 01:36 AM, Andy Chu wrote: >> The problem to solve here is that Debian is currently broken when using >> toybox. That's a real problem that needs to be fixed, but there's more >> than one way to fix it. Debian introduced this bug within the past few >> years and maybe we can convince

Re: [Toybox] [PATCH] Implement mv -n / cp -n (no clobber).

2016-03-27 Thread Rob Landley
On 03/27/2016 01:25 PM, Andy Chu wrote: >> So I threw out CP_MORE as a bad idea, and almost all commands just have >> the "include it or not" option now. There are a few global options, but >> not many, and I may even eliminate some of those (I18N: the world has >> utf8 now, deal with it). > > I a

Re: [Toybox] [PATCH] Implement mv -n / cp -n (no clobber).

2016-03-27 Thread Rob Landley
On 03/27/2016 01:46 PM, Andy Chu wrote: >> 3) Security features for distributed systems ... sh is obviously not >> designed for untrusted input (including what's on the file system). > > 4) ... along these same lines, a lot of other people are annoyed by > the gratuitous and crippled shell in make

Re: [Toybox] [PATCH] Implement mv -n / cp -n (no clobber).

2016-03-28 Thread Rob Landley
On 03/27/2016 02:09 PM, Andy Chu wrote: >>> Anecdotally, it seems like a lot of shell script issues are caused by >>> unexpected existing state, but in a lot of cases you don't CARE about >>> the existing state -- you just want a final state (e.g. a bunch of >>> symlinks to toybox). >> >> "ln -sf

Re: [Toybox] [PATCH] Fix build when wchar_t is unsigned.

2016-03-28 Thread Rob Landley
Sorry, I broke down and started upgrading my netbook from Ubuntu 12.04 to 14.04 (both so I can install current AOSP on it and so I can move my email over to the machine I actually carry with me most of the time) and of _course_ it blew up and turned into a complete reinstall. Still digging out. (A

[Toybox] FYI I'm speaking in Chicago this weekend, San Diego next week.

2016-03-28 Thread Rob Landley
On Thursday I get on a plane to go to http://flourishconf.com/2016/ in Chicago, and then on Sunday I get on a plane from there to go to http://events.linuxfoundation.org/events/embedded-linux-conference in San Diego. I'm giving two talks at each conference if anybody wants to say hi. (Then I get o

Re: [Toybox] FreeBSD porting, removing bashisms

2016-03-29 Thread Rob Landley
On 03/29/2016 02:58 PM, Ed Maste wrote: > I'm interested in seeing a FreeBSD port of toybox. I see in the > archives that this has been discussed in the past but I didn't find > any real progress. I wonder if others are (still) interested in a > FreeBSD port? I'm interested, but it's not a current

Re: [Toybox] FreeBSD porting, removing bashisms

2016-03-29 Thread Rob Landley
On Tue, Mar 29, 2016 at 6:38 PM, Ed Maste wrote: > On 29 March 2016 at 23:01, Rob Landley wrote: >> >> There's also a bunch of Linux Standard Base headers #included from >> toys.h, which bsd may not have. (Most bsds have a linux emulation layer >> these days, bu

Re: [Toybox] FreeBSD porting, removing bashisms

2016-03-29 Thread Rob Landley
On 03/29/2016 07:37 PM, Ed Maste wrote: > On 29 March 2016 at 23:54, Rob Landley wrote: >> >> There are also a number of places where we know what the Linux >> information is, and use that. For example, in ifconfig: >> >> // Is this an SIOCSI entry?

Re: [Toybox] FreeBSD porting, removing bashisms

2016-03-29 Thread Rob Landley
On 03/29/2016 09:56 PM, Zack Breckenridge wrote: > So to actually follow through on something I've suggested on this list > and because after going back through the thread I noticed the Linux > emulation layer was already mentioned, I went ahead and tried to compile > Toybox under Ubuntu 14.04 unde

Re: [Toybox] FreeBSD porting, removing bashisms

2016-03-29 Thread Rob Landley
On 03/29/2016 10:37 PM, Zack Breckenridge wrote: > One last thing to add to the above - as Ed said: > >> Yes, it's not used (or available) for native builds -- the syscalls >> and ioctls aren't available in that case. The Linux emulation layer >> would be used when running an unmodified Linux toyb

Re: [Toybox] FreeBSD porting, removing bashisms

2016-03-30 Thread Rob Landley
On 03/30/2016 12:54 PM, Ed Maste wrote: > On 30 March 2016 at 01:21, Rob Landley wrote: >> >> I expect at least a third, probably more like half of the commands will >> have some sort of profound linuxism. (Just _glancing_ I see acpi, chcon, >> eject, fallocate, fsfreez

[Toybox] And back.

2016-04-09 Thread Rob Landley
I spent last week traveling to present at two conferences: http://flourishconf.com/2016/speakers.php?id=18 http://openiotelc2016.sched.org/event/6D9v/building-a-cpu-from-scratch-jcore-design-walkthrough-rob-landley-jeff-dionne-se-instruments Hopefully the videos will be up before too long

Re: [Toybox] And back.

2016-04-11 Thread Rob Landley
bly belong there, not here. :) Rob On 04/10/2016 06:11 PM, Luis Felipe Strano Moraes wrote: > Rob, > > saw the slides there (but couldn't attend ELC), any updates on the > kickstarter going live? > > On Sat, Apr 9, 2016 at 6:52 PM, Rob Landley <mailto:r...@landley.net

Re: [Toybox] And back.

2016-04-14 Thread Rob Landley
On 04/09/2016 05:58 PM, Andy Chu wrote: > On Sat, Apr 9, 2016 at 2:52 PM, Rob Landley wrote: >> I spent last week traveling to present at two conferences: >> >> http://flourishconf.com/2016/speakers.php?id=18 >> >> http://openiotelc2016.sched.org/event/6D9v/

Re: [Toybox] [PATCH] Implement mv -n / cp -n (no clobber).

2016-04-15 Thread Rob Landley
On 04/15/2016 02:40 PM, Andy Chu wrote: > On Fri, Apr 15, 2016 at 10:16 AM, enh wrote: >> things to avoid/reasons why i'd happily get rid of mksh in Android: > > OK interesting -- can you say more about the use cases of shell and > toybox in Android? > > For example, why does Android need toybox

Re: [Toybox] project goals (was Re: sed -e '$a\')

2016-04-15 Thread Rob Landley
t; On Sat, Mar 26, 2016 at 1:00 AM, Rob Landley wrote: >> >> >> On 03/26/2016 01:36 AM, Andy Chu wrote: >>>> The problem to solve here is that Debian is currently broken when using >>>> toybox. That's a real problem that needs to be fixed, but there&#x

Re: [Toybox] ps and top (and Android)

2016-04-21 Thread Rob Landley
On 04/20/2016 08:47 PM, enh wrote: > re: > https://github.com/landley/toybox/commit/529d5db29a32db565d2ee0aeac133e47ec045e12, > note that we're not switched over because neither ps nor top have > thread support. everything on Android is threaded except init, so > people would notice :-) I was tra

Re: [Toybox] FreeBSD porting, removing bashisms

2016-04-21 Thread Rob Landley
On 03/31/2016 11:57 AM, Ed Maste wrote: > On 31 March 2016 at 03:07, Zack Breckenridge wrote: >>> How do I set up a freebsd test build environment, preferably under a VM? >> >> The FreeBSD project now distributes VM images for installation/testing. For >> example you can find some development bran

Re: [Toybox] FreeBSD porting, removing bashisms

2016-04-22 Thread Rob Landley
On 04/21/2016 09:30 PM, Ed Maste wrote: > On 22 April 2016 at 01:22, Rob Landley wrote: ... > Anyhow, for my exploration I installed gsed and s/sed/gsed/ in > scripts/make.sh. We'd like to improve compatibility with GNU sed where > feasible though and I'll try to see what i

Re: [Toybox] ps and top (and Android)

2016-04-23 Thread Rob Landley
On 04/21/2016 08:59 PM, enh wrote: > On Thu, Apr 21, 2016 at 1:06 AM, Rob Landley wrote: >> On 04/20/2016 08:47 PM, enh wrote: >>> re: >>> https://github.com/landley/toybox/commit/529d5db29a32db565d2ee0aeac133e47ec045e12, >>> note that we're not swit

Re: [Toybox] [PATCH] Fix more to a non-tty.

2016-04-23 Thread Rob Landley
On 04/21/2016 07:42 PM, enh wrote: > And add a test. > --- > toys/pending/more.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Applied, but I don't see the test? Sigh: I wanted "more" and "less" to share code, but they really don't do the same thing (random example: "ls --color | more"

Re: [Toybox] [PATCH] Fix more to a non-tty.

2016-04-23 Thread Rob Landley
On 04/23/2016 04:40 PM, enh wrote: > On Sat, Apr 23, 2016 at 12:39 PM, Rob Landley wrote: >> On 04/21/2016 07:42 PM, enh wrote: >>> And add a test. >>> --- >>> toys/pending/more.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >> >

Re: [Toybox] ps and top (and Android)

2016-04-24 Thread Rob Landley
On 04/23/2016 11:57 AM, enh wrote: > On Sat, Apr 23, 2016 at 3:06 AM, Rob Landley wrote: >> On 04/21/2016 08:59 PM, enh wrote: >>> On Thu, Apr 21, 2016 at 1:06 AM, Rob Landley wrote: >>>> On 04/20/2016 08:47 PM, enh wrote: >>>>> re: &

Re: [Toybox] [PATCH] Fix more to a non-tty.

2016-04-24 Thread Rob Landley
On 04/23/2016 06:45 PM, dmccunney wrote: > On Sat, Apr 23, 2016 at 6:38 PM, enh wrote: >> yeah, i'm pretty sure 100% of our more(1) users are using because we >> don't have less. > > I'd be inclined to say "Don't bother with more as a short term fix. > Properly implement less, and symlink it to m

Re: [Toybox] ps and top (and Android)

2016-04-24 Thread Rob Landley
On 04/24/2016 10:48 AM, enh wrote: > On Sat, Apr 23, 2016 at 11:53 PM, Isaac Dunham wrote: >> On Sat, Apr 23, 2016 at 09:57:12AM -0700, enh wrote: >> IIRC, I heard that unlink was intended to avoid the need to sanity-check >> and escape file names: >> to delete a file named '-h' or '-f', just ru

Re: [Toybox] ps and top (and Android)

2016-04-24 Thread Rob Landley
On 04/24/2016 06:55 PM, Andy Chu wrote: >>> if that was the intention, it's useless anyway, given the >>> posix-specified -- for all argument parsing. >> >> About that: >> >> $ echo -- hello >> -- hello >> $ /bin/echo -- hello >> -- hello >> >> _I'm_ doing it, but the gnu tools aren't, and nobody

<    3   4   5   6   7   8   9   10   11   12   >