[Bug 44313] New: Add --sitemap and --nositemap filters to koha-list
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44313 Bug ID: 44313 Summary: Add --sitemap and --nositemap filters to koha-list Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Packaging Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org CC: mtj@kohaaloha.com Target Milestone: --- koha-list can filter instances by several per-instance features (--sip/--nosip, --plack/--noplack, --letsencrypt/--noletsencrypt, --z3950/--noz3950, ...), but not by whether sitemap generation is enabled (koha-sitemap --enable, i.e. /var/lib/koha/<instance>/sitemap.enabled). This bug adds --sitemap and --nositemap to koha-list, following the existing pattern: * --sitemap: show instances with sitemap generation enabled * --nositemap: show instances with sitemap generation disabled * both are mutually exclusive, like the other pairs koha-functions.sh already provides is_sitemap_enabled, so this mostly wires it into koha-list. The options are also passed through by koha-foreach, documented in the koha-list man page and added to the bash completion. Use case: listing or acting on the instances that have opted in to sitemaps, e.g. koha-foreach --sitemap ... koha-sitemap --generate $(koha-list --enabled --sitemap) -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44313 --- Comment #1 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 212742 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212742&action=edit Bug 44313: Add --sitemap and --nositemap filters to koha-list This patch adds --sitemap and --nositemap to koha-list, to show only the instances that have sitemap generation enabled (koha-sitemap --enable) or disabled. It follows the existing --sip/--nosip pattern and uses the is_sitemap_enabled helper from koha-functions.sh. Both options are mutually exclusive. The options are also passed through by koha-foreach, documented in the koha-list man page and added to the bash completion. Test plan: 1. On main, run: $ ktd --shell k$ sudo koha-list --sitemap => FAIL: unrecognized option '--sitemap' 2. Apply this patch 3. Run (koha-list from the git tree): k$ sudo bash debian/scripts/koha-list --sitemap => SUCCESS: Nothing is listed k$ sudo bash debian/scripts/koha-list --nositemap => SUCCESS: kohadev is listed 4. Enable sitemaps for the instance and repeat 3: k$ sudo koha-sitemap --enable kohadev => SUCCESS: --sitemap lists kohadev, --nositemap lists nothing 5. Check the options are mutually exclusive: k$ sudo bash debian/scripts/koha-list --sitemap --nositemap => SUCCESS: "Error: --sitemap and --nositemap are mutually exclusive." 6. Check koha-foreach passes the filter through: k$ sudo PATH=debian/scripts:$PATH bash debian/scripts/koha-foreach --sitemap echo ok => SUCCESS: 'ok' is printed once (for kohadev) 7. Check --help lists the new options: k$ sudo bash debian/scripts/koha-list --help 8. Clean up: k$ sudo koha-sitemap --disable kohadev 9. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44313 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44313 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Add --sitemap and |Add `--sitemap` and |--nositemap filters to |`--nositemap` filters to |koha-list |`koha-list` and | |`koha-foreach` CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44313 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |`koha-list` can now list release notes| |instances by whether | |sitemap generation is | |enabled for them, with the | |new `--sitemap` and | |`--nositemap` options, the | |same way `--sip` and | |`--nosip` work. This makes | |it easy to act only on the | |instances that opted in | |with `koha-sitemap | |--enable`, for example in a | |cron job running | |`koha-sitemap --generate | |$(koha-list --enabled | |--sitemap)`. `koha-foreach` | |accepts the new options | |too, and they are | |documented in the man page | |and offered by the bash | |completion. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org