Bug#946382: This bug report seems useless in my opinion

2023-12-25 Thread Georges Khaznadar
Hello Dan,

I patched crontab.5 to take your advice in count.

Just hoping that no other purist would notify me that lining up columns
can be done with spaces rather that with zeroes.

I uploaded release 3.0pl1-182 right now.

Best regards,   Georges.


Dan Jacobson a écrit :
> > "GK" == Georges Khaznadar  writes:
> GK> Hello Dan,
> 
> GK> I would like to get more information about your intent, for this bug
> GK> report.
> 
> Looking at the crontab(5) man page,
> everything lines up very pretty:
> 
> 
>17 * * * *  root  cd / && run-parts --report /etc/cron.hourly
>25 6 * * *  root  test -x /usr/sbin/anacron || ( cd / && run-parts 
> --report /etc/cron.daily )
>47 6 * * 7  root  test -x /usr/sbin/anacron || ( cd / && run-parts 
> --report /etc/cron.weekly )
>52 6 1 * *  root  test -x /usr/sbin/anacron || ( cd / && run-parts 
> --report /etc/cron.monthly )
> 
> But that is because the author picked 6 hours for each.
> 
> Let's see what would happen otherwise:
>17 * * * *  root  cd / && run-parts --report /etc/cron.hourly
>25 16 * * *  root  test -x /usr/sbin/anacron || ( cd / && run-parts 
> --report /etc/cron.daily )
>47 6 * * 7  root  test -x /usr/sbin/anacron || ( cd / && run-parts 
> --report /etc/cron.weekly )
>52 6 1 * *  root  test -x /usr/sbin/anacron || ( cd / && run-parts 
> --report /etc/cron.monthly )
> Oh darn, that looks ugly.
> 
> The question that crosses users minds is: "Can I rewrite it
>17  * * * *  root  cd / && run-parts --report /etc/cron.hourly
>25 16 * * *  root  test -x /usr/sbin/anacron || ( cd / && run-parts 
> --report /etc/cron.daily )
>47 06 * * 7  root  test -x /usr/sbin/anacron || ( cd / && run-parts 
> --report /etc/cron.weekly )
>52 06 1 * *  root  test -x /usr/sbin/anacron || ( cd / && run-parts 
> --report /etc/cron.monthly )
> or will that be taken as octal (even if octal 6 is just 6), or illegal?
> Please don't force me to test to find the answer."
> 
> I'm just saying the man page needs to state clearly what will happen.
> 
> Sure, one could just add spaces instead of zeros to make the columns
> line up. But that would just be avoiding the issue.
> 
> GK> Should leading zeroes be supported for the sake of making columns line
> GK> up, or should leading zeroes be used to introduce octal constants, in
> GK> your opinion?
> 
> Nobody wants octal. I'm just trying to make columns line up.
> 
> GK> As far as I understand the code of the file entry.c, numbers are parsed
> GK> by the function atoi:
> GK> -8<- file entry.c's excerpt --
> GK>   if (all_digits) {
> GK>   *numptr = atoi(temp);
> GK>   return ch;
> GK>   }
> GK> -8<---
> 
> GK> ... which means that numbers prefixed by zeroes are considered as
> GK> decimal.
> 
> OK that's great. Please mention so on crontab(5). Thanks.
> 
> In fact perhaps add an example saying one can use spaces and zeros to make the
> columns line up:
> 
>25 16 * * *  root  test -x /usr/sbin/anacron || ( cd / && run-parts 
> --report /etc/cron.daily )
>47 06 * * 7  root  test -x /usr/sbin/anacron || ( cd / && run-parts 
> --report /etc/cron.weekly )
>52  4 1 * *  root  test -x /usr/sbin/anacron || ( cd / && run-parts 
> --report /etc/cron.monthly )

-- 
Georges KHAZNADAR et Jocelyne FOURNIER
22 rue des mouettes, 59240 Dunkerque France.
Téléphone +33 (0)3 28 29 17 70



signature.asc
Description: PGP signature


Bug#946382: This bug report seems useless in my opinion

2023-12-25 Thread Dan Jacobson
> "GK" == Georges Khaznadar  writes:
GK> Hello Dan,

GK> I would like to get more information about your intent, for this bug
GK> report.

