X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;f=test%2Ftstmarc.sh;h=f1ac1770ba8ace08bf8a69dbf00d9031b6bff9eb;hb=055ee272576c3f33a842adf5a9fdbe00c2c422f0;hp=6713ca068f87b438ba30757053387a511525785b;hpb=1d1a480fa1fc743cc5d471ffbd1fad81ff23192d;p=yaz-moved-to-github.git diff --git a/test/tstmarc.sh b/test/tstmarc.sh index 6713ca0..f1ac177 100755 --- a/test/tstmarc.sh +++ b/test/tstmarc.sh @@ -13,6 +13,11 @@ if test $? = "3"; then noxml=1 fi +../util/yaz-marcdump -o xml,marcxml >/dev/null 2>&1 +if test $? = "4"; then + noxmlwrite=1 +fi + binmarc_convert() { OUTPUT_FORMAT="$1" REVERT_FORMAT="$2" @@ -23,7 +28,8 @@ binmarc_convert() { NEW=${PREFIX}${fb}.new.xml OLD=${srcdir}/${PREFIX}${fb}.xml DIFF=`basename ${f}`.diff - ../util/yaz-marcdump -f $CHR -t utf-8 -o ${OUTPUT_FORMAT} $f > $NEW + #echo "../util/yaz-marcdump -f $CHR -t utf-8 -i marc -o ${OUTPUT_FORMAT} $f > $NEW" + ../util/yaz-marcdump -f $CHR -t utf-8 -i marc -o ${OUTPUT_FORMAT} $f > $NEW if test $? != "0"; then echo "$f: yaz-marcdump returned error" ecode=1 @@ -58,12 +64,12 @@ binmarc_convert() { OLD=${f}.marc NEW=`basename ${f}`.new.marc DIFF=`basename ${f}`.diff + #echo "../util/yaz-marcdump -f utf-8 -t utf-8 -i ${REVERT_FORMAT} -o marc $f > $NEW" ../util/yaz-marcdump -f utf-8 -t utf-8 -i ${REVERT_FORMAT} -o marc $f > $NEW if test $? != "0"; then echo "Failed decode of $f" ecode=1 elif test -f $OLD; then -# echo "diff $OLD $NEW " if diff $OLD $NEW >$DIFF; then rm $DIFF rm $NEW @@ -89,13 +95,21 @@ binmarc_convert() { binmarc_convert "marcxml" "marcxml" "" echo "binmarc -> marcxml: $?" + +if test -z "$noxmlwrite"; then binmarc_convert "xml,marcxml" "marcxml" "xml2" echo "binmarc -> marcxml(libxml2): $?" +fi -binmarc_convert "xml,tmarcxml" "tmarcxml" "t" +binmarc_convert "tmarcxml" "tmarcxml" "t" echo "binmarc -> tmarcxml: $?" -# exit $ecode +if test -z "$noxmlwrite"; then +binmarc_convert "xml,tmarcxml" "tmarcxml" "xml2t" +echo "binmarc -> tmarcxml(libxml2): $?" +fi + +exit $ecode # Local Variables: # mode:shell-script