diff --git a/.gitignore b/.gitignore index 7af7ba6..cfb5af4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -SOURCES/clufter-0.77.1-tests.tar.xz -SOURCES/clufter-0.77.1.tar.gz -/clufter-0.77.1-tests.tar.xz -/clufter-0.77.1.tar.gz +/clufter-*.tar.gz +/clufter-*-tests.tar.xz +/fix-jing-simplified-rng.xsl +/pacemaker-borrow-schemas diff --git a/fix-jing-simplified-rng.xsl b/fix-jing-simplified-rng.xsl deleted file mode 100644 index 580d192..0000000 --- a/fix-jing-simplified-rng.xsl +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pacemaker-borrow-schemas b/pacemaker-borrow-schemas deleted file mode 100644 index 48dab83..0000000 --- a/pacemaker-borrow-schemas +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/sh -# Copyright 2017 Red Hat, Inc. -# Part of clufter project -# Licensed under GPLv2+ (a copy included | http://gnu.org/licenses/gpl-2.0.txt) - -# A helper for "borrow validation schemas from pacemaker" process. - -die() { echo; echo "$@"; exit 1; } - -# $1 ... input directory with original pacemaker schemas -# $2 ... output directory with consolidated schemas -# $3 ... schemas to skip (as posix-egrep expression) -# $4 ... postprocess XSLT -# $5 ... clobber existing files? (true if set and non-null) -consolidate() { - inputdir="${1}"; outputdir="${2}"; skipschemas="${3}"; postprocess="${4}" - test "${#}" -lt 5 || clobber="${5}" - mkdir -p -- "${outputdir}" - # for all the schema versions at the boundary of the "major" bump, - # except for the lower boundary of the first one (i.e. pacemaker-1.0) - # -- the versions in between are not interesting from validation POV - for base in $( - find "${inputdir}" -regextype posix-egrep -regex "${skipschemas}" -prune \ - -o -name 'pacemaker-*.rng' -printf '%P\n' | sort -V \ - | sed -e 'N;/^\(pacemaker-[0-9]\)\.\([0-9][0-9]*\)\.rng\n\1\.\([0-9][0-9]*\)\.rng$/!p;D'); do - f="${inputdir}/${base}" - printf "processing: ${f} ... " - test -f "${f}" || continue - sentinel=10; old=/dev/null; new="${f}" - # until the jing output converged (simplification gets idempotent) - # as prescribed by did-size-change heuristic (or sentinel is hit) - while [ "$(stat -c '%s' "${old}")" != "$(stat -c '%s' "${new}")" ]; do - [ "$((sentinel -= 1))" -gt 0 ] || break - [ "${old}" = "${f}" ] && old="${outputdir}/${base}"; - [ "${new}" = "${f}" ] \ - && { old="${f}"; new="${outputdir}/${base}.new"; } \ - || cp -f "${new}" "${old}" - jing -is "${old}" > "${new}" - #printf "(%d -> %d) " "$(stat -c '%s' "${old}")" "$(stat -c '%s' "${new}")" - done - printf "%d iterations" "$((10 - ${sentinel}))" - test -z "${clobber-}" && test -s "${old}" && die "file ${old} already exists" || : - if [ -z "${postprocess}" ]; then - mv "${new}" "${old}" - printf ", moved\n" - else - # xmllint drops empty lines caused by the applied transformation - xsltproc --stringparam filename-or-version "${base}" \ - "${postprocess}" "${new}" \ - | xmllint --format - > "${old}" - rm -f -- "${new}" - printf ", postprocessed\n" - fi - done -} - -which jing >/dev/null 2>&1 || die "jing (from jing-trang project) required" - -: "${INPUTDIR=$(pkg-config --variable schemadir pacemaker)}" -test -n "${INPUTDIR}" || die "Input dir with pacemaker schemas not known" - -: "${OUTPUTDIR=schemas-consolidated}" -test -n "${OUTPUTDIR}" || die "Output dir for consolidated schemas not known" - -: "${POSTPROCESS=$(dirname "${0}")/fix-jing-simplified-rng.xsl}" - -# skip non-defaults of upstream releases -#: "${SKIPSCHEMAS=.*/pacemaker-(1\.0|2\.[126]).rng}" -: "${SKIPSCHEMAS=".*/pacemaker-next\.rng"}" # only skip WIP schema by default - -consolidate "${INPUTDIR}" "${OUTPUTDIR}" "${SKIPSCHEMAS}" "${POSTPROCESS}" "${@}" diff --git a/sources b/sources index 1405792..94fa425 100644 --- a/sources +++ b/sources @@ -1,2 +1,4 @@ -SHA512 (clufter-0.77.1-tests.tar.xz) = 9c05e9f93a035b4e4fdcb28fa72fc063ed07e36438d40d4313218c3df7e7d1008a78eb29f362d854685c4ce4fa54951324c499e718229076ac4d7ced3a794877 SHA512 (clufter-0.77.1.tar.gz) = 29a7ececfa05573e595741da234ad26d49085bb3a7a91d930c62998e9e8568d56f77d357a9628b6c1b045616acf70de9a8dc41b11757e73004b2380e254c8303 +SHA512 (clufter-0.77.1-tests.tar.xz) = 9c05e9f93a035b4e4fdcb28fa72fc063ed07e36438d40d4313218c3df7e7d1008a78eb29f362d854685c4ce4fa54951324c499e718229076ac4d7ced3a794877 +SHA512 (fix-jing-simplified-rng.xsl) = a937c01f76556aee2884fb6eed520d21abe9b5d51a6a43faee0f2592376e79813b8d6cdf9fddf820864ba3c009fd61c2b83328a75f2d567a366c163751ffb03a +SHA512 (pacemaker-borrow-schemas) = 97fbe8a0f3722182cfa65f5c0ab466f2a0f923c6fac3a1cc3dccf819f02d31e738f2129cf88bd8533ac4c4e324c5896e9d447703bc21b64b60e48516282f98e6