Looking at the crontab(5) man page,
everything lines up very pretty:


   17 * * * *  root  cd / && run-parts --report /etc/cron.hourly
   25 6 * * *  root  test -x /usr/sbin/anacron || ( cd / && run-parts 
--report /etc/cron.daily )
   47 6 * * 7  root  test -x /usr/sbin/anacron || ( cd / && run-parts 
--report /etc/cron.weekly )
   52 6 1 * *  root  test -x /usr/sbin/anacron || ( cd / && run-parts 
--report /etc/cron.monthly )

But that is because the author picked 6 hours for each.

Let's see what would happen otherwise:
   17 * * * *  root  cd / && run-parts --report /etc/cron.hourly
   25 16 * * *  root  test -x /usr/sbin/anacron || ( cd / && run-parts 
--report /etc/cron.daily )
   47 6 * * 7  root  test -x /usr/sbin/anacron || ( cd / && run-parts 
--report /etc/cron.weekly )
   52 6 1 * *  root  test -x /usr/sbin/anacron || ( cd / && run-parts 
--report /etc/cron.monthly )
Oh darn, that looks ugly.

The question that crosses users minds is: "Can I rewrite it
   17  * * * *  root  cd / && run-parts --report /etc/cron.hourly
   25 16 * * *  root  test -x /usr/sbin/anacron || ( cd / && run-parts 
--report /etc/cron.daily )
   47 06 * * 7  root  test -x /usr/sbin/anacron || ( cd / && run-parts 
--report /etc/cron.weekly )
   52 06 1 * *  root  test -x /usr/sbin/anacron || ( cd / && run-parts 
--report /etc/cron.monthly )
or will that be taken as octal (even if octal 6 is just 6), or illegal?
Please don't force me to test to find the answer."

I'm just saying the man page needs to state clearly what will happen.

Sure, one could just add spaces instead of zeros to make the columns
line up. But that would just be avoiding the issue.

GK> Should leading zeroes be supported for the sake of making columns line
GK> up, or should leading zeroes be used to introduce octal constants, in
GK> your opinion?

Nobody wants octal. I'm just trying to make columns line up.

GK> As far as I understand the code of the file entry.c, numbers are parsed
GK> by the function atoi:
GK> -8<- file entry.c's excerpt --
GK> if (all_digits) {
GK> *numptr = atoi(temp);
GK> return ch;
GK> }
GK> -8<---

GK> ... which means that numbers prefixed by zeroes are considered as
GK> decimal.

OK that's great. Please mention so on crontab(5). Thanks.

In fact perhaps add an example saying one can use spaces and zeros to make the
columns line up:

   25 16 * * *  root  test -x /usr/sbin/anacron || ( cd / && run-parts 
--report /etc/cron.daily )
   47 06 * * 7  root  test -x /usr/sbin/anacron || ( cd / && run-parts 
--report /etc/cron.weekly )
   52  4 1 * *  root  test -x /usr/sbin/anacron || ( cd / && run-parts 
--report /etc/cron.monthly )



Bug#946382: This bug report seems useless in my opinion

2023-12-16 Thread Georges Khaznadar
Hello Dan,

I would like to get more information about your intent, for this bug
report.

Should leading zeroes be supported for the sake of making columns line
up, or should leading zeroes be used to introduce octal constants, in
your opinion?

As far as I understand the code of the file entry.c, numbers are parsed
by the function atoi:
-8<- file entry.c's excerpt --
if (all_digits) {
*numptr = atoi(temp);
return ch;
}
-8<---

... which means that numbers prefixed by zeroes are considered as
decimal.

My opinion is that such an issue would not bother many people: numeric
entries stand for minutes, hours, days, day of month, mont, day of week.
So nobody need to write three digits to express such numbers.

In octal, 00 to 07 would mean the same as in decimal, and 08, 09 would 
make no sense; so if one is in a doubt, one can give a try with 08 or 09
and see whether cron complains ;)

I am hereby closing this bug report. Feel free to reopen it if you want
to add something more about it.

Best regards,   Georges.

-- 
Georges KHAZNADAR et Jocelyne FOURNIER
22 rue des mouettes, 59240 Dunkerque France.
Téléphone +33 (0)3 28 29 17 70



signature.asc
Description: PGP signature