summaryrefslogtreecommitdiff
path: root/lib/atomfeed.source.sh
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2023-03-27 23:09:31 +0300
committerPaul Buetow <paul@buetow.org>2023-03-27 23:09:31 +0300
commit1582c209941bc6cd6aefe507c59fab4a8f99ceb8 (patch)
treef2b33e0e61def7cb07c7c3bcd84f43027a4a8f8a /lib/atomfeed.source.sh
parent89eec1f1bacc0b69f454fdea7ffe3387010d6d95 (diff)
fix html atom feed
Diffstat (limited to 'lib/atomfeed.source.sh')
-rw-r--r--lib/atomfeed.source.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/atomfeed.source.sh b/lib/atomfeed.source.sh
index 059bdda..cc810d1 100644
--- a/lib/atomfeed.source.sh
+++ b/lib/atomfeed.source.sh
@@ -79,7 +79,7 @@ ATOMHEADER
cat <<ATOMFOOTER >> "$atom_file.tmp"
</feed>
ATOMFOOTER
- atomfeed::_xmllint "$atom_file.tmp"
+ atomfeed::xmllint "$atom_file.tmp"
# Delete the 3rd line of the atom feeds (global feed update timestamp)
if ! diff -u <($SED 3d "$atom_file") <($SED 3d "$atom_file.tmp"); then
@@ -147,13 +147,15 @@ atomfeed::_entry () {
ATOMENTRY
}
-atomfeed::_xmllint () {
+atomfeed::xmllint () {
local -r atom_feed="$1"
if [ -n "$XMLLINT" ]; then
log INFO 'XMLLinting Atom feed'
- $XMLLINT "$atom_feed" >/dev/null ||
+ if ! $XMLLINT "$atom_feed" >/dev/null; then
log PANIC "Atom feed $atom_feed isn't valid XML, please re-try"
+ return 2
+ fi
log INFO 'Atom feed is OK'
else
log WARN 'Skipping XMLLinting Atom feed as "xmllint" command is no installed!'