merged jpelletier's patch for historic archive formats

This commit is contained in:
Enrico Weigelt, metux IT service 2009-01-24 04:59:34 +01:00
parent 020b02057b
commit 173ca89fca
9 changed files with 257 additions and 0 deletions

View File

@ -1,4 +1,15 @@
2009-01-24 Enrico Weigelt, metux IT service <weigelt@metux.de>
* configure.ac:
* lib/mc.ext.in:
* vfs/extfs/Makefile.am:
* vfs/extfs/extfs.ini:
* vfs/extfs/uace.in:
* vfs/extfs/uarc.in:
* vfs/extfs/uc1541.in: added support for historic archive formats
(patch provided by jpelletier)
2009-01-19 Patrick Winnertz <winnie@debian.org> 2009-01-19 Patrick Winnertz <winnie@debian.org>
* edit/edit.h: Add two more ints * edit/edit.h: Add two more ints

View File

@ -605,9 +605,12 @@ vfs/extfs/lslR
vfs/extfs/mailfs vfs/extfs/mailfs
vfs/extfs/patchfs vfs/extfs/patchfs
vfs/extfs/rpms vfs/extfs/rpms
vfs/extfs/uace
vfs/extfs/ualz vfs/extfs/ualz
vfs/extfs/uar vfs/extfs/uar
vfs/extfs/uarc
vfs/extfs/uarj vfs/extfs/uarj
vfs/extfs/uc1541
vfs/extfs/uha vfs/extfs/uha
vfs/extfs/ulha vfs/extfs/ulha
vfs/extfs/urar vfs/extfs/urar

View File

@ -512,9 +512,28 @@ regex/\.([dD][bB][fF])$
regex/\.(rexx?|cmd)$ regex/\.(rexx?|cmd)$
Open=rexx %f %{Enter parameters};echo "Press ENTER";read y Open=rexx %f %{Enter parameters};echo "Press ENTER";read y
# Disk images for Commodore computers (VIC20, C64, C128)
regex/\.(d64|D64)$
Open=%cd %p#uc1541
View=%view{ascii} c1541 %f -list
Extract=c1541 %f -extract
### Plain compressed files ### ### Plain compressed files ###
# ace
regex/\.(ace|ACE)$
Open=%cd %p#uace
View=%view{ascii} unace l %f
Extract=unace x %f
# arc
regex/\.(arc|ARC)$
Open=%cd %p#uarc
View=%view{ascii} arc l %f
Extract=arc x %f '*'
Extract (with flags)=I=%{Enter any Arc flags:}; if test -n "$I"; then arc x $I %f; fi
# zip # zip
type/^([Zz][Ii][Pp])\ archive type/^([Zz][Ii][Pp])\ archive
Open=%cd %p#uzip Open=%cd %p#uzip

View File

@ -21,3 +21,6 @@ ulha
urar urar
uzip uzip
uzoo uzoo
uace
uarc
uc1541

View File

@ -21,9 +21,12 @@ EXTFS_IN = \
mailfs.in \ mailfs.in \
patchfs.in \ patchfs.in \
rpms.in \ rpms.in \
uace.in \
ualz.in \ ualz.in \
uar.in \ uar.in \
uarc.in \
uarj.in \ uarj.in \
uc1541.in \
uha.in \ uha.in \
ulha.in \ ulha.in \
urar.in \ urar.in \
@ -45,9 +48,12 @@ EXTFS_OUT = \
mailfs \ mailfs \
patchfs \ patchfs \
rpms \ rpms \
uace \
ualz \ ualz \
uar \ uar \
uarc \
uarj \ uarj \
uc1541 \
uha \ uha \
ulha \ ulha \
urar \ urar \

View File

@ -11,6 +11,8 @@ u7z
ualz ualz
# For arj usage you need a special patch to unarj (see unarj.diff) # For arj usage you need a special patch to unarj (see unarj.diff)
uarj uarj
uarc
uace
# ar is used for static libraries # ar is used for static libraries
uar uar
@ -28,6 +30,9 @@ lslR
# Hewlett Packard calculator # Hewlett Packard calculator
hp48: hp48:
# Commodore 64/128 d64/D64 files
uc1541
# Break patches into chunks # Break patches into chunks
patchfs patchfs

58
vfs/extfs/uace.in Normal file
View File

@ -0,0 +1,58 @@
#! /bin/sh
#
# ACE Virtual filesystem executive v0.1
# Works with unace v2.5
# Copyright (C) 2008 Jacques Pelletier
# May be distributed under the terms of the GNU Public License
# <jpelletier@ieee.org>
#
# Define your awk
AWK=gawk
# Define which archiver you are using with appropriate options
ACE_LIST="unace l"
ACE_GET="unace x"
# ACE_PUT="unace ?" not available
# The 'list' command executive
# Unace: DD.MM.YY HH.MM packed size ratio file
# ls:
mc_ace_fs_list()
{
$ACE_LIST "$1" | gawk -v uid=${UID-0} '
BEGIN { Month="JanFebMarAprMayJunJulAugSepOctNovDec" }
/%/ {
split($1,date,".")
if (date[3] > 50)
date[3]=date[3] + 1900
else
date[3]=date[3] + 2000
printf "-rw-r--r-- 1 %-8d %-8d %8d %s %2d %4d %s %s\n", uid, 0, $3, substr(Month,3*(date[2]-1)+1,3),date[1],date[3], $2, $6
}' 2>/dev/null
exit 0
}
# Command: copyout archivename storedfilename extractto
mc_ace_fs_copyout()
{
$ACE_GET "$1" "$2" > /dev/null 2>&1
mv "$2" "$3"
}
# The main routine
umask 077
cmd="$1"
shift
case "$cmd" in
list) mc_ace_fs_list "$@" ;;
copyout) mc_ace_fs_copyout "$@" ;;
*) exit 1 ;;
esac
exit 0

