Created attachment 48924 [details] [review] bug_16039 Added -q flag to share_usage_with_koha_community.pl
To test: With UsageStats syspref set to No: * run misc/cronjobs/share_usage_with_koha_community.pl (withiout -q) - "The UsageStats system preference is not set." message with usage info should be output * run misc/cronjobs/share_usage_with_koha_community.pl -q - the output should be quiet
Created attachment 48926 [details] [review] bug_16039 Added -q flag to share_usage_with_koha_community.pl
Just noting the reasons for this patch - The people who get the cron mail for a given Koha server may or may not have anything to do with the library, or may be a support company who get many copies of this message. Being able to quiet this message means we can suppress unwanted cron email without missing out on other operational messages. It also allows the job to continue running, in the event that someone affiliated with the library does decide to change the syspref - the job will work immediately instead of requiring the system admin to re-enable the job.
Comment on attachment 48926 [details] [review] bug_16039 Added -q flag to share_usage_with_koha_community.pl Review of attachment 48926 [details] [review]: ----------------------------------------------------------------- Avoid scope creep. ::: misc/cronjobs/share_usage_with_koha_community.pl @@ +88,4 @@ > > =item B<-v|--verbose> > > +Verbose mode Why remove the period? It's not related to this patch? @@ +92,4 @@ > > =item B<-f|--force> > > +Force the update Why remove the period? It's not related to this patch?
Comment on attachment 48926 [details] [review] bug_16039 Added -q flag to share_usage_with_koha_community.pl Review of attachment 48926 [details] [review]: ----------------------------------------------------------------- ::: misc/cronjobs/share_usage_with_koha_community.pl @@ +19,5 @@ > ) || pod2usage(1); > > if ($help) { > pod2usage(1); > + exit; Not required. Each of the following invocations of pod2usage() will print the "SYNOPSIS" section and any "OPTIONS" and/or "ARGUMENTS" sections to STDOUT and will exit with a status of 1: pod2usage(1);
Other than scope creep (period removals), and a not required exit, this works.
Created attachment 49367 [details] [review] Bug 16039: Added -q flag to share_usage_with_koha_community.pl To test: With UsageStats syspref set to No: * run misc/cronjobs/share_usage_with_koha_community.pl (without -q) - "The UsageStats system preference is not set." message with usage info should be output * run misc/cronjobs/share_usage_with_koha_community.pl -q - the output should be quiet NOTE: See comment #7. Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
No it is not related. However, some of the descriptions have dots, and some don't, which is inconsistent. My view is "polish while you're there", rather than creating a bug for two dots, especially when it incurs no cost. But I can remove that bit if you wish. Exit is there for two reasons: 1. if help is requested no point doing anything, and 2. without it exit status is non-0 (not that important but still)
(In reply to Srdjan Jankovic from comment #9) > Exit is there for two reasons: > 1. if help is requested no point doing anything, and > 2. without it exit status is non-0 (not that important but still) Good point. exit; is 0 status which is correct in my opinion. Okay. Whoever, take the sign off and run with it. :)
Created attachment 49391 [details] [review] Bug 16039: Added -q flag to share_usage_with_koha_community.pl To test: With UsageStats syspref set to No: * run misc/cronjobs/share_usage_with_koha_community.pl (without -q) - "The UsageStats system preference is not set." message with usage info should be output * run misc/cronjobs/share_usage_with_koha_community.pl -q - the output should be quiet NOTE: See comment #7. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 49392 [details] [review] Bug 16039: Remove useless exit pod2usage will exit with the status given in parameter. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment on attachment 49392 [details] [review] Bug 16039: Remove useless exit Review of attachment 49392 [details] [review]: ----------------------------------------------------------------- ::: misc/cronjobs/share_usage_with_koha_community.pl @@ +19,4 @@ > ) || pod2usage(1); > > if ($help) { > + pod2usage(0); Ooooo.... much cleaner.
Pushed to Master - should be in the May 2016 release. Thanks!