Re: [Toybox] Test suite quandry.

2020-05-14 Thread Rob Landley



On 5/13/20 6:30 AM, Rob Landley wrote:
> P.P.P.P.P.S. readlink -q doesn't work in debian:
> 
>   $ ln -snf link link
>   $ readlink -q link
>   link

  $ touch file
  $ readlink -m file/dir
  /home/landley/toybox/toybox/file/dir

That's not "missing".

  $ echo -e 'one\ntwo\nthree' | rev -
  rev: cannot open -: No such file or directory

Really? REALLY?

  FAIL: rm -rv dir
  echo -ne '' | rm -rv d1 | sort
  --- expected  2020-05-13 20:26:26.872254320 -0500
  +++ actual2020-05-13 20:26:26.876254320 -0500
  @@ -1,3 +1,3 @@
  -rm 'd1/f1.txt'
  -rm 'd1/f2.txt'
  -rmdir 'd1'
  +removed 'd1/f1.txt'
  +removed 'd1/f2.txt'
  +removed directory 'd1'

Checking overly-specific output again. I suppose I can do a quick-and-dirty fix
with sed in this instance...

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


Re: [Toybox] uptime -s

2020-05-14 Thread Rob Landley
On 5/14/20 6:48 PM, Ryan Prichard via Toybox wrote:
> FWIW, the GNU "uptime -s" reports my seconds as 31, whereas busybox and toybox
> alternate between 29 and 30.

It's ignoring the fractional part and rounding to a second to do integer math.
I'm personally ok with this. Is it breaking something for you?

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


Re: [Toybox] uptime -s

2020-05-14 Thread Ryan Prichard via Toybox
No, it's fine with me.

-Ryan


On Thu, May 14, 2020 at 5:38 PM Rob Landley  wrote:

> On 5/14/20 6:48 PM, Ryan Prichard via Toybox wrote:
> > FWIW, the GNU "uptime -s" reports my seconds as 31, whereas busybox and
> toybox
> > alternate between 29 and 30.
>
> It's ignoring the fractional part and rounding to a second to do integer
> math.
> I'm personally ok with this. Is it breaking something for you?
>
> Rob
>
___
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net


[Toybox] uptime -s

2020-05-14 Thread enh via Toybox
http://landley.net/notes.html#02-05-2020

Let's see:

$ cat /proc/uptime
11514340.14 18323433.75

Um, I'm guessing first number is runtime and second is suspend time
(in seconds) since last reboot, toybox date -d @$(($(date
+%s)-18323433)) says I last rebooted near the start of October. Yeah,
sounds about right. I should probably do that so the kernel has a
chance to refresh itself for security whatsits.





it was people wanting to avoid exactly that kind of shell gymnastics
that made me add -s to uptime :-)
___
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net


Re: [Toybox] uptime -s

2020-05-14 Thread enh via Toybox
strace suggests coreutils reads /proc/uptime while busybox and toybox
use sysinfo(2).

On Thu, May 14, 2020 at 4:49 PM Ryan Prichard  wrote:
>
> FWIW, the GNU "uptime -s" reports my seconds as 31, whereas busybox and 
> toybox alternate between 29 and 30.
>
> $ uptime -s
> 2020-05-11 13:58:31
>
> $ for i in $(seq 5); do sleep 0.5; busybox uptime -s; /x/toybox/toybox uptime 
> -s; done
> 2020-05-11 13:58:30
> 2020-05-11 13:58:30
> 2020-05-11 13:58:29
> 2020-05-11 13:58:29
> 2020-05-11 13:58:30
> 2020-05-11 13:58:30
> 2020-05-11 13:58:29
> 2020-05-11 13:58:29
> 2020-05-11 13:58:30
> 2020-05-11 13:58:30
>
> -Ryan
>
>
> On Thu, May 14, 2020 at 4:33 PM enh via Toybox  
> wrote:
>>
>> http://landley.net/notes.html#02-05-2020
>>
>> Let's see:
>>
>> $ cat /proc/uptime
>> 11514340.14 18323433.75
>>
>> Um, I'm guessing first number is runtime and second is suspend time
>> (in seconds) since last reboot, toybox date -d @$(($(date
>> +%s)-18323433)) says I last rebooted near the start of October. Yeah,
>> sounds about right. I should probably do that so the kernel has a
>> chance to refresh itself for security whatsits.
>>
>>
>>
>>
>>
>> it was people wanting to avoid exactly that kind of shell gymnastics
>> that made me add -s to uptime :-)
>> ___
>> Toybox mailing list
>> Toybox@lists.landley.net
>> http://lists.landley.net/listinfo.cgi/toybox-landley.net
___
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net


Re: [Toybox] uptime -s

2020-05-14 Thread Ryan Prichard via Toybox
FWIW, the GNU "uptime -s" reports my seconds as 31, whereas busybox and
toybox alternate between 29 and 30.

$ uptime -s
2020-05-11 13:58:31

$ for i in $(seq 5); do sleep 0.5; busybox uptime -s; /x/toybox/toybox
uptime -s; done
2020-05-11 13:58:30
2020-05-11 13:58:30
2020-05-11 13:58:29
2020-05-11 13:58:29
2020-05-11 13:58:30
2020-05-11 13:58:30
2020-05-11 13:58:29
2020-05-11 13:58:29
2020-05-11 13:58:30
2020-05-11 13:58:30

-Ryan


On Thu, May 14, 2020 at 4:33 PM enh via Toybox 
wrote:

> http://landley.net/notes.html#02-05-2020
>
> Let's see:
>
> $ cat /proc/uptime
> 11514340.14 18323433.75
>
> Um, I'm guessing first number is runtime and second is suspend time
> (in seconds) since last reboot, toybox date -d @$(($(date
> +%s)-18323433)) says I last rebooted near the start of October. Yeah,
> sounds about right. I should probably do that so the kernel has a
> chance to refresh itself for security whatsits.
>
>
>
>
>
> it was people wanting to avoid exactly that kind of shell gymnastics
> that made me add -s to uptime :-)
> ___
> Toybox mailing list
> Toybox@lists.landley.net
> http://lists.landley.net/listinfo.cgi/toybox-landley.net
>
___
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net