82
vfs/extfs/uarc.in Normal file
View File

@ -0,0 +1,82 @@
#! /bin/sh
#
# ARC Virtual filesystem executive
# Copyright (C) 2008 Jacques Pelletier
# May be distributed under the terms of the GNU Public License
# <jpelletier@ieee.org>
#
# Define your awk
AWK=gawk
# Define which archiver you are using with appropriate options
ARC_LIST="arc v"
ARC_GET="arc x"
ARC_PUT="arc a"
ARC_DEL="arc d"
# The 'list' command executive
mc_arc_fs_list()
{
$ARC_LIST "$1" | gawk -v uid=${UID-0} '
BEGIN { }
/^Name/ { next }
/===/ { next }
/^Total/ { next }
{
if ($8 > 50)
$8=$8 + 1900
else
$8=$8 + 2000
split($9, a, ":")
# convert AM/PM to 00-23
if (a[2] ~ /a$|p$/)
{
if (a[2] ~ /p$/)
a[1] = a[1]+12
a[2]=substr(a[2],1,2)
}
printf "-rw-r--r-- 1 %-8d %-8d %8d %s %2d %4d %02d:%02d %s\n", uid, 0, $2, $7, $6, $8, a[1], a[2], $1
}' 2>/dev/null
exit 0
}
# Command: copyout archivename storedfilename extractto
mc_arc_fs_copyout()
{
$ARC_GET "$1" "$2" 2> /dev/null
mv "$2" "$3"
}
# Command: copyin archivename storedfilename sourcefile
mc_arc_fs_copyin()
{
mv "$3" "$2"
$ARC_PUT "$1" "$2" 2> /dev/null
}
# Command: rm archivename storedfilename
mc_arc_fs_rm()
{
$ARC_DEL "$1" "$2" 2> /dev/null
}
# The main routine
umask 077
cmd="$1"
shift
case "$cmd" in
list) mc_arc_fs_list "$@" ;;
copyout) mc_arc_fs_copyout "$@" ;;
copyin) mc_arc_fs_copyin "$@" ;;
rm) mc_arc_fs_rm "$@" ;;
*) exit 1 ;;
esac
exit 0

70
vfs/extfs/uc1541.in Normal file
View File

@ -0,0 +1,70 @@
#! /bin/sh
#
# UC1541 Virtual filesystem executive v0.1
# This is for accessing disk image files for the Commodore VIC20/C64/C128
# It requires the utility c1541 that comes bundled with Vice, the emulator
# for the VIC20, C64, C128 and other computers made by Commodore.
# Copyright (C) 2008 Jacques Pelletier
# May be distributed under the terms of the GNU Public License
# <jpelletier@ieee.org>
#
# Define your awk
AWK=gawk
# Define which archiver you are using with appropriate options
C1541="c1541"
# There are no time stamps in the disk image, so a bogus timestamp is displayed
mc_c1541_fs_list()
{
$C1541 "$1" -list | gawk -v uid=${UID-0} '
BEGIN { FS = "\"" }
/No LINES!/ { next }
/BLOCKS FREE/ { next }
$1 == 0 { next }
{
printf "-rw-r--r-- 1 %-8d %-8d %8d Jan 01 1980 00:00 %s\n", uid, 0, $1 * 256, $2
}' 2>/dev/null
}
# Command: copyout archivename storedfilename extractto
# -read image 1541name [fsname]
mc_c1541_fs_copyout()
{
$C1541 "$1" -read "$2" 2> /dev/null
mv "$2" "$3"
}
# FIXME mc can't do chown of the file inside the archive
# Command: copyin archivename storedfilename sourcefile
# -write image fsname [1541name]
mc_c1541_fs_copyin()
{
mv "$3" "$2"
$C1541 "$1" -write "$2" 2> /dev/null
}
# Command: rm archivename storedfilename
# -delete image files
mc_c1541_fs_rm()
{
$C1541 "$1" -delete "$2" 2> /dev/null
}
# The main routine
umask 077
cmd="$1"
shift
case "$cmd" in
list) mc_c1541_fs_list "$@" ;;
copyout) mc_c1541_fs_copyout "$@" ;;
# copyin) mc_c1541_fs_copyin "$@" ;;
rm) mc_c1541_fs_rm "$@" ;;
*) exit 1 ;;
esac
exit 0