Skip to content

Commit

Permalink
Add .oxt support to all programs
Browse files Browse the repository at this point in the history
The test file type1.oxt comes from
https://extensions.libreoffice.org/en/extensions/show/21522 and is
released into the public domain by MarianSigler and by Roland Hieber
under Creative Commons CC0
https://creativecommons.org/public-domain/cc0/
  • Loading branch information
dfandrich committed Apr 29, 2024
1 parent ed7d96a commit 90a1795
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 2 deletions.
12 changes: 12 additions & 0 deletions autodescribe
Original file line number Diff line number Diff line change
Expand Up @@ -1182,6 +1182,16 @@ comment_odf () {
COMMENT=$(unzip -pq "$sf" meta.xml | xmlstarlet sel -t -v /office:document-meta/office:meta/dc:title 2>/dev/null)
}

# File type: oxt (Open Document Extension)
# requires: unzip, xmlstarlet
comment_oxt () {
# "safe" filename guaranteed not to start with a dash
sf="$(safefn "$1")"
# TODO: choose the appropriate language if more than one is available
# instead of just using the first one
COMMENT=$(unzip -pq "$sf" description.xml | xmlstarlet sel -N x=http://openoffice.org/extensions/description/2006 -t -v /x:description/x:display-name/x:name -nl | head -1)
}

# File type: py (Python source code)
comment_py () {
# delete #!/bin/sh line and blank comment lines
Expand Down Expand Up @@ -1480,6 +1490,8 @@ for f in "$@" ; do
# *.otf is left off because it's much more commonly a font file
TYPE=odf
;;
*.oxt) TYPE=oxt
;;
*.ogg) TYPE=ogg
;;
*.otf | *.ttf | *.woff) TYPE=otf
Expand Down
3 changes: 2 additions & 1 deletion automtime
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,7 @@ mtime_pdf () {

# File type: png (PNG image)
# requires: pngtools
# TODO: some PNG files (e.g. written by GIMP) have a tIME chunk that could be used
mtime_png () {
# "safe" filename guaranteed not to start with a dash
sf="$(safefn "$1")"
Expand Down Expand Up @@ -1196,7 +1197,7 @@ for f in "$@" ; do

*.zip | *.jar | *.xpi | *.par | *.wsz | *.wal | *.kmz | \
*.sxi | *.sxd | *.sxw | *.pk3 | *.ipg | *.nth | *.odt | \
*.ods | *.odp | *.odg | *.odf | \
*.ods | *.odp | *.odg | *.odf | *.oxt | \
*.otp | *.otg | *.ots | *.odb | *.odc | \
*.docx | *.epub | *.apk | *.apkm | *.war | *.xps | *.resource | \
*.application | *.docm | *.f3d | *.egg | *.kra | *.whl | *.3mf | \
Expand Down
3 changes: 2 additions & 1 deletion fv
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,7 @@ EOF
# Also OpenDocument Presentation Template .otp
# Also OpenDocument Spreadsheet Template .ots
# Also OpenDocument Presentation Template .otp
# Also OpenDocument Extension .oxt
# Also Quake3 packed file .pk3
# Also Nokia mobile phone theme .nth
# Also Microsoft Office Open XML document .docx
Expand Down Expand Up @@ -650,7 +651,7 @@ EOF
*.zip | *.jar | *.xpi | *.par | *.wsz | *.wal | *.kmz | \
*.sxi | *.sxd | *.sxw | *.sxm | *.pk3 | *.ipg | *.nth | *.odt | \
*.ods | *.odp | *.odg | *.odf | \
*.otp | *.otg | *.ots | *.odb | *.odc | \
*.otp | *.otg | *.ots | *.odb | *.odc | *.oxt | \
*.docx | *.epub | *.apk | *.apkm | *.war | *.xps | *.resource | \
*.application | *.docm | *.f3d | *.egg | *.kra | *.whl | *.3mf | \
*.sb2 | *.sb3 | *.ora | *.tc | *.wfp | *.wacz | *.xlsx | *.pptx | \
Expand Down
1 change: 1 addition & 0 deletions fvi
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,7 @@ EOF
# Also OpenDocument Presentation Template .otp
# Also OpenDocument Spreadsheet Template .ots
# Also OpenDocument Presentation Template .otp
# Also OpenDocument Extension .oxt
# Also Quake3 packed file .pk3
# Also Nokia mobile phone theme .nth
# Also Microsoft Office Open XML .docx
Expand Down
1 change: 1 addition & 0 deletions test-autodescribe-expected
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
'testfiles/type1.ods' 'OpenDocument Spreadsheet Title'
'testfiles/type1.odt' 'Open Document title'
'testfiles/type1.ogg' 'OGG artist / OGG title'
'testfiles/type1.oxt' 'Solarized color palette'
'testfiles/type1.pam' 'PAM comment'
'testfiles/type1.pas' 'Pascal typical comment Not Copyright (C) 2021. Typical boilerplate goes here.'
'testfiles/type1.patch' 'Patch subject'
Expand Down
1 change: 1 addition & 0 deletions test-automtime-expected
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
'testfiles/type1.msg' '2021-10-12 12:34:56 +0000'
'testfiles/type1.ods' '2021-11-06 15:45:15.657373818'
'testfiles/type1.odt' '2021-10-13 02:28:28.386995722'
'testfiles/type1.oxt' '2022-09-14 14:33:36'
'testfiles/type1.patch' '2023-01-06 02:15:02 +0000'
'testfiles/type1.pcapng' '2021-12-19 00:00:01.000000'
'testfiles/type1.pdf' '2021-10-16 08:08:39 +0000'
Expand Down
Binary file added testfiles/type1.oxt
Binary file not shown.

0 comments on commit 90a1795

Please sign in to comment.