forked from bortzmeyer/Web-LangTag
* More elements in XML schema
* A way to force conversion without downloading
This commit is contained in:
parent
69a046ec88
commit
9bc5b62ca2
registries
@ -53,41 +53,42 @@ if [ $? != 0 ]; then
|
||||
cat ${OUTPUT} | mutt -s "Network error getting ${LTR_URL}" ${MAINTAINER}
|
||||
exit 1
|
||||
fi
|
||||
if [ -e ${LTR_LOCAL}.TMP ]; then
|
||||
#$CRLF_TO_LOCAL ${LTR_LOCAL}.TMP
|
||||
${TEST_PROGRAM} ${LTR_LOCAL}.TMP 2>&1 >> ${OUTPUT}
|
||||
if [ $? = 0 ]; then
|
||||
if [ -e ${LTR_LOCAL} ]; then
|
||||
diff -u ${LTR_LOCAL} ${LTR_LOCAL}.TMP > $TMPDIFF
|
||||
if [ ! -z $TMPDIFF ]; then
|
||||
mutt -s "New LTR registry at ${MYURL} seen on ${ME}" ${MAINTAINER} < $TMPDIFF
|
||||
fi
|
||||
if [ -e ${LTR_LOCAL}.TMP ] || [ ! -z "${LANGTAG_FORCE_CONVERT}" ]; then
|
||||
if [ -e ${LTR_LOCAL}.TMP ]; then
|
||||
${TEST_PROGRAM} ${LTR_LOCAL}.TMP 2>&1 >> ${OUTPUT}
|
||||
if [ $? = 0 ]; then
|
||||
if [ -e ${LTR_LOCAL} ]; then
|
||||
diff -u ${LTR_LOCAL} ${LTR_LOCAL}.TMP > $TMPDIFF
|
||||
if [ ! -z $TMPDIFF ]; then
|
||||
mutt -s "New LTR registry at ${MYURL} seen on ${ME}" ${MAINTAINER} < $TMPDIFF
|
||||
fi
|
||||
fi
|
||||
mv ${LTR_LOCAL}.TMP ${LTR_LOCAL}
|
||||
else
|
||||
cat ${OUTPUT} | mutt -s "Invalid registry ${LTR_URL} seen on ${ME}" ${MAINTAINER}
|
||||
exit 1
|
||||
fi
|
||||
mv ${LTR_LOCAL}.TMP ${LTR_LOCAL}
|
||||
# Now, the various conversions
|
||||
${CONVERT_XML_BORTZMEYER}
|
||||
# trang is in Java and therefore fails frequently
|
||||
# trang -Irnc -Orng ltru.rnc ltru.rng
|
||||
xmllint --noout --relaxng ltru.rng ${LTR_LOCAL}.xml
|
||||
${CONVERT_TXT}
|
||||
#${CONVERT_XML_ELLERMANN} < ${LTR_LOCAL} > ${LTR_LOCAL}2.xml
|
||||
#xmllint --noout --valid ${LTR_LOCAL}2.xml
|
||||
${CONVERT_POSTGRESQL} > lsr-postgres.sql
|
||||
${CONVERT_SQLITE} > lsr-sqlite.sql
|
||||
# TODO: UTF-8 support on SQLite was never tested
|
||||
./utf82ncr.py lsr-sqlite.sql
|
||||
mv lsr-sqlite.sql lsr-sqlite-utf8.sql
|
||||
mv lsr-sqlite-ncr.sql lsr-sqlite.sql
|
||||
${CONVERT_HTML}
|
||||
${FILL_DATABASE}
|
||||
./lsr2atom.py > lsr.atom
|
||||
version=`head -n 1 ${LTR_LOCAL} | awk '{print $2}'`
|
||||
echo $version > ${LTR_LOCAL}-version
|
||||
exit 0
|
||||
else
|
||||
cat ${OUTPUT} | mutt -s "Invalid registry ${LTR_URL} seen on ${ME}" ${MAINTAINER}
|
||||
exit 1
|
||||
fi
|
||||
# Now, the various conversions
|
||||
${CONVERT_XML_BORTZMEYER}
|
||||
# trang is in Java and therefore fails frequently
|
||||
# trang -Irnc -Orng ltru.rnc ltru.rng
|
||||
xmllint --noout --relaxng ltru.rng ${LTR_LOCAL}.xml
|
||||
${CONVERT_TXT}
|
||||
#${CONVERT_XML_ELLERMANN} < ${LTR_LOCAL} > ${LTR_LOCAL}2.xml
|
||||
#xmllint --noout --valid ${LTR_LOCAL}2.xml
|
||||
${CONVERT_POSTGRESQL} > lsr-postgres.sql
|
||||
${CONVERT_SQLITE} > lsr-sqlite.sql
|
||||
# TODO: UTF-8 support on SQLite was never tested
|
||||
./utf82ncr.py lsr-sqlite.sql
|
||||
mv lsr-sqlite.sql lsr-sqlite-utf8.sql
|
||||
mv lsr-sqlite-ncr.sql lsr-sqlite.sql
|
||||
${CONVERT_HTML}
|
||||
${FILL_DATABASE}
|
||||
./lsr2atom.py > lsr.atom
|
||||
version=`head -n 1 ${LTR_LOCAL} | awk '{print $2}'`
|
||||
echo $version > ${LTR_LOCAL}-version
|
||||
exit 0
|
||||
else # File not downloaded, probably because there was nothing new.
|
||||
exit 0
|
||||
fi
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
# Not standard in any way, just an individual proposal
|
||||
|
||||
# Stephane Bortzmeyer <bortzmeyer@nic.fr>
|
||||
# Stephane Bortzmeyer <bortzmeyer@langtag.net>
|
||||
|
||||
# TODO: add Schematron rules for constraints such as "Records that
|
||||
# contain a 'Preferred-Value' field MUST also have a 'Deprecated'
|
||||
@ -46,7 +46,7 @@ redundants = redundant*
|
||||
|
||||
redundant = element redundant {tag & common}
|
||||
|
||||
common = added & descriptions & deprecated? & preferred-value?
|
||||
common = added & descriptions & comments? & deprecated? & preferred-value?
|
||||
|
||||
added = element added {xsd:date}
|
||||
|
||||
@ -66,6 +66,8 @@ macrolanguage = element macrolanguage {text}
|
||||
|
||||
deprecated = element deprecated {xsd:date}
|
||||
|
||||
comments = element comments {text}
|
||||
|
||||
preferred-value = element preferred-value {text}
|
||||
|
||||
scope = element scope {text}
|
Loading…
Reference in New Issue
Block a user