[Bug 6540] New: Make marcflavor an option for koha-create
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6540 Bug #: 6540 Summary: Make marcflavor an option for koha-create Classification: Unclassified Change sponsored?: --- Product: Koha Version: rel_3_6 Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P5 Component: Packaging AssignedTo: robin@catalyst.net.nz ReportedBy: magnus@enger.priv.no QAContact: koha-bugs@lists.koha-community.org At the moment, koha-create is hardcoded to do MARC21 installations. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6540 --- Comment #1 from Robin Sheat <robin@catalyst.net.nz> 2011-06-29 12:31:20 UTC --- Strictly speaking, koha-create is MARC flavour agnostic. It's the packages that are generating MARC21 (as that's the default.) What we should do is take the zebra config templates that the koha installer uses (or however it does it) and make one for each flavour. Then make koha-create know about these and it can choose which one to install. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6540 --- Comment #2 from Magnus Enger <magnus@enger.priv.no> 2011-06-29 12:44:06 UTC --- Hm, my guess would be that it should be possible to alter debian/templates/zebra-biblios-site.cfg.in which now has this: 5 # Where are the config files located? 6 profilePath:/etc/koha/zebradb/biblios/etc:/etc/koha/zebradb/etc:/etc/koha/zebradb/marc_defs/marc21/biblios:/etc/koha/zebradb/lang_defs/en 7 # modulePath - where to look for loadable zebra modules 8 modulePath: /usr/lib/idzebra-2.0/modules and turn line 6 into something like this: profilePath:/etc/koha/zebradb/biblios/etc:/etc/koha/zebradb/etc:/etc/koha/zebradb/marc_defs/__ZEBRA_MARC_FORMAT__/biblios:/etc/koha/zebradb/lang_defs/__ZEBRA_LANGUAGE__ and have koha-create replace the variables, similar to other settings in the same file? (This would mean turning the zebra language into an option, not just the marcflavor, which would be a good thing.) -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6540 Magnus Enger <magnus@enger.priv.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Make marcflavor an option |Make ZEBRA_MARC_FORMAT and |for koha-create |ZEBRA_LANGUAGE configurable | |for koha-create -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6540 Magnus Enger <magnus@enger.priv.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED AssignedTo|robin@catalyst.net.nz |magnus@enger.priv.no --- Comment #3 from Magnus Enger <magnus@enger.priv.no> 2011-07-17 21:49:06 UTC --- Created attachment 4649 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=4649 Proposed patch This patch should make it possible to set ZEBRA_MARC_FORMAT and ZEBRA_LANGUAGE by way of /etc/koha/koha-sites.conf This patch does NOT create command line options for ZEBRA_MARC_FORMAT and ZEBRA_LANGUAGE - that seems to be beyond my shell scripting abilities at the moment, but hopefully it still a step in the right direction. Maybe koha-create would be a good candidate for rewriting as a Perl script anyway, as suggested by Bug 4876, and similar to what was done for build-git-snapshot by Bug 5602? To test: * Apply patch * Build packages with build-git-snapshot * Install your newly built koha-common * Set ZEBRA_MARC_FORMAT and ZEBRA_LANGUAGE to something other than the defaults in /etc/koha/koha-sites.conf: ZEBRA_MARC_FORMAT="unimarc|normarc" ZEBRA_LANGUAGE="fr|nb" * Create a new instance with koha-create * Check that the values you set are reflected in the "profilePath" line in the /etc/koha/sites/<yoursite>/zebra-* files that were created * Check that indexing and searching works as expected (Remember to change the example at http://wiki.koha-community.org/wiki/Debian#Quick_Start if this gets pushed.) -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6540 Magnus Enger <magnus@enger.priv.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 |PATCH-Sent Patch Status|--- |Needs Signoff -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6540 Robin Sheat <robin@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |robin@catalyst.net.nz --- Comment #4 from Robin Sheat <robin@catalyst.net.nz> 2011-07-17 22:03:36 UTC --- I think that adding the ability to set this is a good start. Adding the command line options isn't hard, the magic you need is "getopt". -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6540 --- Comment #5 from Magnus Enger <magnus@enger.priv.no> 2011-07-18 13:52:02 UTC --- Created attachment 4660 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=4660 Followup - apply on top of the first one Ah, at first glance I got the impression that getopt only supported one character options... Apply this second patch on top of the first one, and koha-create should be able to interpret the --marcflavor and --zebralang options. I have also added short options: -c --create-db -r --request-db -p --populate-db -m --marcflavor -l --zebralang Usage: koha-create [--create-db|--request-db|--populate-db] [--marcflavor marc21|normarc|unimarc] [--zebralang en|fr|nb] instancename -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6540 --- Comment #6 from Magnus Enger <magnus@enger.priv.no> 2011-07-18 14:05:28 UTC --- Hm, now that I think about it... If you create an instance with a marcflavor other then the one you usually use, you probably do not want to use your standard SQL file either, right? Because you want to have an SQL file that has the frameworks for the marcflavor you are choosing... So maybe the SQL file should be a command line option too? And how about just having the config file as a command line option as well (with /etc/koha/koha-sites.conf as the default)? That way I could have my standard config file set up to create NORMARC instances, but I could have an alternate config file lying around for the odd occasions when I want to create e.g. a MARC21 instance? -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6540 --- Comment #7 from Robin Sheat <robin@catalyst.net.nz> 2011-07-19 04:58:07 UTC --- Having a separate config option seems to be a good idea, although perhaps also allowing the SQL path to be overridden on the command line. This allows you to make all sorts of exceptions, but still basing off a file. Seems to me that's the best approach. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6540 --- Comment #8 from Magnus Enger <magnus@enger.priv.no> 2011-07-20 14:19:09 UTC --- Created attachment 4677 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=4677 Followup - Add defaultsql command line option Apply on top of the first two. Changes are also pushed here: https://github.com/MagnusEnger/kohawork/tree/bug6540 -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6540 Magnus Enger <magnus@enger.priv.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Make ZEBRA_MARC_FORMAT and |Add more options to |ZEBRA_LANGUAGE configurable |koha-create |for koha-create | -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6540 --- Comment #9 from Magnus Enger <magnus@enger.priv.no> 2011-07-20 17:13:16 UTC --- Created attachment 4679 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=4679 Followup - Add command line option for config file Makes it possible to point at an alternate configfile with --configfile Order of precedence for config options, from lowest to highest: 1. The defaults set in koha-create itself 2. /etc/koha/koha-sites.conf 3. Config file specified with --configfile 4. Individual options set with --marcflavor, --zebralang, --defaultsql I hope this is ready for signoff now... Please yell at me if you want me to make a unified patch! -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6540 --- Comment #10 from Robin Sheat <robin@catalyst.net.nz> 2011-07-20 23:50:32 UTC --- Naw, this should be fine. Looking into it now. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6540 --- Comment #11 from Robin Sheat <robin@catalyst.net.nz> 2011-07-21 04:53:12 UTC --- +[ $# -ge 2 ] && [ $# -le 6 ] || + die "Usage: $0 [--create-db|--request-db|--populate-db] \ +[--marcflavor marc21|normarc|unimarc] \ +[--zebralang en|fr|nb] instancename" should that language be 'nb' or 'no' or...? Where do those values come from? -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6540 --- Comment #12 from Robin Sheat <robin@catalyst.net.nz> 2011-07-21 05:03:46 UTC --- nvm the above, I worked that out. Found a minor bug: -TEMP=`getopt -o crpm:l: -l create-db,request-db,populate-db,marcflavor:,zebralang: \ +TEMP=`getopt -o crpm:l: -l create-db,request-db,populate-db,marcflavor:,zebralang:,configfile: \ -n "$0" -- "$@"` + -f|--configfile) configfile="$2" ; shift 2 ;; -f isn't picked up in the command line. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6540 --- Comment #13 from Robin Sheat <robin@catalyst.net.nz> 2011-07-21 05:17:35 UTC --- Same with --defaultsql and -d Also, the 'internal error' bit is actually correct, as if it ends up in that state, it is an internal error to do with the command line parsing, not an error with the provided options. I'll fix these in a patch on top of this and sign your ones off. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6540 --- Comment #14 from Robin Sheat <robin@catalyst.net.nz> 2011-07-21 05:38:53 UTC --- Created attachment 4690 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=4690 Bug 6540 - Make ZEBRA_MARC_FORMAT and ZEBRA_LANGUAGE configurable for koha-create Signed-off-by: Robin Sheat <robin@catalyst.net.nz> -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6540 --- Comment #15 from Robin Sheat <robin@catalyst.net.nz> 2011-07-21 05:38:56 UTC --- Created attachment 4691 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=4691 Bug 6540 - Followup patch adding command line options This adds the --marcflavor and --zebralang commandline options, as well as short versions of all options. Signed-off-by: Robin Sheat <robin@catalyst.net.nz> -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6540 --- Comment #16 from Robin Sheat <robin@catalyst.net.nz> 2011-07-21 05:38:58 UTC --- Created attachment 4692 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=4692 Bug 6540 - Add defaultsql command line option This will override the setting in /etc/koha/koha-sites.conf. Signed-off-by: Robin Sheat <robin@catalyst.net.nz> -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6540 --- Comment #17 from Robin Sheat <robin@catalyst.net.nz> 2011-07-21 05:39:00 UTC --- Created attachment 4693 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=4693 Bug 6540 - Add config file as command line option for koha-create Order of precedence for config options, from lowest to highest: 1. The defaults set in koha-create itself 2. /etc/koha/koha-sites.conf 3. Config file specified with --configfile 4. Individual options set with --marcflavor, --zebralang, --defaultsql Signed-off-by: Robin Sheat <robin@catalyst.net.nz> -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6540 --- Comment #18 from Robin Sheat <robin@catalyst.net.nz> 2011-07-21 05:39:02 UTC --- Created attachment 4694 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=4694 Bug 6540 - fix some command-line args issues -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6540 Robin Sheat <robin@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #4649|0 |1 is obsolete| | -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6540 Robin Sheat <robin@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #4660|0 |1 is obsolete| | -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6540 Robin Sheat <robin@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #4677|0 |1 is obsolete| | -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6540 Robin Sheat <robin@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #4679|0 |1 is obsolete| | -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6540 Robin Sheat <robin@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch Status|Needs Signoff |Signed Off --- Comment #19 from Robin Sheat <robin@catalyst.net.nz> 2011-07-21 05:42:33 UTC --- Note that my patch (att#4694) hasn't been signed off, but as the core stuff has been, I'll mark this bug signed off. Magnus, if you get the time, double checking my changes would be handy. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6540 Magnus Enger <magnus@enger.priv.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #4694|0 |1 is obsolete| | --- Comment #20 from Magnus Enger <magnus@enger.priv.no> 2011-07-21 09:09:37 UTC --- Created attachment 4696 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=4696 Signed-off Robin's patch Thanks for fixing my mistakes and signing off, Robin. I'm signing off on your followup patch, so it should all be signed off now. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6540 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chris@bigballofwax.co.nz Patch Status|Signed Off |Patch Pushed --- Comment #21 from Chris Cormack <chris@bigballofwax.co.nz> 2011-07-28 02:27:00 UTC --- Patches for packages, pushed, please test -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6540 --- Comment #22 from Magnus Enger <magnus@enger.priv.no> 2011-08-15 07:05:56 UTC --- Created attachment 5016 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=5016 Follow up - fix problem when --configfile is not set koha-create did not check that --configfile was actually set on the command line, before checking for the existence of a configfile and dying if it was not found. This patch should make sure a configfile is only looked for if --configfile is actually set. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6540 Magnus Enger <magnus@enger.priv.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch Status|Patch Pushed |Needs Signoff -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6540 --- Comment #23 from Robin Sheat <robin@catalyst.net.nz> 2011-08-23 03:46:25 UTC --- Created attachment 5100 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=5100 Bug 6540 - Followup - koha-create would die without --configfile koha-create would fail to check that --configfile was set on the commandline, before either including it if it existed or dying if it did not. This patch should make sure the existence of a configfile is only tested if --config is set. Signed-off-by: Robin Sheat <robin@catalyst.net.nz> This should apply against 3.4 and master. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6540 Robin Sheat <robin@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #5016|0 |1 is obsolete| | -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6540 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch Status|Needs Signoff |Patch Pushed --- Comment #24 from Chris Cormack <chris@bigballofwax.co.nz> 2011-08-23 03:53:11 UTC --- Follow up patch pushed, please test -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6540 --- Comment #25 from Chris Nighswonger <cnighswonger@foundations.edu> 2011-10-26 18:02:13 UTC --- The fix for this bug was published in the 3.4.5 release. If you were the reporter of this bug, please take time to verify the fix and update the status of this bug report accordingly. If the bug is fixed to your satisfaction, please close this report. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6540 Robin Sheat <robin@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org