Skip to content

Commit

Permalink
Add support for Commodore .d64 and .t64 files in autodescribe
Browse files Browse the repository at this point in the history
Also, add a few more Commodore extensions to fv.
  • Loading branch information
dfandrich committed Aug 25, 2023
1 parent 77055bb commit 5044f93
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions autodescribe
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,15 @@ comment_cue () {
COMMENT=$(sed -n -E -e '/^TITLE/s/^TITLE *"([^"]*)" *$/\1/p' < "$1" | head -1)
}

# File type: cbm (Commodore disk image)
# See https://github.com/dfandrich/fvcbm/
# requires: fvcbm
comment_cbm () {
# "safe" filename guaranteed not to start with a dash
sf="$(safefn "$1")"
COMMENT=$(fvcbm "$sf" | sed -Ene 's/^Title: {1,3}(.{1,16}).*$/\1/p' -e '/^={16,}/q' | trimspace)
}

# File type: desktop (XDG desktop entry file)
comment_desktop () {
# First look for the name, localized if possible
Expand Down Expand Up @@ -1328,6 +1337,9 @@ for f in "$@" ; do
;;
*.cue) TYPE=cue
;;
*.d64 | *.d71 | *.d80 | *.d82 | *.x64 | *.t64)
TYPE=cbm
;;
*.dar) TYPE=dar
;;
# Many DocBooks just use the .xml extension which is too generic
Expand Down
4 changes: 2 additions & 2 deletions fv
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,8 @@ EOF
# *.lzh and *.lha can be handled by fvcbm, but are taken care of
# by lha above
# *.lbr types conflict and are taken care of earlier
*.sda | *.sfx | *.d64 | *.x64 | *.t64 | *.lnx | \
*.n64 | *.lbr | *.[psrud]00 | \
*.sda | *.sfx | *.d64 | *.d71 | *.d80 | *.d82 | *.x64 | *.t64 | \
*.lnx | *.n64 | *.lbr | *.[psrud]0[0-9] | \
*.cbmarc) archive_label Commodore 64 archive
fvcbm "$sf"
;;
Expand Down

0 comments on commit 5044f93

Please sign in to comment.