You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Don't rely on xmlstarlet transparently decompressing files
This feature was removed by default in libxml2 2.15.0 and decompression
must now be explicitly done. Fortunately, gzip offers a mode where it
will decompress when possible or just pass the data through if
uncompressed, so all file types that are or might be compressed now call
gzip to read the data before passing it to xmlstarlet.
RAWTIME=$(xmlstarlet sel -t -v /KMYMONEY-FILE/FILEINFO/LAST_MODIFIED_DATE/@date<"$1")
530
+
RAWTIME=$(gzip -dcf <"$1"|xmlstarlet sel -t -v /KMYMONEY-FILE/FILEINFO/LAST_MODIFIED_DATE/@date)
531
531
# $RAWTIME is like 2022-01-01
532
532
TIME="$RAWTIME"
533
533
}
@@ -839,9 +839,9 @@ mtime_stardict () {
839
839
}
840
840
841
841
# File type: svg (Scalable Vector Graphics image)
842
-
# requires: xmlstarlet
842
+
# requires: gzip, xmlstarlet
843
843
mtime_svg () {
844
-
RAWTIME=$(xmlstarlet sel -t -v "/*[local-name()='svg']/*[local-name()='metadata']/*[local-name()='RDF']/*[local-name()='Work']/*[local-name()='date']"<"$1"2>/dev/null)
844
+
RAWTIME=$(gzip -dcf <"$1"|xmlstarlet sel -t -v "/*[local-name()='svg']/*[local-name()='metadata']/*[local-name()='RDF']/*[local-name()='Work']/*[local-name()='date']"2>/dev/null)
845
845
# $RAWTIME can be just about anything, but DublinCore recommends ISO 8601-1.
0 commit comments