Bugzilla – Attachment 100366 Details for
Bug 24593
Rewrite MARC21 optional data to YAML
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24593: Rewrite marc21_default_matching_rules to YAML
Bug-24593-Rewrite-marc21defaultmatchingrules-to-YA.patch (text/plain), 8.80 KB, created by
Jonathan Druart
on 2020-03-09 12:22:13 UTC
(
hide
)
Description:
Bug 24593: Rewrite marc21_default_matching_rules to YAML
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-03-09 12:22:13 UTC
Size:
8.80 KB
patch
obsolete
>From 347a309ab3d0a5f75c79c116ad98675f902b8d4a Mon Sep 17 00:00:00 2001 >From: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Date: Wed, 5 Feb 2020 10:11:16 -0300 >Subject: [PATCH] Bug 24593: Rewrite marc21_default_matching_rules to YAML > >YAML version of marc21 optional marc21_default_matching_rules. > >To test: >1) Do a clean install with optional data, > dump table marc_matchers, reserve. > >2) Apply this patch and it's dependencies > >3) Do a clean install, dump again and compare > No major differences expected > >4) Try translation > a) Go to misc/translator > b) create files for a new language > ./translate create xx-YY > c) Check new file po/xx-YY-instaler-MARC21.po > Verify strings from this file. > d) Install new language > ./translate install xx-YY > e) Try clean install with new files > >NOTE: This patch fails with qa tools! >Reason is that qa tools use YAML.pm module to >check files, but Installer.pm or LangInstaller.pm >are using YAML::Syck, using that module gives >no error, check for example: > >perl -e 'use YAML::Syck qw( LoadFile ); $y = LoadFile("marc21_default_matching_rules.yml");' >No error! > >perl -e 'use YAML qw( LoadFile ); $y = LoadFile("marc21_default_matching_rules.yml");' >Error! > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > .../marc21_default_matching_rules.sql | 46 ------------- > .../marc21_default_matching_rules.txt | 5 -- > .../marc21_default_matching_rules.yml | 69 +++++++++++++++++++ > 3 files changed, 69 insertions(+), 51 deletions(-) > delete mode 100644 installer/data/mysql/en/marcflavour/marc21/optional/marc21_default_matching_rules.sql > delete mode 100644 installer/data/mysql/en/marcflavour/marc21/optional/marc21_default_matching_rules.txt > create mode 100644 installer/data/mysql/en/marcflavour/marc21/optional/marc21_default_matching_rules.yml > >diff --git a/installer/data/mysql/en/marcflavour/marc21/optional/marc21_default_matching_rules.sql b/installer/data/mysql/en/marcflavour/marc21/optional/marc21_default_matching_rules.sql >deleted file mode 100644 >index 1344704317..0000000000 >--- a/installer/data/mysql/en/marcflavour/marc21/optional/marc21_default_matching_rules.sql >+++ /dev/null >@@ -1,46 +0,0 @@ >--- >--- Default MARC matching rules for Koha >--- >--- Copyright (C) 2007 LiblimeA >--- >--- This file is part of Koha. >--- >--- Koha is free software; you can redistribute it and/or modify it >--- under the terms of the GNU General Public License as published by >--- the Free Software Foundation; either version 3 of the License, or >--- (at your option) any later version. >--- >--- Koha is distributed in the hope that it will be useful, but >--- WITHOUT ANY WARRANTY; without even the implied warranty of >--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >--- GNU General Public License for more details. >--- >--- You should have received a copy of the GNU General Public License >--- along with Koha; if not, see <http://www.gnu.org/licenses>. >- >-INSERT INTO marc_matchers (code, description, record_type, threshold) >- VALUES ('ISBN', '020$a', 'biblio', 1000); >-INSERT INTO matchpoints (matcher_id, search_index, score) SELECT MAX(matcher_id), 'isbn', 1000 FROM marc_matchers; >-INSERT INTO matcher_matchpoints SELECT MAX(matcher_id), MAX(matchpoint_id) FROM matchpoints; >-INSERT INTO matchpoint_components (matchpoint_id, sequence, tag, subfields) >- SELECT MAX(matchpoint_id), 1, '020', 'a' FROM matchpoints; >-INSERT INTO matchpoint_component_norms (matchpoint_component_id, sequence, norm_routine) >- SELECT MAX(matchpoint_component_id), 1, 'ISBN' FROM matchpoint_components; >- >-INSERT INTO marc_matchers (code, description, record_type, threshold) >- VALUES ('ISSN', '022$a', 'biblio', 1000); >-INSERT INTO matchpoints (matcher_id, search_index, score) SELECT MAX(matcher_id), 'issn', 1000 FROM marc_matchers; >-INSERT INTO matcher_matchpoints SELECT MAX(matcher_id), MAX(matchpoint_id) FROM matchpoints; >-INSERT INTO matchpoint_components (matchpoint_id, sequence, tag, subfields) >- SELECT MAX(matchpoint_id), 1, '022', 'a' FROM matchpoints; >-INSERT INTO matchpoint_component_norms (matchpoint_component_id, sequence, norm_routine) >- SELECT MAX(matchpoint_component_id), 1, 'ISSN' FROM matchpoint_components; >- >-INSERT INTO marc_matchers (code, description, record_type, threshold) >- VALUES ('KohaBiblio', '999$c', 'biblio', 1000); >-INSERT INTO matchpoints (matcher_id, search_index, score) SELECT MAX(matcher_id), 'local-number', 1000 FROM marc_matchers; >-INSERT INTO matcher_matchpoints SELECT MAX(matcher_id), MAX(matchpoint_id) FROM matchpoints; >-INSERT INTO matchpoint_components (matchpoint_id, sequence, tag, subfields) >- SELECT MAX(matchpoint_id), 1, '999', 'c' FROM matchpoints; >-INSERT INTO matchpoint_component_norms (matchpoint_component_id, sequence, norm_routine) >- SELECT MAX(matchpoint_component_id), 1, 'Biblionumber' FROM matchpoint_components; >diff --git a/installer/data/mysql/en/marcflavour/marc21/optional/marc21_default_matching_rules.txt b/installer/data/mysql/en/marcflavour/marc21/optional/marc21_default_matching_rules.txt >deleted file mode 100644 >index 471db24b3e..0000000000 >--- a/installer/data/mysql/en/marcflavour/marc21/optional/marc21_default_matching_rules.txt >+++ /dev/null >@@ -1,5 +0,0 @@ >-Selected matching rules for MARC 21 bibliographic >-records, including: >- >-ISBN >-ISSN >diff --git a/installer/data/mysql/en/marcflavour/marc21/optional/marc21_default_matching_rules.yml b/installer/data/mysql/en/marcflavour/marc21/optional/marc21_default_matching_rules.yml >new file mode 100644 >index 0000000000..7dd48f20a6 >--- /dev/null >+++ b/installer/data/mysql/en/marcflavour/marc21/optional/marc21_default_matching_rules.yml >@@ -0,0 +1,69 @@ >+--- >+# >+# Copyright 2020 Koha Development Team >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 2 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+# >+# ************************************************************* >+# Default MARC matching rules for Koha >+# ************************************************************* >+ >+description: >+ - "Selected matching rules for MARC 21 bibliographic records, including:" >+ - "" >+ - "ISBN" >+ - "ISSN" >+ >+tables: >+ - marc_matchers: >+ translatable: [] >+ multiline: [] >+ rows: >+ - code: "ISBN" >+ description: "020$a" >+ record_type: biblio >+ threshold: 1000 >+ >+ - code: "ISSN" >+ description: "022$a" >+ record_type: biblio >+ threshold: 1000 >+ >+ - code: "KohaBiblio" >+ description: "999$c" >+ record_type: biblio >+ threshold: 1000 >+ >+sql_statements: >+ - "INSERT INTO matchpoints (matcher_id, search_index, score) SELECT MAX(matcher_id), 'isbn', 1000 FROM marc_matchers;" >+ - "INSERT INTO matcher_matchpoints SELECT MAX(matcher_id), MAX(matchpoint_id) FROM matchpoints;" >+ - "INSERT INTO matchpoint_components (matchpoint_id, sequence, tag, subfields) SELECT MAX(matchpoint_id), 1, '020', 'a' FROM matchpoints;" >+ - "INSERT INTO matchpoint_component_norms (matchpoint_component_id, sequence, norm_routine) >+ SELECT MAX(matchpoint_component_id), 1, 'ISBN' FROM matchpoint_components;" >+ >+ - "INSERT INTO matchpoints (matcher_id, search_index, score) SELECT MAX(matcher_id), 'issn', 1000 FROM marc_matchers;" >+ - "INSERT INTO matcher_matchpoints SELECT MAX(matcher_id), MAX(matchpoint_id) FROM matchpoints;" >+ - "INSERT INTO matchpoint_components (matchpoint_id, sequence, tag, subfields) >+ SELECT MAX(matchpoint_id), 1, '022', 'a' FROM matchpoints;" >+ - "INSERT INTO matchpoint_component_norms (matchpoint_component_id, sequence, norm_routine) >+ SELECT MAX(matchpoint_component_id), 1, 'ISSN' FROM matchpoint_components;" >+ >+ - "INSERT INTO matchpoints (matcher_id, search_index, score) SELECT MAX(matcher_id), 'local-number', 1000 FROM marc_matchers;" >+ - "INSERT INTO matcher_matchpoints SELECT MAX(matcher_id), MAX(matchpoint_id) FROM matchpoints;" >+ - "INSERT INTO matchpoint_components (matchpoint_id, sequence, tag, subfields) >+ SELECT MAX(matchpoint_id), 1, '999', 'c' FROM matchpoints;" >+ - "INSERT INTO matchpoint_component_norms (matchpoint_component_id, sequence, norm_routine) >+ SELECT MAX(matchpoint_component_id), 1, 'Biblionumber' FROM matchpoint_components;" >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24593
:
98494
|
98495
|
98496
|
99416
|
99417
|
99418
|
100139
| 100366 |
100367
|
100368
|
100369