https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43557

Martin Renvoize (ashimema) <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Failed QA                   |Signed Off

--- Comment #10 from Martin Renvoize (ashimema) 
<[email protected]> ---
Rebased on current main (bug 43546 and its follow-ups are now pushed), as
Frédéric asked, so the patches apply again. Back to Signed Off for QA.

New attachments:
- 208589 (the original patch) and 208590 (Frédéric's follow-up) are rebased on
main. They conflicted with the "Exit with status 1 on command-line errors"
follow-up of bug 43546, which also changes Koha::Script->describe_options and
adds a subtest to t/Koha/Script.t. In t/Koha/Script.t both subtests are kept
and the plan count is updated. In Koha/Script.pm the exclusive-group validation
from 208590 now runs before the eval-wrapped call to describe_options added by
bug 43546, so an unknown option still exits with status 1. Frédéric's sign-off
on 208589 is kept.
- 208591 is a new follow-up: accept legacy single-dash long options with a
deprecation warning.

Why the new follow-up: Andrew failed QA on bug 43553 because the double-dash
spelling breaks existing cron lines. Several of the scripts documented the
single-dash form (the old holds_reminder.pl usage lists -days, -lettercode,
-date, -library and -holidays), and Getopt::Long::Descriptive parses with
bundling, so "-days 5" is read as -d -a -y -s: the script prints its usage and
exits 1, and the cron job silently stops running.

How it is solved: Koha::Script->describe_options now rewrites such an argument
as the standard --days and prints a deprecation warning to STDERR (cron mails
it to the administrator), so existing command lines keep working while they are
migrated. It is deliberately narrow: only a single dash followed by at least
two characters, naming a declared long option or the unique prefix of one (as
plain Getopt::Long allowed), and not a bundle of declared one-character flags
(-vc is still -v -c). The values given to options, and anything after --, are
left alone. -help and -man work too. --long stays the documented form, and the
shim is meant to be removed in a future release. It lives here because this bug
extends describe_options; bug 43553 now depends on this bug, and it also covers
runreport.pl from bug 43548, which is already pushed.

Test plan for 208591:
1. Apply the patches
2. prove t/Koha/Script.t
3. perl misc/cronjobs/holds/holds_reminder.pl -days 3 -lettercode HOLD_REMINDER
-v (with the patch of bug 43553): it runs and prints
   WARNING: -days is deprecated, use --days instead (...)
4. Repeat with --days 3 --lettercode HOLD_REMINDER: it runs and prints no
warning

Bugs 43549, 43551, 43558, 43559 and 43560 depend on this one and have been
rebased on top of these patches.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to