From 8c181fcd1a894dfe5cfda0ef8c6c2c1c92a97010 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Kir=C3=A1ly?= Date: Sun, 1 Dec 2024 23:48:34 +0100 Subject: [PATCH] Fix a bug in parameter filter --- README.md | 8 ++++---- common-script | 6 ++++-- qa-catalogue | 4 ++++ scripts/utils/parameter-filter.php | 6 +++++- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index d77a14e4..d874eea9 100644 --- a/README.md +++ b/README.md @@ -704,10 +704,10 @@ total ``` * `issue-by-category.csv`: the counts of issues by categories. Columns: - * `id` the identifier of error category - * `category` the name of the category - * `instances` the number of instances of errors within the category (one record might have multiple instances of the same error) - * `records` the number of records having at least one of the errors within the category + * `id` the identifier of error category + * `category` the name of the category + * `instances` the number of instances of errors within the category (one record might have multiple instances of the same error) + * `records` the number of records having at least one of the errors within the category ```csv id,category,instances,records diff --git a/common-script b/common-script index d838f19f..3b7d9d90 100755 --- a/common-script +++ b/common-script @@ -247,7 +247,8 @@ do_marc_history() { run marc-history ./formatter --selector "$SELECTOR" --defaultRecordType BOOKS ${PARAMS} --separator "," \ - --outputDir ${OUTPUT_DIR}/ --fileName "marc-history.csv" ${MARC_DIR}/${MASK} &> ${LOG_DIR}/marc-history.log + --outputDir ${OUTPUT_DIR}/ --fileName "marc-history.csv" ${MARC_DIR}/${MASK} \ + &> ${LOG_DIR}/marc-history.log # | grep -v '008~7-10,008~0-5' \ untrace @@ -465,7 +466,8 @@ do_export_schema_files() { do_export_cli_parameters() { . ./common-variables - java -cp $JAR de.gwdg.metadataqa.marc.cli.CliParameterDefinitionsExporter | jq . > cli-parameter-definitions.json + java -cp $JAR de.gwdg.metadataqa.marc.cli.CliParameterDefinitionsExporter \ + | jq . > cli-parameter-definitions.json log "CLI parameters has been exported into cli-parameter-definitions.json" } diff --git a/qa-catalogue b/qa-catalogue index 5e50c6c1..0bddd5b8 100755 --- a/qa-catalogue +++ b/qa-catalogue @@ -83,6 +83,7 @@ ANALYSES: ${ANALYSES:-} CATALOGUE: ${CATALOGUE:-} BASE_INPUT_DIR (input): ${BASE_INPUT_DIR} INPUT_DIR (input-dir): ${INPUT_DIR:-} +MARC_DIR ${MARC_DIR:-} MASK: ${MASK} NAME: ${NAME} BASE_OUTPUT_DIR (output): ${BASE_OUTPUT_DIR} @@ -113,6 +114,9 @@ fail() { exit 1 } +echo ${1:-} +exit + # run actual analysis ./common-script ${1:-} || fail diff --git a/scripts/utils/parameter-filter.php b/scripts/utils/parameter-filter.php index 1aee580e..f49e3c3b 100644 --- a/scripts/utils/parameter-filter.php +++ b/scripts/utils/parameter-filter.php @@ -14,7 +14,11 @@ $parameters = $argv; $full_definition = json_decode(file_get_contents('cli-parameter-definitions.json')); if (!isset($full_definition->{$type})) { - die('ERROR: undefined type: ' . $type . LN); + if (in_array($type, ['marc-history', 'bl-classification'])) { + $type = 'common'; + } else { + die('ERROR: undefined type: ' . $type . LN); + } } $param_definitions = array_merge($full_definition->common, $full_definition->{$type});