initial commit of file from CVS for smeserver-dar2 on Sat Sep 7 20:16:13 AEST 2024
This commit is contained in:
8
root/opt/dar2-mc/README
Normal file
8
root/opt/dar2-mc/README
Normal file
@@ -0,0 +1,8 @@
|
||||
What's this?
|
||||
|
||||
This is a package to add support for dar archives to the Midnight
|
||||
Commander.
|
||||
|
||||
To add dar archive handling to Midnight Commander simply execute the install.sh script:
|
||||
|
||||
# ./install.sh
|
58
root/opt/dar2-mc/extfs.ini
Normal file
58
root/opt/dar2-mc/extfs.ini
Normal file
@@ -0,0 +1,58 @@
|
||||
# Each external VFS type must be registered here if you want to use it
|
||||
# Trailing colon means that the filesystem is not tied to a certain file
|
||||
|
||||
# Popular pc archivers
|
||||
uzip
|
||||
uzoo
|
||||
ulha
|
||||
urar
|
||||
uha
|
||||
# For arj usage you need a special patch to unarj (see unarj.diff)
|
||||
uarj
|
||||
|
||||
# ar is used for static libraries
|
||||
uar
|
||||
|
||||
# Packages from popular Linux distributions
|
||||
rpm
|
||||
deb
|
||||
|
||||
# a: - mtools filesystem
|
||||
a:
|
||||
|
||||
# For browsing lslR listings (found on many ftp sites)
|
||||
lslR
|
||||
|
||||
# Hewlett Packard calculator
|
||||
hp48:
|
||||
|
||||
# Break patches into chunks
|
||||
patchfs
|
||||
|
||||
# Represents a mailbox as a directory
|
||||
mailfs
|
||||
|
||||
# List all installed RPM packages on the system
|
||||
rpms:
|
||||
trpm
|
||||
|
||||
# dpkg frontend
|
||||
dpkg:
|
||||
debd
|
||||
|
||||
# apt frontend
|
||||
apt:
|
||||
deba
|
||||
|
||||
# Simple filesystem for audio cdroms. Use /dev/cdrom#audio (or /#audio).
|
||||
audio
|
||||
|
||||
# Package of Bad Penguin (an Italian GNU/Linux distribution)
|
||||
bpp
|
||||
|
||||
# ISO image
|
||||
iso9660
|
||||
|
||||
# Disk archivers
|
||||
udar
|
||||
|
5
root/opt/dar2-mc/install.sh
Executable file
5
root/opt/dar2-mc/install.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
cp -af udar /usr/share/mc/extfs
|
||||
cp -af extfs.ini /usr/share/mc/extfs
|
||||
cp -af mc.ext /usr/share/mc
|
559
root/opt/dar2-mc/mc.ext
Normal file
559
root/opt/dar2-mc/mc.ext
Normal file
@@ -0,0 +1,559 @@
|
||||
# Midnight Commander 3.0 extension file
|
||||
# Warning: Structure of this file has changed completely with version 3.0
|
||||
#
|
||||
# All lines starting with # or empty lines are thrown away.
|
||||
# Lines starting in the first column should have following format:
|
||||
#
|
||||
# keyword/descNL, i.e. everything after keyword/ until new line is desc
|
||||
#
|
||||
# keyword can be:
|
||||
#
|
||||
# shell (desc is, when starting with a dot, any extension (no wildcars),
|
||||
# i.e. matches all the files *desc . Example: .tar matches *.tar;
|
||||
# if it doesn't start with a dot, it matches only a file of that name)
|
||||
#
|
||||
# regex (desc is an extended regular expression)
|
||||
# Please note that we are using the GNU regex library and thus
|
||||
# \| matches the literal | and | has special meaning (or) and
|
||||
# () have special meaning and \( \) stand for literal ( ).
|
||||
#
|
||||
# type (file matches this if `file %f` matches regular expression desc
|
||||
# (the filename: part from `file %f` is removed))
|
||||
#
|
||||
# directory (matches any directory matching regular expression desc)
|
||||
#
|
||||
# include (matches an include directive)
|
||||
#
|
||||
# default (matches any file no matter what desc is)
|
||||
#
|
||||
# Other lines should start with a space or tab and should be in the format:
|
||||
#
|
||||
# keyword=commandNL (with no spaces around =), where keyword should be:
|
||||
#
|
||||
# Open (if the user presses Enter or doubleclicks it),
|
||||
#
|
||||
# View (F3), Edit (F4)
|
||||
#
|
||||
# Include is the keyword used to add any further entries from an include/
|
||||
# section
|
||||
#
|
||||
# command is any one-line shell command, with the following substitutions:
|
||||
#
|
||||
# %% -> % character
|
||||
# %p -> name of the current file (without path, but pwd is its path)
|
||||
# %f -> name of the current file. Unlike %p, if file is located on a
|
||||
# non-local virtual filesystem, i.e. either tarfs, mcfs or ftpfs,
|
||||
# then the file will be temporarily copied into a local directory
|
||||
# and %f will be the full path to this local temporal file.
|
||||
# If you don't want to get a local copy and want to get the
|
||||
# virtual fs path (like /#ftp:ftp.cvut.cz/pub/hungry/xword), then
|
||||
# use %d/%p instead of %f.
|
||||
# %d -> name of the current directory (pwd, without trailing slash)
|
||||
# %s -> "selected files", i.e. space separated list of tagged files if any
|
||||
# or name of the current file
|
||||
# %t -> list of tagged files
|
||||
# %u -> list of tagged files (they'll be untaged after the command)
|
||||
#
|
||||
# (If these 6 letters are in uppercase, they refer to the other panel.
|
||||
# But you shouldn't have to use it in this file.)
|
||||
#
|
||||
#
|
||||
# %cd -> the rest is a path mc should change into (cd won't work, since it's
|
||||
# a child process). %cd handles even vfs names.
|
||||
#
|
||||
# %view -> the command you type will be piped into mc's internal file viewer
|
||||
# if you type only the %view and no command, viewer will load %f file
|
||||
# instead (i.e. no piping, so it is different to %view cat %f)
|
||||
# %view may be directly followed by {} with a list of any of
|
||||
# ascii (Ascii mode), hex (Hex mode), nroff (color highlighting for
|
||||
# text using backspace for bold and underscore) and unform
|
||||
# (no highlighting for nroff sequences) separated by commas.
|
||||
#
|
||||
# %var -> You use it like this: %var{VAR:default}. This macro will expand
|
||||
# to the value of the VAR variable in the environment if it's set
|
||||
# otherwise the value in default will be used. This is similar to
|
||||
# the Bourne shell ${VAR-default} construct.
|
||||
#
|
||||
# Rules are applied from top to bottom, thus the order is important.
|
||||
# If some actions are missing, search continues as if this target didn't
|
||||
# match (i.e. if a file matches the first and second entry and View action
|
||||
# is missing in the first one, then on pressing F3 the View action from
|
||||
# the second entry will be used. default should catch all the actions.
|
||||
#
|
||||
# Any new entries you develop for you are always welcome if they are
|
||||
# useful on more than one system. You can send your modifications
|
||||
# by e-mail to mc-devel@gnome.org
|
||||
|
||||
|
||||
### Changes ###
|
||||
#
|
||||
# Reorganization: 2000-05-01 Michal Svec <rebel@penguin.cz>
|
||||
|
||||
|
||||
### TODO ###
|
||||
#
|
||||
# Postscript Open: ps2svga [gs -DEVICE=jpeg|zgv or something]
|
||||
# Images asciiview
|
||||
#
|
||||
# All X Apps [Nothing/Warning] if no DISPLAY
|
||||
# Not found [Default/Warning]
|
||||
# Empty Output [Default/Warning]
|
||||
# Edit: CopyOut+EDIT+CopyIn
|
||||
# Security Check gzip/bzip EDIT (mktemp)
|
||||
#
|
||||
# Maybe: Open/XOpen/GOpen/KOpen/... for Console/X/GNOME/KDE/etc.
|
||||
|
||||
|
||||
### Sources ###
|
||||
|
||||
# C
|
||||
shell/.c
|
||||
Include=editor
|
||||
|
||||
# Fortran
|
||||
shell/.f
|
||||
Include=editor
|
||||
|
||||
# Header
|
||||
regex/\.(h|hpp)$
|
||||
Include=editor
|
||||
|
||||
# Asm
|
||||
regex/\.([Ss]|[Aa]sm|ASM)$
|
||||
Include=editor
|
||||
|
||||
# C++
|
||||
regex/\.(C|cc|[Cc]pp|CPP)$
|
||||
Inlude=editor
|
||||
|
||||
include/editor
|
||||
Open=%var{EDITOR:vi} %f
|
||||
|
||||
# Object
|
||||
shell/.o
|
||||
#Open=%var{PAGER:more} %f
|
||||
View=%view{ascii} file %f && nm %f
|
||||
|
||||
### Documentation ###
|
||||
|
||||
# Texinfo
|
||||
regex/\.(te?xi|texinfo)$
|
||||
|
||||
# GNU Info page
|
||||
type/^Info\ text
|
||||
Open=info -f %f
|
||||
#Open=pinfo %f
|
||||
|
||||
shell/.info
|
||||
Open=info -f %f
|
||||
#Open=pinfo %f
|
||||
|
||||
# Manual page
|
||||
# Exception - .so libraries are not manual pages
|
||||
regex/\.(so|so\.[0-9\.]*)$
|
||||
View=%view{ascii} file %f && nm %f
|
||||
|
||||
regex/(([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|n)|\.man)$
|
||||
Open=nroff -c -Tlatin1 -mandoc %f | %var{PAGER:more}
|
||||
View=%view{ascii,nroff} nroff -c -Tlatin1 -mandoc %f
|
||||
|
||||
# Troff with me macros.
|
||||
# Exception - "read.me" is not a nroff file.
|
||||
shell/read.me
|
||||
Open=
|
||||
View=
|
||||
|
||||
shell/.me
|
||||
Open=nroff -c -Tlatin1 -me %f | %var{PAGER:more}
|
||||
View=%view{ascii,nroff} nroff -c -Tlatin1 -me %f
|
||||
|
||||
# Troff with ms macros.
|
||||
shell/.ms
|
||||
Open=nroff -c -Tlatin1 -ms %f | %var{PAGER:more}
|
||||
View=%view{ascii,nroff} nroff -c -Tlatin1 -ms %f
|
||||
|
||||
# Manual page - compressed
|
||||
regex/([^0-9]|^[^\.]*)\.([1-9][a-z]?|n)\.g?[Zz]$
|
||||
Open=gzip -dc %f | nroff -c -Tlatin1 -mandoc | %var{PAGER:more}
|
||||
View=%view{ascii,nroff} case %d in /var/log*) gzip -dc %f ;; *) gzip -dc %f | nroff -c -Tlatin1 -mandoc ;; esac
|
||||
|
||||
regex/([^0-9]|^[^\.]*)\.([1-9][a-z]?|n)\.bz$
|
||||
Open=bzip -dc %f | nroff -c -Tlatin1 -mandoc | %var{PAGER:more}
|
||||
View=%view{ascii,nroff} bzip -dc %f | nroff -c -Tlatin1 -mandoc
|
||||
|
||||
regex/([^0-9]|^[^\.]*)\.([1-9][a-z]?|n)\.bz2$
|
||||
Open=bzip2 -dc %f | nroff -c -Tlatin1 -mandoc | %var{PAGER:more}
|
||||
View=%view{ascii,nroff} bzip2 -dc %f | nroff -c -Tlatin1 -mandoc
|
||||
|
||||
|
||||
### Images ###
|
||||
|
||||
type/^GIF
|
||||
Include=image
|
||||
|
||||
type/^JPEG
|
||||
Include=image
|
||||
|
||||
type/^PC\ bitmap
|
||||
Include=image
|
||||
|
||||
type/^PNG
|
||||
Include=image
|
||||
|
||||
type/^TIFF
|
||||
Include=image
|
||||
|
||||
type/^PBM
|
||||
Include=image
|
||||
|
||||
type/^PGM
|
||||
Include=image
|
||||
|
||||
type/^PPM
|
||||
Include=image
|
||||
|
||||
type/^Netpbm
|
||||
Include=image
|
||||
|
||||
type/^JNG
|
||||
Include=image
|
||||
|
||||
type/^MNG
|
||||
Include=image
|
||||
|
||||
shell/.xcf
|
||||
Open=gimp %f
|
||||
|
||||
shell/.xbm
|
||||
Open=bitmap %f
|
||||
|
||||
shell/.xpm
|
||||
Include=image
|
||||
View=sxpm %f
|
||||
|
||||
include/image
|
||||
Open=if [ "$DISPLAY" = "" ]; then zgv %f; else (display %f &); fi
|
||||
View=%view{ascii} identify %f
|
||||
#View=%view{ascii} asciiview %f
|
||||
|
||||
|
||||
### Sound files ###
|
||||
|
||||
regex/\.([wW][aA][vV]|[sS][nN][dD]|[vV][oO][cC]|[aA][uU]|[sS][mM][pP]|[aA][iI][fF][fF]|[sS][nN][dD])$
|
||||
Open=if [ "$DISPLAY" = "" ]; then play %f; else (xmms -e %f 1>/dev/null 2>&1 &); fi
|
||||
|
||||
regex/\.([mM][oO][dD]|[sS]3[mM]|[xX][mM]|[iI][tT]|[mM][tT][mM]|669|[sS][tT][mM]|[uU][lL][tT]|[fF][aA][rR])$
|
||||
Open=mikmod %f
|
||||
#Open=tracker %f
|
||||
|
||||
regex/\.([wW][aA][wW]22)$
|
||||
Open=vplay -s 22 %f
|
||||
|
||||
regex/\.([mM][pP]3)$
|
||||
Include=audio
|
||||
#Open=if [ "$DISPLAY" = "" ]; then mpg123 %f; else (xmms %f &); fi
|
||||
#View=%view{ascii} mpg123 -vtn1 %f 2>&1 | sed -n '/^Title/,/^Comment/p;/^MPEG/,/^Audio/p'
|
||||
|
||||
regex/\.([mM][kK][aA])$
|
||||
Include=audio
|
||||
|
||||
regex/\.([oO][gG][gG])$
|
||||
Open=if [ "$DISPLAY" = "" ]; then ogg123 %f; else (xmms %f &); fi
|
||||
View=%view{ascii} ogginfo %s
|
||||
|
||||
regex/\.([mM][iI][dD][iI]?|[rR][mM][iI][dD]?)$
|
||||
Open=timidity %f
|
||||
|
||||
regex/\.([wW][mM][aA])$
|
||||
Open=mplayer -vo null %f
|
||||
View=%view{ascii} mplayer -quiet -slave -frames 0 -vo null -ao null -identify %f 2>/dev/null | tail +13 || file %f
|
||||
|
||||
Include/audio
|
||||
Open=mplayer %f
|
||||
View=%view{ascii} mplayer -identify -vo null -ao null -frames 0 %f 2>&1 | sed -n '/^ID_/p'
|
||||
|
||||
### Play lists ###
|
||||
|
||||
regex/\.([mM]3[uU]|[pP][lL][sS])$
|
||||
Open=if [ -z "$DISPLAY" ]; then mplayer -vo null -playlist %f; else (xmms -p %f &); fi
|
||||
|
||||
|
||||
### Video ###
|
||||
|
||||
regex/\.([aA][vV][iI])$
|
||||
Include=video
|
||||
|
||||
regex/\.([aA][sS][fFxX])$
|
||||
Include=video
|
||||
|
||||
regex/\.([dD][iI][vV][xX])$
|
||||
Include=video
|
||||
|
||||
regex/\.([mM][oO][vV]|[qQ][tT])$
|
||||
Include=video
|
||||
|
||||
regex/\.([mM][pP]4|[mM][pP][eE]?[gG])$
|
||||
Include=video
|
||||
|
||||
regex/\.([mM][kK][vV])$
|
||||
Include=video
|
||||
|
||||
regex/\.([vV][oO][bB])$
|
||||
Include=video
|
||||
|
||||
regex/\.([wW][mM][vV])$
|
||||
Include=video
|
||||
|
||||
regex/\.([fF][lL][iIcC])$
|
||||
Include=video
|
||||
|
||||
regex/\.([oO][gG][mM])$
|
||||
Include=video
|
||||
|
||||
regex/\.([rR][aA]?[mM])$
|
||||
Open=(realplay %f >/dev/null 2>&1 &)
|
||||
View=%view{ascii} mplayer -identify -vo null -ao null -frames 0 %f 2>&1 | sed -n '/^ID_/p'
|
||||
|
||||
include/video
|
||||
Open=(mplayer %f >/dev/null 2>&1 &)
|
||||
View=%view{ascii} mplayer -identify -vo null -ao null -frames 0 %f 2>&1 | sed -n '/^ID_/p'
|
||||
#Open=(gtv %f >/dev/null 2>&1 &)
|
||||
#Open=(xanim %f >/dev/null 2>&1 &)
|
||||
|
||||
### Documents ###
|
||||
|
||||
# Postscript
|
||||
type/^PostScript
|
||||
Open=(gv %f &)
|
||||
View=%view{ascii} ps2ascii %f
|
||||
|
||||
# PDF
|
||||
type/^PDF
|
||||
Open=(xpdf %f &)
|
||||
#Open=(acroread %f &)
|
||||
#Open=(ghostview %f &)
|
||||
View=%view{ascii} pdftotext %f -
|
||||
|
||||
# The following code very ugly and should not be taken as example.
|
||||
# It should be cleaned up when the new format of mc.ext is developed.
|
||||
|
||||
# html
|
||||
regex/\.([hH][tT][mM][lL]?)$
|
||||
Open=if test -n "gnome-moz-remote" && test -n "$DISPLAY"; then (gnome-moz-remote file://%d/%p &) >/dev/null 2>&1; else links %f 2>/dev/null || lynx -force_html %f; fi
|
||||
View=%view{ascii} lynx -dump -force_html %f
|
||||
|
||||
# StarOffice 5.2
|
||||
shell/.sdw
|
||||
Open=(ooffice %f &)
|
||||
|
||||
# StarOffice 6 and OpenOffice.org formats
|
||||
regex/\.(sxw|stw|sxc|stc|sxi|sti|sxd|std|sxm|sxg)$
|
||||
Open=(ooffice %f &)
|
||||
|
||||
# AbiWord
|
||||
shell/.abw
|
||||
Open=(abiword %f &)
|
||||
|
||||
# Microsoft Word Document
|
||||
regex/\.([Dd][oO][cCtT]|[Ww][rR][iI])$
|
||||
Open=(abiword %f >/dev/null 2>&1 &)
|
||||
View=%view{ascii} catdoc -w %f || word2x -f text %f - || strings %f
|
||||
type/^Microsoft\ Word
|
||||
Open=(abiword %f >/dev/null 2>&1 &)
|
||||
View=%view{ascii} catdoc -w %f || word2x -f text %f - || strings %f
|
||||
|
||||
# RTF document
|
||||
regex/\.([rR][tT][fF])$
|
||||
Open=(abiword %f >/dev/null 2>&1 &)
|
||||
|
||||
# Microsoft Excel Worksheet
|
||||
regex/\.([xX][lL][sSwW])$
|
||||
Open=(gnumeric %f >/dev/null 2>&1 &)
|
||||
View=%view{ascii} xls2csv %f || strings %f
|
||||
type/^Microsoft\ Excel
|
||||
Open=(gnumeric %f >/dev/null 2>&1 &)
|
||||
View=%view{ascii} xls2csv %f || strings %f
|
||||
|
||||
# Use OpenOffice.org to open any MS Office documents
|
||||
type/^Microsoft\ Office\ Document
|
||||
Open=(ooffice %f &)
|
||||
|
||||
# Framemaker
|
||||
type/^FrameMaker
|
||||
Open=fmclient -f %f
|
||||
|
||||
# DVI
|
||||
regex/\.([dD][vV][iI])$
|
||||
Open=if [ x$DISPLAY = x ]; then dvisvga %f; else (xdvi %f &); fi
|
||||
View=%view{ascii} dvi2tty %f
|
||||
|
||||
# TeX
|
||||
regex/\.([Tt][Ee][Xx])$
|
||||
Open=%var{EDITOR:vi} %f
|
||||
|
||||
|
||||
### Miscellaneous ###
|
||||
|
||||
# Makefile
|
||||
regex/[Mm]akefile$
|
||||
Open=make -f %f %{Enter parameters}
|
||||
|
||||
# Imakefile
|
||||
shell/Imakefile
|
||||
Open=xmkmf -a
|
||||
|
||||
# Makefile.PL (MakeMaker)
|
||||
regex/^Makefile.(PL|pl)$
|
||||
Open=%var{PERL:perl} %f
|
||||
|
||||
# dbf
|
||||
regex/\.([dD][bB][fF])$
|
||||
Open=%view{ascii} dbview %f
|
||||
View=%view{ascii} dbview -b %f
|
||||
|
||||
# REXX script
|
||||
regex/\.(rexx?|cmd)$
|
||||
Open=rexx %f %{Enter parameters};echo "Press ENTER";read y
|
||||
|
||||
|
||||
### Archives ###
|
||||
|
||||
# dar
|
||||
regex/\.[0-9]*\.[Dd][Aa][Rr]$
|
||||
Open=%cd %p#udar
|
||||
View=%view{ascii} dar -l `echo %f | sed 's/\.[0-9]*\.[Dd][Aa][Rr]$//'` -N
|
||||
|
||||
# .tgz, .tpz, .tar.gz, .tar.z, .tar.Z
|
||||
regex/\.t([gp]?z|ar\.g?[zZ])$
|
||||
Open=%cd %p#utar
|
||||
View=%view{ascii} gzip -dc %f 2>/dev/null | tar tvvf -
|
||||
|
||||
regex/\.tar\.bz$
|
||||
# Open=%cd %p#utar
|
||||
View=%view{ascii} bzip -dc %f 2>/dev/null | tar tvvf -
|
||||
|
||||
regex/\.t(ar\.bz2|bz|b2)$
|
||||
Open=%cd %p#utar
|
||||
View=%view{ascii} bzip2 -dc %f 2>/dev/null | tar tvvf -
|
||||
|
||||
# .tar.F - used in QNX
|
||||
regex/\.tar\.F$
|
||||
# Open=%cd %p#utar
|
||||
View=%view{ascii} freeze -dc %f 2>/dev/null | tar tvvf -
|
||||
|
||||
# .qpr/.qpk - QNX Neutrino package installer files
|
||||
regex/\.(qp[rk])$
|
||||
Open=%cd %p#utar
|
||||
View=%view{ascii} gzip -dc %f 2>/dev/null | tar tvvf -
|
||||
|
||||
# tar
|
||||
regex/\.(tar|TAR)$
|
||||
Open=%cd %p#utar
|
||||
View=%view{ascii} tar tvvf %f
|
||||
|
||||
# zip
|
||||
type/^([Zz][Ii][Pp])\ archive
|
||||
Open=%cd %p#uzip
|
||||
View=%view{ascii} unzip -v %f
|
||||
|
||||
# zoo
|
||||
regex/\.([Zz][Oo][Oo])$
|
||||
Open=%cd %p#uzoo
|
||||
View=%view{ascii} zoo l %f
|
||||
|
||||
# lha
|
||||
type/^LHa\ .*archive
|
||||
Open=%cd %p#ulha
|
||||
View=%view{ascii} lha l %f
|
||||
|
||||
# arj
|
||||
regex/\.a(rj|[0-9][0-9])$
|
||||
Open=%cd %p#uarj
|
||||
View=%view{ascii} unarj l %f
|
||||
|
||||
# ha
|
||||
regex/\.([Hh][Aa])$
|
||||
Open=%cd %p#uha
|
||||
View=%view{ascii} ha lf %f
|
||||
|
||||
# rar
|
||||
regex/\.[rR]([aA][rR]|[0-9][0-9])$
|
||||
Open=%cd %p#urar
|
||||
View=%view{ascii} rar v -c- %f
|
||||
|
||||
# cpio
|
||||
shell/.cpio.Z
|
||||
Open=%cd %p#ucpio
|
||||
View=%view{ascii} gzip -dc '%f' | cpio -itv 2>/dev/null
|
||||
|
||||
shell/.cpio.gz
|
||||
Open=%cd %p#ucpio
|
||||
View=%view{ascii} gzip -dc '%f' | cpio -itv 2>/dev/null
|
||||
|
||||
shell/.cpio
|
||||
Open=%cd %p#ucpio
|
||||
View=%view{ascii} cpio -itv <'%f' 2>/dev/null
|
||||
|
||||
# ls-lR
|
||||
regex/(^|\.)ls-?lR(\.g?z|Z|bz2)?$
|
||||
Open=%cd %p#lslR
|
||||
|
||||
# patch
|
||||
regex/\.(diff|patch)(\.(bz2|gz|Z))?$
|
||||
Open=%cd %p#patchfs
|
||||
|
||||
# gzip
|
||||
type/^gzip
|
||||
Open=gzip -dc %f | %var{PAGER:more}
|
||||
View=%view{ascii} gzip -dc %f 2>/dev/null
|
||||
|
||||
# bzip2
|
||||
type/^bzip2
|
||||
Open=bzip2 -dc %f | %var{PAGER:more}
|
||||
View=%view{ascii} bzip2 -dc %f 2>/dev/null
|
||||
|
||||
# bzip
|
||||
type/^bzip
|
||||
Open=bzip -dc %f | %var{PAGER:more}
|
||||
View=%view{ascii} bzip -dc %f 2>/dev/null
|
||||
|
||||
# compress
|
||||
type/^compress
|
||||
Open=gzip -dc %f | %var{PAGER:more}
|
||||
View=%view{ascii} gzip -dc %f 2>/dev/null
|
||||
|
||||
# ar library
|
||||
regex/\.s?a$
|
||||
Open=%cd %p#uar
|
||||
#Open=%view{ascii} ar tv %f
|
||||
View=%view{ascii} file %f && nm %f
|
||||
|
||||
# trpm
|
||||
regex/\.trpm$
|
||||
Open=%cd %p#trpm
|
||||
View=%view{ascii} rpm -qivl --scripts `basename %p .trpm`
|
||||
|
||||
# RPM packages (SuSE uses *.spm for source packages)
|
||||
regex/\.(rpm|spm)$
|
||||
Open=%cd %p#rpm
|
||||
View=%view{ascii} if rpm --nosignature --version >/dev/null 2>&1; then RPM="rpm --nosignature" ; else RPM="rpm" ; fi ; $RPM -qivlp --scripts %f
|
||||
|
||||
# deb
|
||||
regex/\.deb$
|
||||
Open=%cd %p#deb
|
||||
View=%view{ascii} dpkg-deb -c %f
|
||||
|
||||
# ISO9660
|
||||
regex/\.iso$
|
||||
Open=%cd %p#iso9660
|
||||
View=%view{ascii} isoinfo -l -i %f
|
||||
|
||||
|
||||
### Default ###
|
||||
|
||||
# Default target for anything not described above
|
||||
default/*
|
||||
Open=
|
||||
View=
|
||||
|
||||
### EOF ###
|
105
root/opt/dar2-mc/udar
Executable file
105
root/opt/dar2-mc/udar
Executable file
@@ -0,0 +1,105 @@
|
||||
#!/bin/sh
|
||||
|
||||
# This is a parser for Dar archives in Midnight Commander. You need
|
||||
# the GPL dar program (version >= 2.3.0) written by Denis Corbin.
|
||||
|
||||
# Author: Guus Jansman
|
||||
|
||||
# Limitations:
|
||||
# - The archive file can not be changed
|
||||
# - Symbolic and hard links are not handled properly
|
||||
# - Block and character special files are not handled
|
||||
# - Files not stored in (differential) backups are not handled
|
||||
# - Dar files in archives are not handled (due filename restriction)
|
||||
|
||||
DAR=dar
|
||||
|
||||
# dar expects the basename (without number and extension)
|
||||
BASENAME="`echo "$2" | sed -e 's/\.[0-9]*\.[Dd][Aa][Rr]$//'`"
|
||||
|
||||
mcdarfs_list ()
|
||||
{
|
||||
$DAR -l "$BASENAME" -N -Q -as 2>/dev/null | gawk -v uuid=${UID-0} '
|
||||
BEGIN { flag=0 }
|
||||
/^-------/ { flag++; if (flag > 1) exit 0; next }
|
||||
/^$/ { next }
|
||||
{
|
||||
if (flag == 0) next
|
||||
line=$0
|
||||
split(line, record, " ")
|
||||
|
||||
# Do not display removed files
|
||||
if (record[1] == "[" && record[2] == "REMOVED")
|
||||
{
|
||||
next
|
||||
}
|
||||
|
||||
# We want "line" to start with permutation
|
||||
# TODO: better algorithm
|
||||
while (length(record[1]) != 10 || match(substr(record[1], 2, 1), "[r-]") == 0)
|
||||
{
|
||||
# line without real contents
|
||||
if (length(line) == 0) {
|
||||
next
|
||||
}
|
||||
line=substr(line, length(record[1])+1)
|
||||
while (length(line) != 0 && substr(line, 1, 1) != " ")
|
||||
{
|
||||
line=substr(line, 2)
|
||||
}
|
||||
split(line, record, " ")
|
||||
}
|
||||
|
||||
perm=record[1]
|
||||
# Block and character special files not supported
|
||||
# Change [bc] to [bcl] if symbolic links should not show up either
|
||||
if (match(substr(perm, 1, 1), "[bc]") != 0)
|
||||
{
|
||||
next
|
||||
}
|
||||
uid=record[2]
|
||||
if (match(uid, "^[0-9]*$") != 0)
|
||||
{
|
||||
uid=sprintf("%-8d", uid)
|
||||
}
|
||||
gid=record[3]
|
||||
if (match(gid, "^[0-9]*$") != 0)
|
||||
{
|
||||
gid=sprintf("%-8d", gid)
|
||||
}
|
||||
size=record[4]
|
||||
month=record[6]
|
||||
day=record[7]
|
||||
tm=substr(record[8], 1, 5)
|
||||
year=record[9]
|
||||
name=substr(line, index(line, sprintf("%s:", tm))+14)
|
||||
# TODO: find symbolic link target (probably the link has to be extracted)
|
||||
printf "%s 1 %s %s %8d %3s %02d %04d %s %s\n", perm, uid, gid, size, month, day, year, tm, name
|
||||
}'
|
||||
}
|
||||
|
||||
mcdarfs_copyout ()
|
||||
{
|
||||
# Dummy directory necessary since dar cannot output to stdout or named file
|
||||
mkdir "$3.dir.tmp"
|
||||
chmod 700 "$3.dir.tmp"
|
||||
if [ ! -d "$3.dir.tmp" ]; then exit 1; fi
|
||||
$DAR -x "$BASENAME" -N -O -Q -wa -g "$2" -R "$3.dir.tmp" >/dev/null 2>&1
|
||||
if [ -e "$3.dir.tmp/$2" ]; then
|
||||
mv "$3.dir.tmp/$2" "$3"
|
||||
rm -rf "$3.dir.tmp"
|
||||
else
|
||||
rm -rf "$3.dir.tmp"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
umask 077
|
||||
cmd="$1"
|
||||
shift
|
||||
case "$cmd" in
|
||||
list) mcdarfs_list "$@" ;;
|
||||
copyout) mcdarfs_copyout "$@" ;;
|
||||
*) exit 1 ;;
|
||||
esac
|
||||
exit 0
|
Reference in New Issue
Block a user