JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3RbrJFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3RbrPK!WSS1S1 mcedit.menunu[shell_patterns=0 # expression type # The macros are: # # %c The cursor column position number. For edit menu only. # %i The indent of blank space, equal the cursor column # position. For edit menu only. # %y The syntax type of current file. For edit menu only. # %b The block file name. # %f The current file name. # %n Only the current file name without extension. # %x The extension of current file name. # %d The current directory name. # %F The current file in the unselected panel. # %D The directory name of the unselected panel. # %t The currently tagged files. # %T The tagged files in the unselected panel. # %u and %U Similar to the %t and %T macros, but in # addition the files are untagged. You can use this macro # only once per menu file entry or extension file entry, # because next time there will be no tagged files. # %s and %S The selected files: The tagged files if # there are any. Otherwise the current file. # # %% The % character # # %{some text} Prompt for the substitution. An input box # is shown and the text inside the braces is used as a # prompt. The macro is substituted by the text typed by the # user. The user can press ESC or F10 to cancel. This macro # doesn't work on the command line yet. #----------------------- Begin [perl] language template ----------------------- + y Perl\ Program | f \.pl$ 1 Author description header unset LANG unset LANGUAGE LC_ALL= MY_UID="`id | sed 's/^.*uid=\([^(]*\).*$/\1/'`" AUTHOR="`awk -F: '$3 == '$MY_UID' {print $5}' /etc/passwd`" cat >>%b < # Created at: `date` # Computer: `uname -n` # System: `uname -sr` on `uname -m` # # Copyright (c) `date +%%Y` $AUTHOR All rights reserved. # #---------------------------------------------------------------------- # Configure section: #---------------------------------------------------------------------- # # main() EOF + y Perl\ Program | f \.pl$ 2 while () cat < %b %iwhile() { %i} EOF + y Perl\ Program | f \.pl$ 3 for () cat < %b %ifor ($i = ; $i < ; $i++) { %i} EOF + y Perl\ Program | f \.pl$ 4 foreach () cat < %b %iforeach ($ ) { %i} EOF + y Perl\ Program | f \.pl$ 5 if () cat < %b %iif () { %i} EOF + y Perl\ Program | f \.pl$ 6 if () else cat < %b %iif () { %i} else { %i} EOF + y Perl\ Program | f \.pl$ 7 if () elsif () cat < %b %iif () { %i} elsif () { %i} EOF + y Perl\ Program | f \.pl$ 8 substr () echo "%i$ = substr(\$str, \$off, \$cnt);" >%b + y Perl\ Program | f \.pl$ 9 opendir () cat < %b %iopendir(DIR, \$dir) || die("\$0: can't open \$dir\n"); EOF + y Perl\ Program | f \.pl$ a sub () NAME=%{ Enter name of subroutine: } cat < %b sub $NAME () { } # end of $NAME() EOF #----------------------- End [perl] language template ------------------------- #---------------------- Begin [shell] language template ----------------------- + y Shell\ Script | f \.sh$ 1 Author description header unset LANG unset LANGUAGE LC_ALL= MY_UID="`id | sed 's/^.*uid=\([^(]*\).*$/\1/'`" AUTHOR="`awk -F: '$3 == '$MY_UID' {print $5}' /etc/passwd`" cat >>%b < # Created at: `date` # Computer: `uname -n` # System: `uname -sr` on `uname -m` # # Copyright (c) `date +%%Y` $AUTHOR All rights reserved. # #---------------------------------------------------------------------- # Configure section: #---------------------------------------------------------------------- # # main() EOF + y Shell\ Script | f \.sh$ 3 for cat < %b %ifor i in \$ %ido %idone EOF + y Shell\ Script | f \.sh$ 4 while cat < %b %iwhile %ido %idone EOF + y Shell\ Script | f \.sh$ 5 if [] then else cat <> %b %iif [ ];then %ielse %ifi EOF + y Shell\ Script | f \.sh$ 6 case NUMBER=%{ Enter number elements of case:} cat < %b %icase "\$" in EOF while [ "$NUMBER" -gt 0 ] do cat <> %b %i) %i ;; EOF let NUMBER=$NUMBER-1 done cat <> %b %i*) %iesac EOF + y Shell\ Script | f \.sh$ 7 function NAME=%{ Enter name of function:} cat <> %b $NAME() { } # end of $NAME() EOF + y Shell\ Script | f \.sh$ 8 select of bash cat <> %b %iselect i in \$l %ido %i if [ -n "\$i" ];then %i break %i else %i continue %i fi %idone EOF #----------------------- End [shell] language template ------------------------ #------------------------- Begin [c] language template ------------------------ + f \.h$ | f \.c$ | f \.cc$ 1 Author description header unset LANG unset LANGUAGE LC_ALL= MY_UID="`id | sed 's/^.*uid=\([^(]*\).*$/\1/'`" AUTHOR="`awk -F: '$3 == '$MY_UID' {print $5}' /etc/passwd`" cat >> %b < * Created at: `date` * Computer: `uname -n` * System: `uname -sr` on `uname -m` * * Copyright (c) `date +%%Y` $AUTHOR All rights reserved. * ********************************************************************/ EOF + f \.h$ | f \.c$ | f \.cc$ 2 GPL description header cat >>%b <. */ EOF + f \.c$ | f \.cc$ 3 if () cat < %b %iif () { %i} EOF + f \.c$ | f \.cc$ 4 if () else cat < %b %iif () { %i} else { %i} EOF + f \.c$ | f \.cc$ 5 if () else if () cat < %b %iif ( ) { %i} else if ( ) { %i} EOF + f \.c$ | f \.cc$ 6 switch () NUMBER=%{ Enter number elements of switch:} echo "%iswitch () {" >%b while [ "$NUMBER" -gt 0 ] do echo "%icase '':" >>%b echo "%i break;" >>%b let NUMBER=$NUMBER-1 done echo "%i default:" >>%b echo "%i}" >>%b + f \.c$ | f \.cc$ 7 for () cat < %b %ifor (i = ; i < ; i++) { %i} EOF + f \.c$ | f \.cc$ 8 while () cat < %b %iwhile () { %i} EOF + f \.c$ | f \.cc$ 9 do {} while () cat < %b %ido { %i} while () EOF + f \.c$ | f \.cc$ a array cat < %b %ichar const x[] = { %i, , %i}; EOF + f \.c$ | f \.cc$ b enum cat < %b %ienum x { %i, , %i}; EOF + f \.c$ | f \.cc$ c struct cat < %b %istruct ? { %i; %i}; EOF + f \.c$ | f \.cc$ d union cat < %b %iunion ? { %i; %i}; EOF + f \.c$ | f \.cc$ e typedef struct cat < %b %itypedef struct { %i; %i} ?; EOF + f \.c$ | f \.cc$ f function NAME=%{ Enter name of function:} cat <> %b $NAME() { } /* end of $NAME() */ EOF + f \.c$ | f \.h$ | f \.cc$ g #include INC=%{ Enter include name: } if [ -r "$INC" ];then echo \#include \"$INC\" >%b else echo \#include \<$INC\> >%b fi + f \.c$ | f \.h$ | f \.cc$ d #define echo "#define " >%b + f \.c$ | f \.h$ | f \.cc$ d #ifdef cat < %b #ifdef #else #endif EOF + f \.c$ | f \.h$ | f \.cc$ ............................................................................... + f \.c$ | f \.h$ | f \.cc$ h View all *.h into current directory cat *.h |less + f \.c$ | f \.cc$ d Run gdb for current file [ -x "./%n" ] && gdb ./%n = f \.c$ | f \.cc$ + f \.c$ | f \.cc$ c Compile, link and run the current .c file export CFLAGS="-g -Wall -O2" make || make %n || cc $CFLAGS -o %n %f [ -r "%n" ] && (echo "*** press any key for run... ***"; read) [ -x "%n" ] && ./%n (echo -ne "\n--- Press any key for return to edit. ---"; read) + f \.c$ | f \.h$ t Indent `C' formatter indent -kr -pcs %b 1>/dev/null 2> %e #--------------------- End [c/c++] language template -------------------------- #------------------------- Begin unknown template ----------------------------- + y unknown & t r s #! /bin/sh echo "#! /bin/sh" >%b + y unknown & t r p #! /usr/bin/perl echo "#! /usr/bin/perl" >%b + y unknown & t r a Author description header unset LANG unset LANGUAGE LC_ALL= MY_UID="`id | sed 's/^.*uid=\([^(]*\).*$/\1/'`" AUTHOR="`awk -F: '$3 == '$MY_UID' {print $5}' /etc/passwd`" cat >>%b < Created at: `date` Computer: `uname -n` System: `uname -sr` on `uname -m` Copyright (c) `date +%%Y` $AUTHOR All rights reserved. ---------------------------------------------------------------------- EOF #--------------------------- End unknown template ----------------------------- ------------------------------------------------------------------------------- #----------------------- Begin common section --------------------------------- S Sort selection TMPFILE=`mktemp ${MC_TMPDIR:-/tmp}/up.XXXXXX` || exit 1 cat %b > $TMPFILE cat $TMPFILE| sort >%b rm -f $TMPFILE I Insert `Changelog' string DATE="`date +%%Y-%%m-%%d`" MY_UID="`id | sed 's/^.*uid=\([^(]*\).*$/\1/'`" AUTHOR="`awk -F: '$3 == '$MY_UID' {print $5}' /etc/passwd`" EMAIL="<$REPLYTO>" echo "$DATE $AUTHOR $EMAIL" >%b s Invoke `shell' sh m view `man' MAN=%{Enter name of man:} %view{ascii,nroff} MANROFFOPT='-c -Tlatin1' MAN_KEEP_FORMATTING=1 man -P cat $MAN i Insert output of command to cursor CMD=%{ Enter command: } eval $CMD > %b o Open bash to next free console open -s -- /bin/bash u Upper case selection TMPFILE=`mktemp ${MC_TMPDIR:-/tmp}/up.XXXXXX` || exit 1 cat %b > $TMPFILE sed 's/\(.*\)/\U\1/' $TMPFILE >%b rm -f $TMPFILE l Lower case selection TMPFILE=`mktemp ${MC_TMPDIR:-/tmp}/up.XXXXXX` || exit 1 cat %b > $TMPFILE sed 's/\(.*\)/\L\1/' $TMPFILE >%b rm -f $TMPFILE #-------------------------- End of common section ----------------------------- PK!OZ[,,mc.menunu[shell_patterns=0 ############################################################################## # %% The % character # %f The current file (if non-local vfs, file will be copied locally and # %f will be full path to it) # %p The current file # %d The current working directory # %s "Selected files"; the tagged files if any, otherwise the current file # %t Tagged files # %u Tagged files (and they are untagged on return from expand_format) # %view Runs the commands and pipes standard output to the view command # If %view is immediately followed by '{', recognize keywords # ascii, hex, nroff and unform # # If the format letter is in uppercase, it refers to the other panel # # With a number followed the % character you can turn quoting on (default) # and off. For example: # %f quote expanded macro # %1f ditto # %0f don't quote expanded macro ############################################################################## + ! t t @ Do something on the current file CMD=%{Enter command} $CMD %f + t t @ Do something on the tagged files CMD=%{Enter command} for i in %t ; do $CMD "$i" done 0 Edit a bug report and send it to root I=`mktemp "${MC_TMPDIR:-/tmp}/mail.XXXXXX"` || exit 1 ${EDITOR-vi} "$I" test -r "$I" && mail root < "$I" rm -f "$I" =+ f \.1$ | f \.3$ | f \.4$ | f \.5$ | f \.6$ | f \.7$ | f \.8$ | f \.man$ & t r 1 Display the file with roff -man %view{ascii,nroff} roff -c -Tlatin1 -mandoc %f 2 Call the info hypertext browser info = t d 3 Compress the current subdirectory (tar.gz) Pwd=`basename %d /` echo -n "Name of the compressed file (without extension) [$Pwd]: " read tar [ "$tar"x = x ] && tar="$Pwd" cd .. && \ tar cf - "$Pwd" | gzip -f9 > "$tar.tar.gz" && \ echo "../$tar.tar.gz created." 4 Compress the current subdirectory (tar.bz2) Pwd=`basename %d /` echo -n "Name of the compressed file (without extension) [$Pwd]: " read tar [ "$tar"x = x ] && tar="$Pwd" cd .. && \ tar cf - "$Pwd" | bzip2 -f > "$tar.tar.bz2" && \ echo "../$tar.tar.bz2 created." 5 Compress the current subdirectory (tar.7z) Pwd=`basename %d /` echo -n "Name of the compressed file (without extension) [$Pwd]: " read tar [ "$tar"x = x ] && tar="$Pwd" cd .. && \ tar cf - "$Pwd" | 7za a -si "$tar.tar.7z" && \ echo "../$tar.tar.7z created." 6 Compress the current subdirectory (tar.xz) Pwd=`basename %d /` echo -n "Name of the compressed file (without extension) [$Pwd]: " read tar [ "$tar"x = x ] && tar="$Pwd" cd .. && \ tar cf - "$Pwd" | xz -f > "$tar.tar.xz" && \ echo "../$tar.tar.xz created." = f \.c$ & t r + f \.c$ & t r & ! t t c Compile and link current .c file make "`basename %f .c`" 2>/dev/null || cc -O -o "`basename %f .c`" %f + t r & ! t t a Append file to opposite cat %f >> %D/%f + t t A Append files to opposite files for i in %t ; do cat "$i" >> %D/"$i" done + t r & ! t t d Delete file if a copy exists in the other directory. if [ %d = %D ]; then echo "The two directories must be different." exit 1 fi if [ -f %D/%f ]; then # if two of them, then if cmp -s %D/%f %f; then rm %f && echo %f": DELETED." else echo %f" and "%D/%f" differ: NOT deleted." echo -n "Press RETURN " read key fi else echo %f": No copy in "%D/%f": NOT deleted." fi + t t D Delete tagged files if a copy exists in the other directory. if [ %d = %D ]; then echo "The two directores must be different." exit 1 fi for i in %t ; do if [ -f %D/"$i" ]; then SUM1=`sum "$i"` SUM2=`sum %D/"$i"` if [ "$SUM1" = "$SUM2" ]; then rm "$i" && echo "${i}: DELETED." else echo "$i and "%D"/$i differ: NOT deleted." fi else echo "$i has no copy in "%D": NOT deleted." fi done m View manual page MAN=%{Enter manual name} %view{ascii,nroff} MANROFFOPT='-c -Tlatin1' MAN_KEEP_FORMATTING=1 man -P cat "$MAN" = f \.gz$ & t r + ! t t n Inspect gzip'ed newsbatch file dd if=%f bs=1 skip=12 | zcat | ${PAGER-more} # assuming the cunbatch header is 12 bytes long. = t r & + ! t t h Strip headers from current newsarticle CHECK=`awk '{print $1 ; exit}' %f` 2>/dev/null case "$CHECK" in Newsgroups:|Path:) I=`mktemp "${MC_TMPDIR:-/tmp}/news.XXXXXX"` || exit 1 cp %f "$I" && sed '/^'"$CHECK"' /,/^$/d' "$I" > %f [ "$?" = "0" ] && rm "$I" echo %f": header removed." ;; *) echo %f" is not a news article." ;; esac + t t H Strip headers from the marked newsarticles for i in %t ; do CHECK=`awk '{print $1 ; exit}' "$i"` 2>/dev/null WFILE=`mktemp "${MC_TMPDIR:-/tmp}/news.XXXXXX"` || exit 1 case "$CHECK" in Newsgroups:|Path:) cp "$i" "$WFILE" && sed '/^'"$CHECK"' /,/^$/d' "$WFILE" > "$i" if [ "$?" = "0" ]; then rm "$WFILE"; echo "$i header removed. OK." else echo "Oops! Please check $i against $WFILE." fi ;; *) echo "$i skipped: Not a news article." ;; esac done = t r + ! t t r Copy file to remote host echo -n "To which host?: " read Host echo -n "To which directory on $Host?: " read Dir rcp -p %f "${Host}:${Dir}" + t t R Copy files to remote host (no error checking) echo -n "Copy files to which host?: " read Host echo -n "To which directory on $Host? :" read Dir rcp -pr %u "${Host}:${Dir}" = f \.tex$ & t r + f \.tex$ & t r & ! t t t Run latex on file and show it with xdvi latex %f && xdvi "`basename %f .tex`".dvi =+ f ^part | f ^Part | f uue & t r + t t U Uudecode marked news articles (needs work) ( for i in %t ; do # strip headers FIRST=`awk '{print $1 ; exit}' "$i"` cat "$i" | sed '/^'"$FIRST"' /,/^$/d' done ) | sed '/^$/d' | sed -n '/^begin 6/,/^end$/p' | uudecode if [ "$?" != "0" ]; then echo "Cannot decode "%t"." fi echo "Please test the output file before deleting anything." =+ f \.tar\.gz$ | f \.tar\.z$ | f \.tgz$ | f \.tpz$ | f \.tar\.lz$ | f \.tar\.lz4$ | f \.tar\.lzma$ | f \.tar\.7z$ | f \.tar\.xz$ | f \.tar\.Z$ | f \.tar\.bz2$ & t r x Extract the contents of a compressed tar file unset PRG case %f in *.tar.7z) PRG="7za e -so";; *.tar.bz2) PRG="bunzip2 -c";; *.tar.gz|*.tar.z|*.tgz|*.tpz|*.tar.Z) PRG="gzip -dc";; *.tar.lz) PRG="lzip -dc";; *.tar.lz4) PRG="lz4 -dc";; *.tar.lzma) PRG="lzma -dc";; *.tar.xz) PRG="xz -dc";; *) exit 1;; esac $PRG %f | tar xvf - = t r + ! t t y Gzip or gunzip current file unset DECOMP case %f in *.gz|*.[zZ]) DECOMP=-d;; esac gzip "$DECOMP" -v %f + t t Y Gzip or gunzip tagged files for i in %t ; do unset DECOMP case "$i" in *.gz|*.[zZ]) DECOMP=-d;; esac gzip "$DECOMP" -v "$i" done + ! t t b Bzip2 or bunzip2 current file unset DECOMP case %f in *.bz2) DECOMP=-d;; esac bzip2 "$DECOMP" -v %f + t t B Bzip2 or bunzip2 tagged files for i in %t ; do unset DECOMP case "$i" in *.bz2) DECOMP=-d;; esac bzip2 "$DECOMP" -v "$i" done + f \.tar.gz$ | f \.tgz$ | f \.tpz$ | f \.tar.Z$ | f \.tar.z$ | f \.tar.bz2$ | f \.tar.F$ & t r & ! t t z Extract compressed tar file to subdirectory unset D set gzip -cd case %f in *.tar.F) D=`basename %f .tar.F`; set freeze -dc;; *.tar.Z) D=`basename %f .tar.Z`;; *.tar.bz2) D=`basename %f .tar.bz2`; set bunzip2 -c;; *.tar.gz) D=`basename %f .tar.gz`;; *.tar.z) D=`basename %f .tar.z`;; *.tgz) D=`basename %f .tgz`;; *.tpz) D=`basename %f .tpz`;; esac mkdir "$D"; cd "$D" && ("$1" "$2" ../%f | tar xvf -) + t t Z Extract compressed tar files to subdirectories for i in %t ; do set gzip -dc unset D case "$i" in *.tar.F) D=`basename "$i" .tar.F`; set freeze -dc;; *.tar.Z) D=`basename "$i" .tar.Z`;; *.tar.bz2) D=`basename "$i" .tar.bz2`; set bunzip2 -c;; *.tar.gz) D=`basename "$i" .tar.gz`;; *.tar.z) D=`basename "$i" .tar.z`;; *.tgz) D=`basename "$i" .tgz`;; *.tpz) D=`basename "$i" .tpz`;; esac mkdir "$D"; (cd "$D" && "$1" "$2" "../$i" | tar xvf -) done + f \.gz$ | f \.tgz$ | f \.tpz$ | f \.Z$ | f \.z$ | f \.bz2$ & t r & ! t t c Convert gz<->bz2, tar.gz<->tar.bz2 & tgz->tar.bz2 unset D unset EXT case %f in *.Z) EXT=Z;; *.bz2) EXT=bz2;; *.gz) EXT=gz;; *.tgz) EXT=tgz;; *.tpz) EXT=tpz;; *.z) EXT=z;; esac case "$EXT" in bz2|Z|gz|z) D=`basename %f ."$EXT"`;; tgz|tpz) D=`basename %f ."$EXT"`.tar;; esac if [ "$EXT" = "bz2" ]; then bunzip2 -v %f gzip -f9 -v "$D" else gunzip -v %f bzip2 -v "$D" fi + t t C Convert gz<->bz2, tar.gz<->tar.bz2 & tgz->tar.bz2 for i in %t ; do unset D unset EXT case "$i" in *.Z) EXT=Z;; *.bz2) EXT=bz2;; *.gz) EXT=gz;; *.tgz) EXT=tgz;; *.tpz) EXT=tpz;; *.z) EXT=z;; esac case "$EXT" in bz2|Z|gz|z) D=`basename "$i" ."$EXT"`;; tgz|tpz) D=`basename "$i" ."$EXT"`.tar;; esac if [ "$EXT" = "bz2" ]; then bunzip2 -v "$i" gzip -f9 -v "$D" else gunzip -v "$i" bzip2 -v "$D" fi done + x /usr/bin/open | x /usr/local/bin/open & x /bin/sh o Open next a free console open -s -- sh PK!V""mc.default.keymapnu[[main] ChangePanel = tab Help = f1 UserMenu = f2 View = f3 # ViewFile = Edit = f4 # EditForceInternal = Copy = f5 Move = f6 MakeDir = f7 Delete = f8 Menu = f9 Quit = f10 MenuLastSelected = f19 QuitQuiet = f20 Find = alt-question CdQuick = alt-c HotList = ctrl-backslash Reread = ctrl-r DirSize = ctrl-space Suspend = ctrl-z Swap = ctrl-u History = alt-h # PanelListing = PanelListingSwitch = alt-t # PanelListingChange = ShowHidden = alt-dot SplitVertHoriz = alt-comma SplitEqual = alt-equal SplitMore = alt-shift-right SplitLess = alt-shift-left Shell = ctrl-o PutCurrentPath = alt-a PutOtherPath = alt-shift-a PutCurrentSelected = alt-enter; ctrl-enter PutCurrentFullSelected = ctrl-shift-enter ViewFiltered = alt-exclamation Select = kpplus Unselect = kpminus SelectInvert = kpasterisk ScreenList = alt-prime # OptionsLayout = # OptionsAppearance = # OptionsPanel = # OptionsConfirm = # OptionsDisplayBits = # OptionsVfs = # LearnKeys = # SaveSetup = # EditExtensionsFile = # EditFileHighlightFile = # Filter = # ConnectFish = # ConnectFtp = # ConnectSmb = # Undelete = ExtendedKeyMap = ctrl-x [main:xmap] ChangeMode = c ChangeOwn = o CompareDirs = d CompareFiles = ctrl-d HotListAdd = h LinkSymbolicEdit = ctrl-s Link = l LinkSymbolic = s LinkSymbolicRelative = v PanelInfo = i PanelQuickView = q ExternalPanelize = exclamation VfsList = a Jobs = j PutCurrentPath = p PutOtherPath = ctrl-p PutCurrentTagged = t PutOtherTagged = ctrl-t PutCurrentLink = r PutOtherLink = ctrl-r [panel] Search = ctrl-s; alt-s Mark = insert; ctrl-t MarkUp = shift-up MarkDown = shift-down # MarkLeft = # MarkRight = Down = down; ctrl-n Up = up; ctrl-p Left = left Right = right PageUp = pgup; alt-v PageDown = pgdn; ctrl-v Enter = enter PanelOtherCd = alt-o PanelOtherCdLink = alt-l ViewRaw = f13 EditNew = f14 CopySingle = f15 MoveSingle = f16 DeleteSingle = f18 # SelectExt = Select = alt-plus Unselect = alt-minus SelectInvert = alt-asterisk CdChild = ctrl-pgdn CdParent = ctrl-pgup # CdParentSmart = # Panelize = History = alt-shift-h HistoryNext = alt-u HistoryPrev = alt-y BottomOnScreen = alt-j MiddleOnScreen = alt-r TopOnScreen = alt-g PanelOtherSync = alt-i SelectCodepage = alt-e Top = alt-lt; home; a1 Bottom = alt-gt; end; c1 # Sort = # SortPrev = # SortNext = # SortReverse = # SortByName = # SortByExt = # SortBySize = # SortByMTime = # ScrollLeft = # ScrollRight = [dialog] Ok = enter Cancel = f10; esc; ctrl-g Up = left; up #Left = left; up Down = right; down #Right = right; down Help = f1 Suspend = ctrl-z Refresh = ctrl-l ScreenList = alt-prime ScreenNext = alt-rbrace ScreenPrev = alt-lbrace [input] Home = ctrl-a; alt-lt; home; a1 End = ctrl-e; alt-gt; end; c1 Left = left; alt-left; ctrl-b Right = right; alt-right; ctrl-f WordLeft = ctrl-left; alt-b WordRight = ctrl-right; alt-f Backspace = backspace; ctrl-h Delete = delete; ctrl-d DeleteToWordBegin = alt-backspace DeleteToWordEnd = alt-d # Mark = Remove = ctrl-w # Cut = Store = alt-w # Paste = Yank = ctrl-y DeleteToEnd = ctrl-k HistoryPrev = alt-p; ctrl-down HistoryNext = alt-n; ctrl-up History = alt-h Complete = alt-tab # Clear = MarkLeft = shift-left MarkRight = shift-right MarkToWordBegin = ctrl-shift-left MarkToWordEnd = ctrl-shift-right MarkToHome = shift-home MarkToEnd = shift-end [listbox] Up = up; ctrl-p Down = down; ctrl-n Top = home; alt-lt; a1 Bottom = end; alt-gt; c1 PageUp = pgup; alt-v PageDown = pgdn; ctrl-v Delete = delete; d Clear = shift-delete; shift-d [tree] Help = f1 Reread = f2; ctrl-r Forget = f3 ToggleNavigation = f4 Copy = f5 Move = f6 Up = up; ctrl-p Down = down; ctrl-n Left = left Right = right Top = home; alt-lt; a1 Bottom = end; alt-gt; c1 PageUp = pgup; alt-v PageDown = pgdn; ctrl-v Enter = enter Search = ctrl-s; alt-s Delete = f8; delete [help] Help = f1 Index = f2; c Back = f3; left; l Quit = f10; esc Up = up; ctrl-p Down = down; ctrl-n PageDown = f; space; pgdn; ctrl-v PageUp = b; pgup; alt-v; backspace HalfPageDown = d HalfPageUp = u Top = home; ctrl-home; ctrl-pgup; a1; alt-lt; g Bottom = end; ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g Enter = right; enter LinkNext = tab LinkPrev = alt-tab NodeNext = n NodePrev = p [editor] Store = ctrl-insert Paste = shift-insert Cut = shift-delete Up = up Down = down Left = left Right = right WordLeft = ctrl-left; ctrl-z WordRight = ctrl-right; ctrl-x Enter = enter Return = shift-enter; ctrl-enter; ctrl-shift-enter BackSpace = backspace; ctrl-h Delete = delete; ctrl-d PageUp = pgup PageDown = pgdn Home = home End = end Tab = tab; shift-tab; ctrl-tab; ctrl-shift-tab Undo = ctrl-u Redo = alt-r Top = ctrl-home; alt-lt Bottom = ctrl-end; alt-gt ScrollUp = ctrl-up ScrollDown = ctrl-down TopOnScreen = ctrl-pgup BottomOnScreen = ctrl-pgdn DeleteToWordBegin = alt-backspace DeleteToWordEnd = alt-d DeleteLine = ctrl-y DeleteToEnd = ctrl-k # DeleteToHome = # ParagraphUp = # ParagraphDown = Save = f2 # EditFile = EditNew = ctrl-n SaveAs = f12; ctrl-f2 # Close = Mark = f3 Copy = f5 Move = f6 Remove = f8 # MarkLine = # MarkWord = # MarkAll = # Unmark = Search = f7 SearchContinue = f17 # BlockShiftLeft = # BlockShiftRight = MarkPageUp = shift-pgup MarkPageDown = shift-pgdn MarkLeft = shift-left MarkRight = shift-right MarkToWordBegin = ctrl-shift-left MarkToWordEnd = ctrl-shift-right MarkUp = shift-up MarkDown = shift-down MarkToHome = shift-home MarkToEnd = shift-end MarkToFileBegin = ctrl-shift-home MarkToFileEnd = ctrl-shift-end MarkToPageBegin = ctrl-shift-pgup MarkToPageEnd = ctrl-shift-pgdn MarkScrollUp = ctrl-shift-up MarkScrollDown = ctrl-shift-down # MarkParagraphUp = # MarkParagraphDown = MarkColumnPageUp = alt-pgup MarkColumnPageDown = alt-pgdn MarkColumnLeft = alt-left MarkColumnRight = alt-right MarkColumnUp = alt-up MarkColumnDown = alt-down # MarkColumnScrollUp = # MarkColumnScrollDown = # MarkColumnParagraphUp = # MarkColumnParagraphDown = BlockSave = ctrl-f MarkColumn = f13 Replace = f4 ReplaceContinue = f14 Complete = alt-tab InsertFile = f15 Quit = f10; esc InsertOverwrite = insert Help = f1 # Date = Refresh = ctrl-l Goto = alt-l Sort = alt-t Mail = alt-m ParagraphFormat = alt-p MatchBracket = alt-b ExternalCommand = alt-u UserMenu = f11 Menu = f9 Bookmark = alt-k BookmarkFlush = alt-o BookmarkNext = alt-j BookmarkPrev = alt-i # History = Shell = ctrl-o InsertLiteral = ctrl-q # MacroStartRecord = # MacroStopRecord = MacroStartStopRecord = ctrl-r # MacroDelete = ShowNumbers = alt-n ShowTabTws = alt-underline SyntaxOnOff = ctrl-s # SyntaxChoose = # ShowMargin = Find = alt-enter FilePrev = alt-minus FileNext = alt-plus # RepeatStartStopRecord = SelectCodepage = alt-e # Options = # OptionsSaveMode = # SpellCheck = SpellCheckCurrentWord = ctrl-p # SpellCheckSelectLang = # LearnKeys = # WindowMove = # WindowResize = # WindowFullscreen = # WindowList = # WindowNext = # WindowPrev = # ExtendedKeyMap = [viewer] Help = f1 WrapMode = f2 Quit = f3; f10; q; esc HexMode = f4 Goto = f5 Search = f7 SearchForward = slash SearchBackward = question SearchContinue = f17; n SearchForwardContinue = ctrl-s SearchBackwardContinue = ctrl-r MagicMode = f8 NroffMode = f9 Home = ctrl-a End = ctrl-e Left = h; left Right = l; right LeftQuick = ctrl-left RightQuick = ctrl-right Up = k; y; insert; up; ctrl-p Down = j; e; delete; down; enter; ctrl-n PageDown = f; space; pgdn; ctrl-v PageUp = b; pgup; alt-v; backspace HalfPageDown = d HalfPageUp = u Top = home; ctrl-home; ctrl-pgup; a1; alt-lt; g Bottom = end; ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g BookmarkGoto = m Bookmark = r FileNext = ctrl-f FilePrev = ctrl-b SelectCodepage = alt-e Shell = ctrl-o Ruler = alt-r [viewer:hex] Help = f1 HexEditMode = f2 Quit = f3; f10; q; esc HexMode = f4 Goto = f5 Save = f6 Search = f7 SearchForward = slash SearchBackward = question SearchContinue = f17; n SearchForwardContinue = ctrl-s SearchBackwardContinue = ctrl-r MagicMode = f8 NroffMode = f9 ToggleNavigation = tab Home = ctrl-a; home End = ctrl-e; end Left = b; left Right = f; right Up = k; y; up Down = j; delete; down PageDown = pgdn; ctrl-v PageUp = pgup; alt-v Top = ctrl-home; ctrl-pgup; a1; alt-lt; g Bottom = ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g [diffviewer] ShowSymbols = alt-s; s ShowNumbers = alt-n; l SplitFull = f SplitEqual = equal SplitMore = gt SplitLess = lt Tab2 = 2 Tab3 = 3 Tab4 = 4 Tab8 = 8 Swap = ctrl-u Redo = ctrl-r HunkNext = n; enter; space HunkPrev = p; backspace Goto = g; shift-g Save = f2 Edit = f4 EditOther = f14 Merge = f5 MergeOther = f15 Search = f7 SearchContinue = f17 Options = f9 Top = ctrl-home Bottom = ctrl-end Down = down Up = up LeftQuick = ctrl-left RightQuick = ctrl-right Left = left Right = right PageDown = pgdn PageUp = pgup Home = home End = end Help = f1 Quit = f10; q; shift-q; esc Shell = ctrl-o SelectCodepage = alt-e PK!99sfs.ininu[# # This is config for Single File fileSystem # # Notice that output files (%3) are pre-created atomically in /tmp # with 0600 rights, so it is safe to > %3 # gz/1 gzip < %1 > %3 ugz/1 gzip -cdf < %1 > %3 bz/1 bzip < %1 > %3 ubz/1 bzip -d < %1 > %3 bz2/1 bzip2 < %1 > %3 ubz2/1 bzip2 -d < %1 > %3 lz/1 lzip < %1 > %3 ulz/1 lzip -d < %1 > %3 lz4/1 lz4 < %1 > %3 ulz4/1 lz4 -d < %1 > %3 lzma/1 lzma < %1 > %3 ulzma/1 lzma -d < %1 > %3 xz/1 xz < %1 > %3 uxz/1 xz -d < %1 > %3 tar/1 tar cf %3 %1 tgz/1 tar czf %3 %1 uhtml/1 lynx -force_html -dump %1 > %3 uman/1 groff -Tascii -man %1 > %3 uue/1 uuenpipe < %1 > %3 uude/1 uudepipe < %1 > %3 crlf/1 todos < %1 > %3 cr/1 fromdos < %1 > %3 # Fixme: we need it to fail whenever it should url:2 lynx -source `echo "%2" | sed 's-|-/-g'` > %3 nop/1 cat %1 > %3 strings/1 strings %1 > %3 PK!i϶)R)Rmc.extnu[# 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) # # shell/i (desc is, when starting with a dot, any extension (no wildcars), # The same as shell but with case insensitive. # # 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 ( ). # # regex/i (desc is an extended regular expression) # The same as regex but with case insensitive. # # type (file matches this if `file %f` matches regular expression desc # (the filename: part from `file %f` is removed)) # # type/i (file matches this if `file %f` matches regular expression desc) # The same as type but with case insensitive. # # 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). # Also provided to external application as MC_EXT_BASENAME # global variable # %f -> name of the current file. Unlike %p, if file is located on a # non-local virtual filesystem, i.e. either tarfs 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. # Also provided to external application as MC_EXT_FILENAME # global variable # %d -> name of the current directory (pwd, without trailing slash) # Also provided to external application as MC_EXT_CURRENTDIR # global variable # %s -> "selected files", i.e. space separated list of tagged files if any # or name of the current file. # Also provided to external application as MC_EXT_SELECTED # global variable # %t -> list of tagged files # Also provided to external application as MC_EXT_ONLYTAGGED # global variable # %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 post your modifications # as tickets at www.midnight-commander.org ### Changes ### # # Reorganization: 2012-03-07 Slava Zanko ### GIT Repo ### # gitfs changeset regex/^\[git\] Open=%cd %p/changesetfs:// View=%cd %p/patchsetfs:// ### Archives ### # .tgz, .tpz, .tar.gz, .tar.z, .tar.Z, .ipk, .gem regex/\.t([gp]?z|ar\.g?[zZ])$|\.ipk$|\.gem$ Open=%cd %p/utar:// View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view tar.gz shell/.tar.bz # Open=%cd %p/utar:// View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view tar.bzip regex/\.t(ar\.bz2|bz2?|b2)$ Open=%cd %p/utar:// View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view tar.bzip2 # .tar.lzma, .tlz regex/\.t(ar\.lzma|lz)$ Open=%cd %p/utar:// View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view tar.lzma # .tar.lz shell/.tar.lz Open=%cd %p/utar:// View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view tar.lz # .tar.lz4, .tlz4 regex/\.t(ar\.lz4|lz4)$ Open=%cd %p/utar:// View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view tar.lz4 # .tar.xz, .txz regex/\.t(ar\.xz|xz)$ Open=%cd %p/utar:// View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view tar.xz # .tar.F - used in QNX shell/.tar.F # Open=%cd %p/utar:// View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view tar.F # .qpr/.qpk - QNX Neutrino package installer files regex/\.qp[rk]$ Open=%cd %p/utar:// View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view tar.qpr # tar shell/i/.tar Open=%cd %p/utar:// View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view tar # lha type/^LHa\ .*archive Open=%cd %p/ulha:// View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view lha # arj regex/i/\.a(rj|[0-9][0-9])$ Open=%cd %p/uarj:// View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view arj # cab shell/i/.cab Open=%cd %p/ucab:// View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view cab # ha shell/i/.ha Open=%cd %p/uha:// View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view ha # rar regex/i/\.r(ar|[0-9][0-9])$ Open=%cd %p/urar:// View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view rar # ALZip shell/i/.alz Open=%cd %p/ualz:// View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view alz # cpio shell/.cpio.Z Open=%cd %p/ucpio:// View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view cpio.z shell/.cpio.lz Open=%cd %p/ucpio:// View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view cpio.lz shell/.cpio.lz4 Open=%cd %p/ucpio:// View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view cpio.lz4 shell/.cpio.xz Open=%cd %p/ucpio:// View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view cpio.xz shell/.cpio.gz Open=%cd %p/ucpio:// View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view cpio.gz shell/i/.cpio Open=%cd %p/ucpio:// View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view cpio # initrd regex/^(initramfs.*\.img|initrd(-.+)?\.img(-.+)?)$ Open=%cd %p/ucpio:// View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view cpio # 7zip archives (they are not man pages) shell/i/.7z Open=%cd %p/u7z:// View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view 7z # patch regex/\.(diff|patch)(\.bz2)$ Open=%cd %p/patchfs:// View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view bz2 regex/\.(diff|patch)(\.(gz|Z))$ Open=%cd %p/patchfs:// View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view gz regex/\.(diff|patch)(\.xz)$ Open=%cd %p/patchfs:// View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view xz # ls-lR regex/(^|\.)ls-?lR(\.gz|Z|bz2)$ Open=%cd %p/lslR:// # trpm shell/.trpm Open=%cd %p/trpm:// View=%view{ascii} /usr/libexec/mc/ext.d/package.sh view trpm # RPM packages (SuSE uses *.spm for source packages) regex/\.(src\.rpm|spm)$ Open=%cd %p/rpm:// View=%view{ascii} /usr/libexec/mc/ext.d/package.sh view src.rpm shell/.rpm Open=%cd %p/rpm:// View=%view{ascii} /usr/libexec/mc/ext.d/package.sh view rpm # deb regex/\.u?deb$ Open=%cd %p/deb:// View=%view{ascii} /usr/libexec/mc/ext.d/package.sh view deb # dpkg shell/.debd Open=%cd %p/debd:// View=%view{ascii} /usr/libexec/mc/ext.d/package.sh view debd # apt shell/.deba Open=%cd %p/deba:// View=%view{ascii} /usr/libexec/mc/ext.d/package.sh view deba # ISO9660 shell/i/.iso Open=%cd %p/iso9660:// View=%view{ascii} /usr/libexec/mc/ext.d/misc.sh view iso9660 regex/\.(diff|patch)$ Open=%cd %p/patchfs:// View=%view{ascii} /usr/libexec/mc/ext.d/misc.sh view cat # ar library regex/\.s?a$ Open=%cd %p/uar:// #Open=%view{ascii} ar tv %f View=%view{ascii} /usr/libexec/mc/ext.d/misc.sh view ar # gplib shell/i/.lib Open=%cd %p/ulib:// View=%view{ascii} /usr/libexec/mc/ext.d/misc.sh view lib # Mailboxes type/^ASCII\ mail\ text Open=%cd %p/mailfs:// ### Sources ### # C/C++ regex/i/\.(c|cc|cpp)$ Include=editor # C/C++ header regex/i/\.(h|hh|hpp)$ Include=editor # Fortran shell/i/.f Include=editor # Assembler regex/i/\.(s|asm)$ Include=editor include/editor Open=%var{EDITOR:vi} %f # .so libraries regex/\.(so|so\.[0-9\.]*)$ View=%view{ascii} /usr/libexec/mc/ext.d/misc.sh view so # Object type/^ELF #Open=%var{PAGER:more} %f View=%view{ascii} /usr/libexec/mc/ext.d/misc.sh view elf ### Documentation ### # Texinfo #regex/\.(te?xi|texinfo)$ # GNU Info page type/^Info\ text Open=/usr/libexec/mc/ext.d/text.sh open info shell/.info Open=/usr/libexec/mc/ext.d/text.sh open info # Exception: .3gp are video files not manual pages shell/i/.3gp Include=video # Manual page regex/(([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])|\.man)$ Open=/usr/libexec/mc/ext.d/text.sh open man %var{PAGER:more} View=%view{ascii,nroff} /usr/libexec/mc/ext.d/text.sh view man %var{PAGER:more} # Perl pod page shell/.pod Open=/usr/libexec/mc/ext.d/text.sh open pod %var{PAGER:more} View=%view{ascii,nroff} /usr/libexec/mc/ext.d/text.sh view pod %var{PAGER:more} # Troff with me macros. # Exception - "read.me" is not a nroff file. shell/read.me Open= View= shell/.me Open=/usr/libexec/mc/ext.d/text.sh open nroff.me %var{PAGER:more} View=%view{ascii,nroff} /usr/libexec/mc/ext.d/text.sh view nroff.me %var{PAGER:more} # Troff with ms macros. shell/.ms Open=/usr/libexec/mc/ext.d/text.sh open nroff.ms %var{PAGER:more} View=%view{ascii,nroff} /usr/libexec/mc/ext.d/text.sh view nroff.ms %var{PAGER:more} # Manual page - compressed regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.g?[Zz]$ Open=/usr/libexec/mc/ext.d/text.sh open man.gz %var{PAGER:more} View=%view{ascii,nroff} /usr/libexec/mc/ext.d/text.sh view man.gz %var{PAGER:more} regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.bz$ Open=/usr/libexec/mc/ext.d/text.sh open man.bz %var{PAGER:more} View=%view{ascii,nroff} /usr/libexec/mc/ext.d/text.sh view man.bz %var{PAGER:more} regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.bz2$ Open=/usr/libexec/mc/ext.d/text.sh open man.bz2 %var{PAGER:more} View=%view{ascii,nroff} /usr/libexec/mc/ext.d/text.sh view man.bz2 %var{PAGER:more} regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.lz$ Open=/usr/libexec/mc/ext.d/text.sh open man.lz %var{PAGER:more} View=%view{ascii,nroff} /usr/libexec/mc/ext.d/text.sh view man.lz %var{PAGER:more} regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.lz4$ Open=/usr/libexec/mc/ext.d/text.sh open man.lz4 %var{PAGER:more} View=%view{ascii,nroff} /usr/libexec/mc/ext.d/text.sh view man.lz4 %var{PAGER:more} regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.lzma$ Open=/usr/libexec/mc/ext.d/text.sh open man.lzma %var{PAGER:more} View=%view{ascii,nroff} /usr/libexec/mc/ext.d/text.sh view man.lzma %var{PAGER:more} regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.xz$ Open=/usr/libexec/mc/ext.d/text.sh open man.xz %var{PAGER:more} View=%view{ascii,nroff} /usr/libexec/mc/ext.d/text.sh view man.xz %var{PAGER:more} # CHM shell/i/.chm Open=/usr/libexec/mc/ext.d/text.sh open chm ### Images ### type/^GIF Include=image type/^JPEG View=%view{ascii} /usr/libexec/mc/ext.d/image.sh view jpeg Include=image type/^PC\ bitmap Include=image type/^PNG Include=image type/^JNG Include=image type/^MNG Include=image type/^TIFF Include=image type/^PBM Include=image type/^PGM Include=image type/^PPM Include=image type/^Netpbm Include=image shell/.xcf Open=/usr/libexec/mc/ext.d/image.sh open xcf shell/.xbm Open=/usr/libexec/mc/ext.d/image.sh open xbm shell/.xpm Include=image View=/usr/libexec/mc/ext.d/image.sh view xpm %f shell/.ico Include=image shell/i/.svg View=%view{ascii} /usr/libexec/mc/ext.d/image.sh view svg Open=/usr/libexec/mc/ext.d/image.sh open svg include/image Open=/usr/libexec/mc/ext.d/image.sh open ALL_FORMATS View=%view{ascii} /usr/libexec/mc/ext.d/image.sh view ALL_FORMATS ### Sound files ### regex/i/\.(wav|snd|voc|au|smp|aiff|snd|m4a|ape|aac|wv)$ Open=/usr/libexec/mc/ext.d/sound.sh open common regex/i/\.(mod|s3m|xm|it|mtm|669|stm|ult|far)$ Open=/usr/libexec/mc/ext.d/sound.sh open mod shell/i/.waw22 Open=/usr/libexec/mc/ext.d/sound.sh open wav22 shell/i/.mp3 Open=/usr/libexec/mc/ext.d/sound.sh open mp3 View=%view{ascii} /usr/libexec/mc/ext.d/sound.sh view mp3 regex/i/\.og[gax]$ Open=/usr/libexec/mc/ext.d/sound.sh open ogg View=%view{ascii} /usr/libexec/mc/ext.d/sound.sh view ogg regex/i/\.(spx|flac)$ Open=/usr/libexec/mc/ext.d/sound.sh open common regex/i/\.(midi?|rmid?)$ Open=/usr/libexec/mc/ext.d/sound.sh open midi shell/i/.wma Open=/usr/libexec/mc/ext.d/sound.sh open wma View=%view{ascii} /usr/libexec/mc/ext.d/sound.sh view wma ### Play lists ### regex/i/\.(m3u|pls)$ Open=/usr/libexec/mc/ext.d/sound.sh open playlist ### Video ### shell/i/.avi Include=video regex/i/\.as[fx]$ Include=video shell/i/.divx Include=video shell/i/.mkv Include=video regex/i/\.(mov|qt)$ Include=video regex/i/\.(mp4|m4v|mpe?g)$ Include=video # MPEG-2 TS container + H.264 codec shell/i/.mts Include=video shell/i/.ts Include=video shell/i/.vob Include=video shell/i/.wmv Include=video regex/i/\.fl[icv]$ Include=video shell/i/.ogv Include=video regex/i/\.ra?m$ Open=/usr/libexec/mc/ext.d/video.sh open ram # WebM shell/i/.webm Include=video type/WebM Include=video include/video Open=/usr/libexec/mc/ext.d/video.sh open ALL_FORMATS View=%view{ascii} /usr/libexec/mc/ext.d/video.sh view ALL_FORMATS ### Documents ### # Postscript type/^PostScript Open=/usr/libexec/mc/ext.d/doc.sh open ps View=%view{ascii} /usr/libexec/mc/ext.d/doc.sh view ps # PDF type/^PDF Open=/usr/libexec/mc/ext.d/doc.sh open pdf View=%view{ascii} /usr/libexec/mc/ext.d/doc.sh view pdf # html regex/i/\.html?$ Open=/usr/libexec/mc/ext.d/web.sh open html View=%view{ascii} /usr/libexec/mc/ext.d/web.sh view html # StarOffice 5.2 shell/.sdw Open=/usr/libexec/mc/ext.d/doc.sh open ooffice # StarOffice 6 and OpenOffice.org formats regex/i/\.(odt|ott|sxw|stw|ods|ots|sxc|stc|odp|otp|sxi|sti|odg|otg|sxd|std|odb|odf|sxm|odm|sxg)$ Open=/usr/libexec/mc/ext.d/doc.sh open ooffice View=%view{ascii} /usr/libexec/mc/ext.d/doc.sh view odt # AbiWord shell/.abw Open=/usr/libexec/mc/ext.d/doc.sh open abw # Gnumeric shell/i/.gnumeric Open=/usr/libexec/mc/ext.d/doc.sh open gnumeric # Microsoft Word Document regex/i/\.(do[ct]|wri)$ Open=/usr/libexec/mc/ext.d/doc.sh open msdoc View=%view{ascii} /usr/libexec/mc/ext.d/doc.sh view msdoc type/^Microsoft\ Word Open=/usr/libexec/mc/ext.d/doc.sh open msdoc View=%view{ascii} /usr/libexec/mc/ext.d/doc.sh view msdoc # RTF document shell/i/.rtf Open=/usr/libexec/mc/ext.d/doc.sh open msdoc # Microsoft Excel Worksheet regex/i/\.xl[sw]$ Open=/usr/libexec/mc/ext.d/doc.sh open msxls View=%view{ascii} /usr/libexec/mc/ext.d/doc.sh view msxls type/^Microsoft\ Excel Open=/usr/libexec/mc/ext.d/doc.sh open msxls View=%view{ascii} /usr/libexec/mc/ext.d/doc.sh view msxls regex/i/\.(ppt|pps)$ Open=/usr/libexec/mc/ext.d/doc.sh open msppt View=%view{ascii} /usr/libexec/mc/ext.d/doc.sh view msppt # Use OpenOffice.org to open any MS Office documents type/^Microsoft\ Office\ Document Open=/usr/libexec/mc/ext.d/doc.sh open ooffice # Framemaker type/^FrameMaker Open=/usr/libexec/mc/ext.d/doc.sh open framemaker # DVI shell/i/.dvi Open=/usr/libexec/mc/ext.d/doc.sh open dvi View=%view{ascii} /usr/libexec/mc/ext.d/doc.sh view dvi # TeX shell/i/.tex Include=editor # DjVu regex/i/\.djvu?$ Open=/usr/libexec/mc/ext.d/doc.sh open djvu View=%view{ascii} /usr/libexec/mc/ext.d/doc.sh view djvu # Comic Books regex/i/\.cb[zr]$ Open=/usr/libexec/mc/ext.d/doc.sh open comic # Epub & mobi regex/i/\.(epub|mobi)$ Open=/usr/libexec/mc/ext.d/doc.sh open epub View=%view{ascii} /usr/libexec/mc/ext.d/doc.sh view epub ### Miscellaneous ### # Compiled Java classes shell/.class View=%view{ascii} /usr/libexec/mc/ext.d/misc.sh view javaclass # 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 # sqlite3.db type/^SQLite 3.x database Open=/usr/libexec/mc/ext.d/misc.sh open sqlite View=%view{ascii} /usr/libexec/mc/ext.d/misc.sh view sqlite # dbf shell/i/.dbf Open=/usr/libexec/mc/ext.d/misc.sh open dbf View=%view{ascii} /usr/libexec/mc/ext.d/misc.sh view dbf # REXX script regex/\.(rexx?|cmd)$ Open=rexx %f %{Enter parameters};echo "Press ENTER";read y # Disk images for Commodore computers (VIC20, C64, C128) shell/i/.d64 Open=%cd %p/uc1541:// View=%view{ascii} c1541 %f -list Extract=c1541 %f -extract # Glade, a user interface designer for GTK+ and GNOME shell/i/.glade Open=/usr/libexec/mc/ext.d/misc.sh open glade # Gettext Catalogs regex/\.g?mo$ View=%view{ascii} /usr/libexec/mc/ext.d/misc.sh view mo # po shell/.po Open=/usr/libexec/mc/ext.d/misc.sh open po # lyx shell/i/.lyx Open=/usr/libexec/mc/ext.d/misc.sh open lyx View=%view{ascii} /usr/libexec/mc/ext.d/misc.sh view lyx # torrent shell/i/.torrent View=%view{ascii} /usr/libexec/mc/ext.d/misc.sh view torrent ### Plain compressed files ### # ace shell/i/.ace Open=%cd %p/uace:// View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view ace Extract=unace x %f # arc shell/i/.arc Open=%cd %p/uarc:// View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view arc Extract=arc x %f '*' Extract (with flags)=I=%{Enter any Arc flags:}; if test -n "$I"; then arc x $I %f; fi # zip shell/i/.zip Open=%cd %p/uzip:// View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view zip # zip type/i/^zip\ archive Open=%cd %p/uzip:// View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view zip # jar(zip) type/i/^Java\ (Jar\ file|archive)\ data\ \((zip|JAR)\) Open=%cd %p/uzip:// View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view zip # zoo shell/i/.zoo Open=%cd %p/uzoo:// View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view zoo # gzip type/^gzip Open=/usr/libexec/mc/ext.d/archive.sh view gz %var{PAGER:more} View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view gz regex/\.(gz|Z)$ View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view gz # bzip2 type/^bzip2 Open=/usr/libexec/mc/ext.d/archive.sh view bzip2 %var{PAGER:more} View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view bz2 regex/\.bz2?$ View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view bz2 # bzip type/^bzip Open=/usr/libexec/mc/ext.d/archive.sh view bzip %var{PAGER:more} View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view bzip # compress type/^compress Open=/usr/libexec/mc/ext.d/archive.sh view gz %var{PAGER:more} View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view gz # lz regex/\.lz$ Open=/usr/libexec/mc/ext.d/archive.sh view lz %var{PAGER:more} View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view lz # lz type/^LZIP Open=/usr/libexec/mc/ext.d/archive.sh view lz %var{PAGER:more} View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view lz # lz4 regex/\.lz4$ Open=/usr/libexec/mc/ext.d/archive.sh view lz4 %var{PAGER:more} View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view lz4 # lzma regex/\.lzma$ Open=/usr/libexec/mc/ext.d/archive.sh view lzma %var{PAGER:more} View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view lzma # xz regex/\.xz$ Open=/usr/libexec/mc/ext.d/archive.sh view xz %var{PAGER:more} View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view xz # Parity Archive type/^Parity\ Archive\ Volume\ Set Open=/usr/libexec/mc/ext.d/archive.sh open par2 ### Default ### # Default target for anything not described above default/* Open= View= ### EOF ### PK!i!!mc.emacs.keymapnu[[main] ChangePanel = tab Help = f1 UserMenu = f2 View = f3 # ViewFile = Edit = f4 # EditForceInternal = Copy = f5 Move = f6 MakeDir = f7 Delete = f8 Menu = f9 Quit = f10 MenuLastSelected = f19 QuitQuiet = f20 Find = alt-question CdQuick = alt-c HotList = ctrl-backslash Reread = ctrl-r DirSize = ctrl-space Suspend = ctrl-z Swap = ctrl-u History = alt-h # PanelListing = PanelListingSwitch = alt-t # PanelListingChange = ShowHidden = alt-dot SplitVertHoriz = alt-comma SplitEqual = alt-equal SplitMore = alt-shift-right SplitLess = alt-shift-left Shell = ctrl-o PutCurrentPath = alt-a PutOtherPath = alt-shift-a PutCurrentSelected = alt-enter; ctrl-enter PutCurrentFullSelected = ctrl-shift-enter ViewFiltered = alt-exclamation Select = kpplus Unselect = kpminus SelectInvert = kpasterisk ScreenList = alt-prime # OptionsLayout = # OptionsAppearance = # OptionsPanel = # OptionsConfirm = # OptionsDisplayBits = # OptionsVfs = # LearnKeys = # SaveSetup = # EditExtensionsFile = # EditFileHighlightFile = # Filter = # ConnectFish = # ConnectFtp = # ConnectSmb = # Undelete = ExtendedKeyMap = ctrl-x [main:xmap] ChangeMode = c ChangeOwn = o CompareDirs = d CompareFiles = ctrl-d HotListAdd = h LinkSymbolicEdit = ctrl-s Link = l LinkSymbolic = s LinkSymbolicRelative = v PanelInfo = i PanelQuickView = q ExternalPanelize = exclamation VfsList = a Jobs = j PutCurrentPath = p PutOtherPath = ctrl-p PutCurrentTagged = t PutOtherTagged = ctrl-t PutCurrentLink = r PutOtherLink = ctrl-r [panel] Search = ctrl-s; alt-s Mark = insert; ctrl-t MarkUp = shift-up MarkDown = shift-down # MarkLeft = # MarkRight = Down = down; ctrl-n Up = up; ctrl-p Left = left Right = right PageUp = pgup; alt-v PageDown = pgdn; ctrl-v Enter = enter PanelOtherCd = alt-o PanelOtherCdLink = alt-l ViewRaw = f13 EditNew = f14 CopySingle = f15 MoveSingle = f16 DeleteSingle = f18 # SelectExt = Select = alt-plus Unselect = alt-minus SelectInvert = alt-asterisk CdChild = ctrl-pgdn CdParent = ctrl-pgup # CdParentSmart = # Panelize = History = alt-shift-h HistoryNext = alt-u HistoryPrev = alt-y BottomOnScreen = alt-j MiddleOnScreen = alt-r TopOnScreen = alt-g PanelOtherSync = alt-i SelectCodepage = alt-e Top = alt-lt; home; a1 Bottom = alt-gt; end; c1 # Sort = # SortPrev = # SortNext = # SortReverse = # SortByName = # SortByExt = # SortBySize = # SortByMTime = # ScrollLeft = # ScrollRight = [dialog] Ok = enter Cancel = f10; esc Up = left; up #Left = left; up Down = right; down #Right = right; down Help = f1 Suspend = ctrl-z Refresh = ctrl-l ScreenList = alt-prime ScreenNext = alt-rbrace ScreenPrev = alt-lbrace [input] Home = ctrl-a; alt-lt; home; a1 End = ctrl-e; alt-gt; end; c1 Left = left; alt-left; ctrl-b Right = right; alt-right; ctrl-f WordLeft = ctrl-left; alt-b WordRight = ctrl-right; alt-f Backspace = backspace Delete = delete DeleteToWordBegin = alt-backspace DeleteToWordEnd = alt-d # Mark = Remove = ctrl-w # Cut = Store = alt-w # Paste = Yank = ctrl-y DeleteToEnd = ctrl-k HistoryPrev = alt-p; ctrl-down HistoryNext = alt-n; ctrl-up History = alt-h Complete = alt-tab # Clear = # MarkLeft = # MarkRight = # MarkToWordBegin = # MarkToWordEnd = # MarkToHome = # MarkToEnd = [listbox] Up = up; ctrl-p Down = down; ctrl-n Top = home; alt-lt; a1 Bottom = end; alt-gt; c1 PageUp = pgup; alt-v PageDown = pgdn; ctrl-v Delete = delete; d Clear = shift-delete; shift-d [tree] Help = f1 Reread = f2; ctrl-r Forget = f3 ToggleNavigation = f4 Copy = f5 Move = f6 Up = up; ctrl-p Down = down; ctrl-n Left = left Right = right Top = home; alt-lt; a1 Bottom = end; alt-gt; c1 PageUp = pgup; alt-v PageDown = pgdn; ctrl-v Enter = enter Search = ctrl-s; alt-s Delete = f8; delete [help] Help = f1 Index = f2; c Back = f3; left; l Quit = f10; esc; ctrl-g Up = up; ctrl-p Down = down; ctrl-n PageDown = f; space; pgdn; ctrl-v PageUp = b; pgup; alt-v; backspace HalfPageDown = d HalfPageUp = u Top = home; ctrl-home; ctrl-pgup; a1; alt-lt; g Bottom = end; ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g Enter = right; enter LinkNext = tab LinkPrev = alt-tab NodeNext = n NodePrev = p [editor] Store = alt-w Paste = ctrl-y Cut = ctrl-w Up = up; ctrl-p Down = down; ctrl-n Left = left; ctrl-b Right = right; ctrl-f WordLeft = ctrl-left; alt-b WordRight = ctrl-right; alt-f Enter = enter Return = shift-enter; ctrl-enter; ctrl-shift-enter BackSpace = backspace Delete = delete PageUp = pgup; alt-v PageDown = pgdn; ctrl-v Home = home; ctrl-a End = end; ctrl-e Tab = tab; shift-tab; ctrl-tab; ctrl-shift-tab Undo = ctrl-u # Redo = Top = ctrl-home; alt-lt Bottom = ctrl-end; alt-gt ScrollUp = ctrl-up ScrollDown = ctrl-down TopOnScreen = ctrl-pgup BottomOnScreen = ctrl-pgdn DeleteToWordBegin = alt-backspace DeleteToWordEnd = alt-d DeleteLine = ctrl-y DeleteToEnd = ctrl-k # DeleteToHome = # ParagraphUp = # ParagraphDown = Save = f2 # EditFile = SaveAs = f12; ctrl-f2 # Close = Mark = f3; ctrl-at Copy = f5 Move = f6 Remove = f8 # MarkLine = # MarkWord = # MarkAll = # Unmark = Search = f7; ctrl-s SearchContinue = f17 # BlockShiftLeft = # BlockShiftRight = MarkPageUp = shift-pgup MarkPageDown = shift-pgdn MarkLeft = shift-left MarkRight = shift-right MarkToWordBegin = ctrl-shift-left MarkToWordEnd = ctrl-shift-right MarkUp = shift-up MarkDown = shift-down MarkToHome = shift-home MarkToEnd = shift-end MarkToFileBegin = ctrl-shift-home MarkToFileEnd = ctrl-shift-end MarkToPageBegin = ctrl-shift-pgup MarkToPageEnd = ctrl-shift-pgdn MarkScrollUp = ctrl-shift-up MarkScrollDown = ctrl-shift-down # MarkParagraphUp = # MarkParagraphDown = MarkColumnPageUp = alt-pgup MarkColumnPageDown = alt-pgdn MarkColumnLeft = alt-left MarkColumnRight = alt-right MarkColumnUp = alt-up MarkColumnDown = alt-down # MarkColumnScrollUp = # MarkColumnScrollDown = # MarkColumnParagraphUp = # MarkColumnParagraphDown = # BlockSave = MarkColumn = f13 Replace = f4 ReplaceContinue = f14 Complete = alt-tab InsertFile = f15 Quit = f10; esc InsertOverwrite = insert Help = f1 # Date = Refresh = ctrl-l Goto = alt-l Sort = alt-t # Mail = ParagraphFormat = alt-p # MatchBracket = ExternalCommand = alt-u UserMenu = f11 Menu = f9 # Bookmark = # BookmarkFlush = # BookmarkNext = # BookmarkPrev = # History = Shell = ctrl-o InsertLiteral = ctrl-q # MacroStartRecord = # MacroStopRecord = MacroStartStopRecord = ctrl-r # MacroDelete = ShowNumbers = alt-n ShowTabTws = alt-underline SyntaxOnOff = ctrl-s # SyntaxChoose = # ShowMargin = Find = alt-enter FilePrev = alt-minus FileNext = alt-plus # RepeatStartStopRecord = SelectCodepage = alt-e # Options = # OptionsSaveMode = # SpellCheck = # SpellCheckCurrentWord = # SpellCheckSelectLang = # LearnKeys = # WindowMove = # WindowResize = # WindowFullscreen = # WindowList = # WindowNext = # WindowPrev = ExtendedKeyMap = ctrl-x [editor:xmap] EditNew = k [viewer] Help = f1 WrapMode = f2 Quit = f3; f10; q; esc HexMode = f4 Goto = f5 Search = f7 SearchForward = slash SearchBackward = question SearchContinue = f17; n SearchForwardContinue = ctrl-s SearchBackwardContinue = ctrl-r MagicMode = f8 NroffMode = f9 Home = ctrl-a End = ctrl-e Left = h; left Right = l; right LeftQuick= ctrl-left RightQuick = ctrl-right Up = k; y; insert; up; ctrl-p Down = j; e; delete; down; enter; ctrl-n PageDown = f; space; pgdn; ctrl-v PageUp = b; pgup; alt-v; backspace HalfPageDown = d HalfPageUp = u Top = home; ctrl-home; ctrl-pgup; a1; alt-lt; g Bottom = end; ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g BookmarkGoto = m Bookmark = r FileNext = ctrl-f FilePrev = ctrl-b SelectCodepage = alt-e Shell = ctrl-o Ruler = alt-r [viewer:hex] Help = f1 HexEditMode = f2 Quit = f3; f10; q; esc HexMode = f4 Goto = f5 Save = f6 Search = f7 SearchForward = slash SearchBackward = question SearchContinue = f17; n SearchForwardContinue = ctrl-s SearchBackwardContinue = ctrl-r MagicMode = f8 NroffMode = f9 ToggleNavigation = tab Home = ctrl-a; home End = ctrl-e; end Left = b; left Right = f; right Up = k; y; up Down = j; delete; down PageDown = pgdn; ctrl-v PageUp = pgup; alt-v Top = ctrl-home; ctrl-pgup; a1; alt-lt; g Bottom = ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g [diffviewer] ShowSymbols = alt-s; s ShowNumbers = alt-n; l SplitFull = f SplitEqual = equal SplitMore = gt SplitLess = lt Tab2 = 2 Tab3 = 3 Tab4 = 4 Tab8 = 8 Swap = ctrl-u Redo = ctrl-r HunkNext = n; enter; space HunkPrev = p; backspace Goto = g; shift-g Save = f2 Edit = f4 EditOther = f14 Merge = f5 MergeOther = f15 Search = f7 SearchContinue = f17 Options = f9 Top = ctrl-home Bottom = ctrl-end Down = down Up = up LeftQuick = ctrl-left RightQuick = ctrl-right Left = left Right = right PageDown = pgdn PageUp = pgup Home = home End = end Help = f1 Quit = f10; q; shift-q; esc Shell = ctrl-o SelectCodepage = alt-e PK! mfilehighlight.ininu[[executable] type=FILE_EXE [directory] type=DIR [device] type=DEVICE [special] type=SPECIAL [stalelink] type=STALE_LINK [symlink] type=SYMLINK [hardlink] type=HARDLINK [core] regexp=^core\\.*\\d*$ [temp] extensions=~;$$$;bak;tmp extensions_case=false regexp=(^#.*|.*~$) [archive] extensions=7z;Z;ace;arc;arj;ark;bz2;cab;gz;lha;lz;lz4;lzh;lzma;rar;rpm;tar;tbz;tbz2;tgz;tlz;xz;zip;zoo [doc] extensions=chm;css;ctl;diz;doc;docm;docx;dtd;htm;html;letter;lsm;mail;man;me;msg;nroff;odp;ods;odt;pdf;po;ppt;pptm;pptx;ps;rtf;sgml;shtml;tex;text;txt;xls;xlsm;xlsx;xml;xsd;xslt [source] extensions=ada;asm;awk;bash;c;caml;cc;cgi;cpp;cxx;diff;erl;h;hh;hi;hpp;hs;inc;jasm;jav;java;js;m4;mak;ml;mli;mll;mlp;mly;pas;patch;php;phps;pl;pm;prg;py;rb;sas;sh;sl;st;tcl;tk;xq [media] extensions=3gp;ape;asf;avi;flac;flv;it;m3u;med;mid;midi;mkv;mod;mol;mov;mp2;mp3;mp4;mpeg;mpg;mpl;ogg;ogv;s3m;umx;vob;wav;webm;wma;wmv;xm [graph] extensions=ai;bmp;cdr;eps;gif;ico;jpeg;jpg;omf;pcx;pic;png;rle;svg;tif;tiff;webp;wmf;xbm;xcf;xpm [database] extensions=cdx;dat;db;dbf;dbi;dbx;fox;mdb;mdn;mdx;msql;mssql;pgsql;sql;ssql PK! edit.indent.rcnuȯ#! /bin/sh # *** External Formatter (Indenter) for GNU Midnight Commander. # arguments: # $1 - Name of the file being edited # $2 - Name of the file to be processed exec >/dev/null case `echo $1 |sed 's/^.*\.//'` in c|h) # ftp://ftp.gnu.org/pub/gnu/indent/ # Please add options to your ~/.indent.pro, not here. indent "$2" ;; C|cc|CC|cxx|CXX|cpp|CPP) # http://astyle.sourceforge.net/ astyle "$2" ;; java|JAVA) # http://astyle.sourceforge.net/ astyle --style=java --mode=java "$2" ;; htm|html|HTM|HTML) # http://tidy.sourceforge.net/ tidy -q -m -ascii -wrap 80 "$2" ;; *) # http://www.gnu.org/software/coreutils/ fmt "$2" >"$2.tmp" && rm -f "$2" && mv -f "$2.tmp" "$2" ;; esac PK!~~MM mc-wrapper.shnu[MC_USER=`id | sed 's/[^(]*(//;s/).*//'` MC_PWD_FILE="${TMPDIR-/var/tmp}/mc-$MC_USER/mc.pwd.$$" /usr/bin/mc -P "$MC_PWD_FILE" "$@" if test -r "$MC_PWD_FILE"; then MC_PWD="`cat "$MC_PWD_FILE"`" if test -n "$MC_PWD" && test -d "$MC_PWD"; then cd "$MC_PWD" fi unset MC_PWD fi rm -f "$MC_PWD_FILE" unset MC_PWD_FILE unset MC_USER PK!L11mc.cshnu[alias mc 'source /usr/libexec/mc/mc-wrapper.csh' PK!붕mc.shnu[# Don't define aliases in plain Bourne shell [ -n "${BASH_VERSION}${KSH_VERSION}${ZSH_VERSION}" ] || return 0 alias mc='. /usr/libexec/mc/mc-wrapper.sh' PK!Kf0404 cons.savernuȯELF>@p,@8 @@@@00ppp (( (  @@ @  DDPtdDDQtdRtd(( ( /lib64/ld-linux-x86-64.so.2GNUGNUGNUCGyO(yCLL8? V3f9+n& ]t  y"Nlibc.so.6exitstrncmpcallocmemsetreadstrnlenlseekioctl__snprintf_chkseteuidgetuid__fxstatgeteuidcloseopen__cxa_finalizesetsid__libc_start_mainwriteGLIBC_2.2.5GLIBC_2.3.4_ITM_deregisterTMCloneTable__gmon_start___ITM_registerTMCloneTableui ti ( 0 @8 8      H P X ` h p x                 HH HtH5 % hhhhhhhhqhah Qh Ah 1h !h hhhh% D% D% D% D% D% D% D% D% D% D%} D%u D%m D%e D%] D%U D%M D%E DAWAVAUATUHSHdH%(H$1D$AD$B/u/LmL HtH5Lt߉\x1L1AƅxLd$PƿLxD$h%= uHD$xHHuDAG>z9\$lpAE@[:BU![H|8Mx8UTq'NEg6Vvp =]$ Gߠ#w{y19`rd<_=E]Ԫ?`|GV `ޜ6^o4v8Wk5n9haN. 0dl֠h /fvǸj;ncGG j72IHrފJ&rTU|9ʴB\yzs<%d}k&-dko"Beb[ԭgT@aJ+k 1E,%yQ?s4 ~>pwP0ZhK?,_nAcfy褙%YX88Ud]/h8&X;L}U_>cMFMYxAW+(&Rt:u:xg 2qx ѽgFgÆ29osFb]uv~j Vt .{Jcӱ[Dߴ"L_8KڐhGX_e qQd "W_4rU_,Y' +9uٴ<3Ika C=Z&,; - C\|&!,29FuF]s bY +ʰmD/x xyGƴ MG$qiq8ElVi-Z{s} }Gj5_=%BfgYZ.shstrtab.interp.note.gnu.property.note.ABI-tag.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata pp & 4$GoQ (Y@@aoDD.noxx0}Bhh  @ @ 0p p  HH XX9D ( (0 08 8@ @0 0     ` l p',/'0+>PK!^ ext.d/video.shnuȯ#!/bin/sh # $1 - action # $2 - type of file action=$1 filetype=$2 [ -n "${MC_XDG_OPEN}" ] || MC_XDG_OPEN="xdg-open" do_view_action() { filetype=$1 case "${filetype}" in *) mplayer -identify -vo null -ao null -frames 0 "${MC_EXT_FILENAME}" 2>&1 | \ sed -n 's/^ID_//p' ;; esac } do_open_action() { filetype=$1 case "${filetype}" in ram) (realplay "${MC_EXT_FILENAME}" >/dev/null 2>&1 &) ;; *) if [ -n "$DISPLAY" ]; then (mplayer "${MC_EXT_FILENAME}" >/dev/null 2>&1 &) else mplayer -vo null "${MC_EXT_FILENAME}" fi #(gtv "${MC_EXT_FILENAME}" >/dev/null 2>&1 &) #(xanim "${MC_EXT_FILENAME}" >/dev/null 2>&1 &) ;; esac } case "${action}" in view) do_view_action "${filetype}" ;; open) ("${MC_XDG_OPEN}" "${MC_EXT_FILENAME}" >/dev/null 2>&1) || \ do_open_action "${filetype}" ;; *) ;; esac PK!Y:A ext.d/doc.shnuȯ#!/bin/sh # $1 - action # $2 - type of file action=$1 filetype=$2 [ -n "${MC_XDG_OPEN}" ] || MC_XDG_OPEN="xdg-open" STAROFFICE_REGEXP='\.(sxw|sdw|stw|sxc|stc|sxi|sti|sxd|std||sxm||sxg)$' staroffice_console() { filename=$1;shift is_view=$1; shift if [ -n "${is_view}" ]; then is_view='-dump' fi tmp=`mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX` cd $tmp soffice2html.pl "${filename}" elinks ${is_view} content.html rm -rf "$tmp" } get_ooffice_executable() { which loffice >/dev/null 2>&1 && \ echo "loffice" || \ echo "ooffice" } do_view_action() { filetype=$1 case "${filetype}" in ps) ps2ascii "${MC_EXT_FILENAME}" ;; pdf) pdftotext -layout -nopgbrk "${MC_EXT_FILENAME}" - ;; odt) if [ ` echo "${MC_EXT_FILENAME}" | grep -c "${STAROFFICE_REGEXP}"` -ne 0 ]; then staroffice_console "${MC_EXT_FILENAME}" "view" else odt2txt "${MC_EXT_FILENAME}" fi ;; msdoc) which wvHtml >/dev/null 2>&1 && { tmp=`mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX` wvHtml "${MC_EXT_FILENAME}" --targetdir="$tmp" page.html elinks -dump "$tmp/page.html" rm -rf "$tmp" } || \ antiword -t "${MC_EXT_FILENAME}" || \ catdoc -w "${MC_EXT_FILENAME}" || \ word2x -f text "${MC_EXT_FILENAME}" - || \ strings "${MC_EXT_FILENAME}" ;; msxls) which xlHtml >/dev/null 2>&1 && { tmp=`mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX` xlhtml -a "${MC_EXT_FILENAME}" > "$tmp/page.html" elinks -dump "$tmp/page.html" rm -rf "$tmp" } || \ xls2csv "${MC_EXT_FILENAME}" || \ strings "${MC_EXT_FILENAME}" ;; dvi) which dvi2tty >/dev/null 2>&1 && \ dvi2tty "${MC_EXT_FILENAME}" || \ catdvi "${MC_EXT_FILENAME}" ;; djvu) djvused -e print-pure-txt "${MC_EXT_FILENAME}" ;; epub) einfo -v "${MC_EXT_FILENAME}" ;; *) ;; esac } do_open_action() { filetype=$1 case "${filetype}" in ps) if [ -n "$DISPLAY" ]; then (gv "${MC_EXT_FILENAME}" &) else ps2ascii "${MC_EXT_FILENAME}" | ${PAGER:-more} fi ;; pdf) if [ ! -n "$DISPLAY" ]; then pdftotext -layout -nopgbrk "${MC_EXT_FILENAME}" - | ${PAGER:-more} elif see > /dev/null 2>&1; then (see "${MC_EXT_FILENAME}" &) else (xpdf "${MC_EXT_FILENAME}" &) fi #(acroread "${MC_EXT_FILENAME}" &) #(ghostview "${MC_EXT_FILENAME}" &) ;; ooffice) if [ -n "$DISPLAY" ]; then OOFFICE=`get_ooffice_executable` (${OOFFICE} "${MC_EXT_FILENAME}" &) else if [ `echo "${MC_EXT_FILENAME}" | grep -c "${STAROFFICE_REGEXP}"` -ne 0 ]; then staroffice_console "${MC_EXT_FILENAME}" else odt2txt "${MC_EXT_FILENAME}" | ${PAGER:-more} fi fi ;; abw) (abiword "${MC_EXT_FILENAME}" &) ;; gnumeric) (gnumeric "${MC_EXT_FILENAME}" &) ;; msdoc) if [ -n "$DISPLAY" ]; then (abiword "${MC_EXT_FILENAME}" >/dev/null 2>&1 &) else tmp=`mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX` wvHtml "${MC_EXT_FILENAME}" --targetdir="$tmp" page.html -1 elinks "$tmp/page.html" rm -rf "$tmp" fi ;; msxls) if [ -n "$DISPLAY" ]; then (gnumeric "${MC_EXT_FILENAME}" >/dev/null 2>&1 &) else tmp=`mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX` xlhtml -a "${MC_EXT_FILENAME}" > "$tmp/page.html" elinks "$tmp/page.html" rm -rf "$tmp" fi ;; msppt) if [ -n "$DISPLAY" ]; then OOFFICE=`get_ooffice_executable` (${OOFFICE} "${MC_EXT_FILENAME}" >/dev/null 2>&1 &) else tmp=`mktemp -d ${TMPDIR:-/tmp}/%p.XXXXXX` ppthtml "${MC_EXT_FILENAME}" > "$tmp/page.html" elinks "$tmp/page.html" rm -rf "$tmp" fi ;; framemaker) fmclient -f "${MC_EXT_FILENAME}" ;; dvi) if [ -n "$DISPLAY" ]; then (xdvi "${MC_EXT_FILENAME}" &) else dvisvga "${MC_EXT_FILENAME}" || \ dvi2tty "${MC_EXT_FILENAME}" | ${PAGER:-more} fi ;; djvu) djview "${MC_EXT_FILENAME}" & ;; comic) cbrpager "${MC_EXT_FILENAME}" & ;; epub) lucidor "${MC_EXT_FILENAME}" >/dev/null & ;; *) ;; esac } case "${action}" in view) do_view_action "${filetype}" ;; open) ("${MC_XDG_OPEN}" "${MC_EXT_FILENAME}" >/dev/null 2>&1) || \ do_open_action "${filetype}" ;; *) ;; esac PK!^ ext.d/misc.shnuȯ#!/bin/sh # $1 - action # $2 - type of file action=$1 filetype=$2 [ -n "${MC_XDG_OPEN}" ] || MC_XDG_OPEN="xdg-open" do_view_action() { filetype=$1 case "${filetype}" in iso9660) isoinfo -d -i "${MC_EXT_FILENAME}" && isoinfo -l -R -J -i "${MC_EXT_FILENAME}" ;; cat) /bin/cat "${MC_EXT_FILENAME}" 2>/dev/null ;; ar) file "${MC_EXT_FILENAME}" && nm -C "${MC_EXT_FILENAME}" ;; lib) gplib -t "${MC_EXT_FILENAME}" | \ /usr/bin/perl -e 'while (<>) { @a=split /[\s\t]+/, $_; printf ("%-30s | %10d | %s.%s.%02d | %s\n", $a[0], ($a[1]*1),$a[7], lc($a[4]), $a[5], $a[6]);}' ;; so) file "${MC_EXT_FILENAME}" && nm -C -D "${MC_EXT_FILENAME}" ;; elf) file "${MC_EXT_FILENAME}" && nm -C "${MC_EXT_FILENAME}" ;; dbf) dbview -b "${MC_EXT_FILENAME}" ;; sqlite) sqlite3 "${MC_EXT_FILENAME}" .dump ;; mo) msgunfmt "${MC_EXT_FILENAME}" || \ cat "${MC_EXT_FILENAME}" ;; lyx) lyxcat "${MC_EXT_FILENAME}" ;; torrent) ctorrent -x "${MC_EXT_FILENAME}" 2>/dev/null ;; javaclass) jad -p "${MC_EXT_FILENAME}" 2>/dev/null ;; *) ;; esac } do_open_action() { filetype=$1 case "${filetype}" in dbf) dbview "${MC_EXT_FILENAME}" ;; sqlite) sqlite3 "${MC_EXT_FILENAME}" ;; glade) if glade-3 --version >/dev/null 2>&1; then (glade-3 "${MC_EXT_FILENAME}" >/dev/null 2>&1 &) else (glade-2 "${MC_EXT_FILENAME}" >/dev/null 2>&1 &) fi ;; po) (poedit "${MC_EXT_FILENAME}" >/dev/null 2>&1 &) ;; lyx) lyx "${MC_EXT_FILENAME}" ;; *) ;; esac } case "${action}" in view) do_view_action "${filetype}" ;; open) ("${MC_XDG_OPEN}" "${MC_EXT_FILENAME}" >/dev/null 2>&1) || \ do_open_action "${filetype}" ;; *) ;; esac PK!\ ext.d/text.shnuȯ#!/bin/sh # $1 - action # $2 - type of archive # $3 - pager action=$1 filetype=$2 pager=$3 [ -n "${MC_XDG_OPEN}" ] || MC_XDG_OPEN="xdg-open" get_unpacker() { filetype=$1 case "${filetype}" in man.gz) unpacker="gzip -dc" ;; man.bz) unpacker="bzip -dc" ;; man.bz2) unpacker="bzip2 -dc" ;; man.lz) unpacker="lzip -dc" ;; man.lz4) unpacker="lz4 -dc" ;; man.lzma) unpacker="lzma -dc" ;; man.xz) unpacker="xz -dc" ;; esac echo ${unpacker} } do_view_action() { filetype=$1 unpacker=`get_unpacker ${filetype}` case "${filetype}" in man) case "${MC_EXT_FILENAME}" in */log/*|*/logs/*) cat "${MC_EXT_FILENAME}" ;; *) MANROFFOPT=-c MAN_KEEP_FORMATTING=1 man -P cat "${MC_EXT_FILENAME}" ;; esac ;; pod) pod2man "${MC_EXT_FILENAME}" | nroff -c -Tlatin1 -mandoc ;; nroff.me) nroff -c -Tlatin1 -me "${MC_EXT_FILENAME}" ;; nroff.ms) nroff -c -Tlatin1 -ms "${MC_EXT_FILENAME}" ;; man.gz|man.bz|man.bz2|man.lz|man.lz4|man.lzma|man.xz) case "${MC_EXT_FILENAME}" in */log/*|*/logs/*) ${unpacker} "${MC_EXT_FILENAME}" ;; *) # "man" takes care of uncompressing. # This way the stdin is left intact so the correct width is used. MANROFFOPT=-c MAN_KEEP_FORMATTING=1 man -P cat "${MC_EXT_FILENAME}" ;; esac ;; *) ;; esac } do_open_action() { filetype=$1 pager=$2 unpacker=`get_unpacker ${filetype}` case "${filetype}" in info) info -f "${MC_EXT_FILENAME}" ;; man) case "${MC_EXT_FILENAME}" in */log/*|*/logs/*) cat "${MC_EXT_FILENAME}" ;; *) { zsoelim "${MC_EXT_FILENAME}" 2>/dev/null || cat "${MC_EXT_FILENAME}"; } | \ nroff -c -Tlatin1 -mandoc ;; esac | ${pager} ;; pod) pod2man "${MC_EXT_FILENAME}" | nroff -c -Tlatin1 -mandoc | ${pager} ;; nroff.me) nroff -c -Tlatin1 -me "${MC_EXT_FILENAME}" | ${pager} ;; nroff.ms) nroff -c -Tlatin1 -ms "${MC_EXT_FILENAME}" | ${pager} ;; man.gz|man.bz|man.bz2|man.lz|man.lz4|man.lzma|man.xz) case "${MC_EXT_FILENAME}" in */log/*|*/logs/*) ${unpacker} "${MC_EXT_FILENAME}" ;; *) ${unpacker} "${MC_EXT_FILENAME}" | nroff -c -Tlatin1 -mandoc ;; esac | ${pager} ;; chm) if [ -n "$DISPLAY" ]; then which kchmviewer > /dev/null 2>&1 \ && (kchmviewer "${MC_EXT_FILENAME}" &) \ || (xchm "${MC_EXT_FILENAME}" &) else chm_http "${MC_EXT_FILENAME}" & elinks http://localhost:8080/index.html kill -INT %1 fi ;; *) ;; esac } case "${action}" in view) do_view_action "${filetype}" ;; open) ("${MC_XDG_OPEN}" "${MC_EXT_FILENAME}" >/dev/null 2>&1) || \ do_open_action "${filetype}" "${pager}" ;; *) ;; esac PK!lkkext.d/image.shnuȯ#!/bin/sh # $1 - action # $2 - type of file action=$1 filetype=$2 [ -n "${MC_XDG_OPEN}" ] || MC_XDG_OPEN="xdg-open" do_view_action() { filetype=$1 case "${filetype}" in jpeg) identify "${MC_EXT_FILENAME}" which exif >/dev/null 2>&1 && exif "${MC_EXT_FILENAME}" 2>/dev/null ;; xpm) sxpm "${MC_EXT_FILENAME}" ;; *) identify "${MC_EXT_FILENAME}" ;; esac } do_open_action() { filetype=$1 case "${filetype}" in xbm) (bitmap "${MC_EXT_FILENAME}" &) ;; xcf) (gimp "${MC_EXT_FILENAME}" &) ;; svg) (inkscape "${MC_EXT_FILENAME}" &) ;; *) if [ -n "$DISPLAY" ]; then (gqview "${MC_EXT_FILENAME}" &) elif see >/dev/null 2>&1; then (see "${MC_EXT_FILENAME}" &) else (zgv "${MC_EXT_FILENAME}" &) fi ;; esac } case "${action}" in view) do_view_action "${filetype}" ;; open) ("${MC_XDG_OPEN}" "${MC_EXT_FILENAME}" >/dev/null 2>&1) || \ do_open_action "${filetype}" ;; *) ;; esac PK!pQext.d/archive.shnuȯ#!/bin/sh # $1 - action # $2 - type of file # $3 - pager action=$1 filetype=$2 pager=$3 [ -n "${MC_XDG_OPEN}" ] || MC_XDG_OPEN="xdg-open" do_view_action() { filetype=$1 case "${filetype}" in gz) gzip -dc "${MC_EXT_FILENAME}" 2>/dev/null ;; bz2) bzip2 -dc "${MC_EXT_FILENAME}" 2>/dev/null ;; bzip) bzip2 -dc "${MC_EXT_FILENAME}" 2>/dev/null ;; lz) lzip -dc "${MC_EXT_FILENAME}" 2>/dev/null ;; lz4) lz4 -dc "${MC_EXT_FILENAME}" 2>/dev/null ;; lzma) lzma -dc "${MC_EXT_FILENAME}" 2>/dev/null ;; xz) xz -dc "${MC_EXT_FILENAME}" 2>/dev/null ;; tar) tar tvvf - < "${MC_EXT_FILENAME}" ;; tar.gz|tar.qpr) gzip -dc "${MC_EXT_FILENAME}" 2>/dev/null | \ tar tvvf - ;; tar.bzip) bzip -dc "${MC_EXT_FILENAME}" 2>/dev/null | \ tar tvvf - ;; tar.bzip2) bzip2 -dc "${MC_EXT_FILENAME}" 2>/dev/null | \ tar tvvf - ;; tar.lz) lzip -dc "${MC_EXT_FILENAME}" 2>/dev/null | \ tar tvvf - ;; tar.lz4) lz4 -dc "${MC_EXT_FILENAME}" 2>/dev/null | \ tar tvvf - ;; tar.lzma) lzma -dc "${MC_EXT_FILENAME}" 2>/dev/null | \ tar tvvf - ;; tar.xz) xz -dc "${MC_EXT_FILENAME}" 2>/dev/null | \ tar tvvf - ;; tar.F) freeze -dc "${MC_EXT_FILENAME}" 2>/dev/null | \ tar tvvf - ;; lha) lha l "${MC_EXT_FILENAME}" ;; arj) arj l "${MC_EXT_FILENAME}" 2>/dev/null || \ unarj l "${MC_EXT_FILENAME}" ;; cab) cabextract -l "${MC_EXT_FILENAME}" ;; ha) ha lf "${MC_EXT_FILENAME}" ;; rar) rar v -c- "${MC_EXT_FILENAME}" 2>/dev/null || \ unrar v -c- "${MC_EXT_FILENAME}" ;; alz) unalz -l "${MC_EXT_FILENAME}" ;; cpio.z|cpio.gz) gzip -dc "${MC_EXT_FILENAME}" | \ cpio -itv 2>/dev/null ;; cpio.lz) lzip -dc "${MC_EXT_FILENAME}" | \ cpio -itv 2>/dev/null ;; cpio.lz4) lz4 -dc "${MC_EXT_FILENAME}" | \ cpio -itv 2>/dev/null ;; cpio.xz) xz -dc "${MC_EXT_FILENAME}" | \ cpio -itv 2>/dev/null ;; cpio) cpio -itv < "${MC_EXT_FILENAME}" 2>/dev/null ;; 7z) 7za l "${MC_EXT_FILENAME}" 2>/dev/null || 7z l "${MC_EXT_FILENAME}" ;; ace) unace l "${MC_EXT_FILENAME}" ;; arc) arc l "${MC_EXT_FILENAME}" ;; zip) unzip -v "${MC_EXT_FILENAME}" ;; zoo) zoo l "${MC_EXT_FILENAME}" ;; *) ;; esac } do_open_action() { filetype=$1 pager=$2 case "${filetype}" in bzip2) bzip2 -dc "${MC_EXT_FILENAME}" | ${pager} ;; bzip) bzip -dc "${MC_EXT_FILENAME}" | ${pager} ;; gz) gz -dc "${MC_EXT_FILENAME}" | ${pager} ;; lz) lzip -dc "${MC_EXT_FILENAME}" | ${pager} ;; lz4) lz4 -dc "${MC_EXT_FILENAME}" | ${pager} ;; lzma) lzma -dc "${MC_EXT_FILENAME}" | ${pager} ;; xz) xz -dc "${MC_EXT_FILENAME}" | ${pager} ;; par2) par2 r "${MC_EXT_FILENAME}" ;; *) ;; esac } case "${action}" in view) do_view_action "${filetype}" ;; open) ("${MC_XDG_OPEN}" "${MC_EXT_FILENAME}" >/dev/null 2>&1) || \ do_open_action "${filetype}" "${pager}" ;; *) ;; esac PK!55 ext.d/web.shnuȯ#!/bin/sh # $1 - action # $2 - type of file action=$1 filetype=$2 [ -n "${MC_XDG_OPEN}" ] || MC_XDG_OPEN="xdg-open" do_view_action() { filetype=$1 case "${filetype}" in html) links -dump "${MC_EXT_FILENAME}" 2>/dev/null || \ w3m -dump "${MC_EXT_FILENAME}" 2>/dev/null || \ lynx -dump -force_html "${MC_EXT_FILENAME}" ;; *) ;; esac } do_open_action() { filetype=$1 case "${filetype}" in html) (if [ -n "" -a -n "$DISPLAY" ]; then ( file://"${MC_EXT_CURRENTDIR}"/"${MC_EXT_BASENAME}" &) 1>&2 else elinks "${MC_EXT_FILENAME}" || \ links "${MC_EXT_FILENAME}" || \ lynx -force_html "${MC_EXT_FILENAME}" || \ ${PAGER:-more} "${MC_EXT_FILENAME}" fi) 2>/dev/null ;; *) ;; esac } case "${action}" in view) do_view_action "${filetype}" ;; open) ("${MC_XDG_OPEN}" "${MC_EXT_FILENAME}" >/dev/null 2>&1) || \ do_open_action "${filetype}" ;; *) ;; esac PK!||ext.d/sound.shnuȯ#!/bin/sh # $1 - action # $2 - type of file action=$1 filetype=$2 [ -n "${MC_XDG_OPEN}" ] || MC_XDG_OPEN="xdg-open" do_view_action() { filetype=$1 case "${filetype}" in mp3) mpg123 -vtn1 "${MC_EXT_FILENAME}" 2>&1 | \ sed -n '/^Title/,/^Comment/p;/^MPEG/,/^Audio/p' ;; ogg) ogginfo "${MC_EXT_FILENAME}" ;; wma) mplayer -quiet -slave -frames 0 -vo null -ao null -identify "${MC_EXT_FILENAME}" 2>/dev/null | \ tail +13 || file "${MC_EXT_FILENAME}" ;; *) cat "${MC_EXT_FILENAME}" ;; esac } do_open_action() { filetype=$1 case "${filetype}" in common) if [ -n "$DISPLAY" ]; then (xmms "${MC_EXT_FILENAME}" >/dev/null 2>&1 &) else play "${MC_EXT_FILENAME}" fi ;; mod) mikmod "${MC_EXT_FILENAME}" #tracker "${MC_EXT_FILENAME}" ;; wav22) vplay -s 22 "${MC_EXT_FILENAME}" ;; mp3) if [ -n "$DISPLAY" ]; then (xmms "${MC_EXT_FILENAME}" >/dev/null 2>&1 &) else mpg123 "${MC_EXT_FILENAME}" fi ;; ogg) if [ -n "$DISPLAY" ]; then (xmms "${MC_EXT_FILENAME}" >/dev/null 2>&1 &) else ogg123 "${MC_EXT_FILENAME}" fi ;; midi) timidity "${MC_EXT_FILENAME}" ;; wma) mplayer -vo null "${MC_EXT_FILENAME}" ;; playlist) if [ -n "$DISPLAY" ]; then (xmms -p "${MC_EXT_FILENAME}" >/dev/null 2>&1 &) else mplayer -vo null -playlist "${MC_EXT_FILENAME}" fi ;; *) ;; esac } case "${action}" in view) do_view_action "${filetype}" ;; open) ("${MC_XDG_OPEN}" "${MC_EXT_FILENAME}" >/dev/null 2>&1) || \ do_open_action "${filetype}" ;; *) ;; esac PK!dv\\ext.d/package.shnuȯ#!/bin/sh # $1 - action # $2 - type of file action=$1 filetype=$2 [ -n "${MC_XDG_OPEN}" ] || MC_XDG_OPEN="xdg-open" do_view_action() { filetype=$1 case "${filetype}" in trpm) rpm -qivl --scripts `basename "${MC_EXT_BASENAME}" .trpm` ;; src.rpm|rpm) if rpm --nosignature --version >/dev/null 2>&1; then RPM="rpm --nosignature" else RPM="rpm" fi $RPM -qivlp --scripts "${MC_EXT_FILENAME}" ;; deb) dpkg-deb -I "${MC_EXT_FILENAME}" && echo && dpkg-deb -c "${MC_EXT_FILENAME}" ;; debd) dpkg -s `echo "${MC_EXT_BASENAME}" | sed 's/\([0-9a-z.-]*\).*/\1/'` ;; deba) apt-cache show `echo "${MC_EXT_BASENAME}" | sed 's/\([0-9a-z.-]*\).*/\1/'` ;; *) ;; esac } do_open_action() { filetype=$1 case "${filetype}" in *) ;; esac } case "${action}" in view) do_view_action "${filetype}" ;; open) ("${MC_XDG_OPEN}" "${MC_EXT_FILENAME}" >/dev/null 2>&1) || \ do_open_action "${filetype}" ;; *) ;; esac PK!.(mc-wrapper.cshnu[set MC_USER="`id | sed 's/[^(]*(//;s/).*//'`" if ($?TMPDIR) then setenv MC_PWD_FILE $TMPDIR/mc-$MC_USER/mc.pwd.$$ else setenv MC_PWD_FILE /var/tmp/mc-$MC_USER/mc.pwd.$$ endif /usr/bin/mc -P "$MC_PWD_FILE" $* if (-r "$MC_PWD_FILE") then setenv MC_PWD "`cat '$MC_PWD_FILE'`" if ( -d "$MC_PWD" ) then cd "$MC_PWD" endif unsetenv MC_PWD endif rm -f "$MC_PWD_FILE" unsetenv MC_PWD_FILE unsetenv MC_USER PK!TGZ{  extfs.d/changesetfsnuȯ#!/bin/sh LANG=C export LANG LC_TIME=C export LC_TIME # --- GIT ----------------------------------------------------------------------- found_git_dir() { work_dir=$1 while [ -n "$work_dir" -a "$work_dir" != "/" ]; do [ -d "${work_dir}/.git" ] && { echo "${work_dir}/.git/" return } work_dir=`dirname "$work_dir"` done echo '' } changesetfs_list_git() { WORK_DIR=$1; shift fname=$1; shift USER=$1; shift DATE=$1; shift GIT_DIR=`found_git_dir "$WORK_DIR"` [ -z "$GIT_DIR" ] && GIT_DIR=$WORK_DIR curr_year=`date +"%Y"` git --git-dir="$GIT_DIR" log --abbrev=7 --pretty="format:%at %h %an" -- "$fname" | while read TIMESTAMP chset author do year=`date -d @"$TIMESTAMP" +"%Y"` [ "$year" = "$curr_year" ] && { DATE=`date -d @"$TIMESTAMP" +"%b %d %H:%M"` } || { DATE=`date -d @"$TIMESTAMP" +"%b %d %Y"` } NAME="$chset $author" echo "-rw-rw-rw- 1 $USER 0 0 $DATE $NAME `basename $fname`" done } changesetfs_copyout_git() { WORK_DIR=$1; shift fname=$1; shift orig_fname=$1;shift output_fname=$1;shift chset=`echo "$orig_fname"| cut -f 1 -d " "` GIT_DIR=`found_git_dir "$WORK_DIR"` [ -z "$GIT_DIR" ] && GIT_DIR=$WORK_DIR filecommit=`git --git-dir="$GIT_DIR" show --raw --pretty=tformat:%h "$chset" -- "$fname"| \ tail -n1 | \ sed 's@^::[0-9]*\s*[0-9]*\s*[0-9]*\s*@@' | \ sed 's@^:[0-9]*\s*[0-9]*\s*@@' | \ cut -d'.' -f 1` git --git-dir="$GIT_DIR" show "$filecommit" > "$output_fname" } # --- COMMON -------------------------------------------------------------------- changesetfs_list() { VCS_type=$1; shift WORK_DIR=$1; shift fname=$1; shift DATE=`date +"%b %d %H:%M"` USER=`whoami` case "$VCS_type" in git) changesetfs_list_git "$WORK_DIR" "$fname" "$USER" "$DATE" ;; esac } changesetfs_copyout() { VCS_type=$1; shift WORK_DIR=$1; shift fname=$1; shift case "$VCS_type" in git) changesetfs_copyout_git "$WORK_DIR" "$fname" "$@" ;; esac } # --- MAIN ---------------------------------------------------------------------- command=$1; shift tmp_file=$1; shift WORK_DIR=`head -n1 $tmp_file` fname=`tail -n2 $tmp_file | head -n1` VCS_type=`tail -n1 $tmp_file` case "$command" in list) changesetfs_list "$VCS_type" "$WORK_DIR" "$fname" ;; copyout) changesetfs_copyout "$VCS_type" "$WORK_DIR" "$fname" "$@" ;; *) exit 1 ;; esac exit 0 PK! :nnextfs.d/README.extfsnu[# Each external VFS type must be registered in extfs.d directory if you want to use it. # Trailing plus means that the filesystem is not tied to a certain file. # Popular PC archivers uzip uzoo ulha urar uha u7z ualz # FIXME: for arj usage you need a special patch to unarj (see unarj.diff) uarj uarc uace # For cab files ucab # 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+ # Commodore 64/128 d64/D64 files uc1541 # 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 # Amazon S3 s3+ # git frontend gitfs - browse the git repo changesetfs - list of versions of current file patchsetfs - list of patches of current file # Gputils lib archives. ulib PK!Yzz extfs.d/urarnuȯ#! /bin/sh # # Written by andrey joukov # (C) 1996 2:5020/337.13@fidonet.org # Updated by christian.gennerat@alcatel.fr 1999 # Andrew V. Samoilov 2000 # # Andrew Borodin # David Haller # 2013: support unrar5 # # beta version 2.0 # # rar and unrar can be found on http://www.rarlabs.com/ RAR=rar # Prefer unrar (freeware). UNRAR=`which unrar 2>/dev/null` [ -z $UNRAR ] && UNRAR=$RAR [ ! -x $UNRAR -a -x $RAR ] && UNRAR=$RAR # Let the test framework hook in: UNRAR=${MC_TEST_EXTFS_LIST_CMD:-$UNRAR} # Determine the $UNRAR version if [ -n "$MC_TEST_EXTFS_UNRAR_VERSION" ]; then # Let the test framework fool us: UNRAR_VERSION=$MC_TEST_EXTFS_UNRAR_VERSION else # Figure it out from rar itself: UNRAR_VERSION=`$UNRAR -cfg- -? | grep "Copyright" | sed -e 's/.*\([0-9]\)\..*/\1/'` fi mcrar4fs_list () { $UNRAR v -c- -cfg- "$1" | gawk -v uid=`id -u` -v gid=`id -g` ' BEGIN { flag=0 } /^-------/ { flag++; if (flag > 1) exit 0; next } flag==1 { str = substr($0, 2) getline split($4, a, "-") if (index($6, "D") != 0) $6="drwxr-xr-x" else if (index($6, ".") != 0) $6="-rw-r--r--" printf "%s 1 %s %s %d %02d/%02d/%02d %s ./%s\n", $6, uid, gid, $1, a[2], a[1], a[3], $5, str }' } mcrar5fs_list () { $UNRAR vt -c- -cfg- "$1" | gawk -F ':' -v uid=`id -u` -v gid=`id -g` ' { ### remove space after the ":" of the field name sub ("^ ", "", $2); } $1 ~ /^ *Name$/ { ### next file name = mtime = size = attrs = ""; delete date; name = $2; ### if the name contains ":", append the rest of the fields if (NF > 2) { for (i = 3; i <= NF; i++) { name = name ":" $i; } } } $1 ~ /^ *mtime$/ { mtime = $2 ":" $3; } $1 ~ /^ *Size$/ { size = $2; } $1 ~ /^ *Attributes$/ { attrs = $2; } $1 ~ /^ *Compression$/ { ### file done, using /^$/ is not so good you ### would have to skip the version stuff first ### get date and time split (mtime, date, " "); time = date[2]; ### cut off seconds from the time sub (",[0-9]*$", "", time); ### split for reordering of the date in the printf below split (date[1], date, "-"); ### mc seems to be able to parse 4 digit years too, so remove if tested # sub ("^..", "", date[1]); ### cut year to 2 digits only ### check/adjust rights if (index (attrs, "D") != 0) { attrs = "drwxr-xr-x"; } else { if (index (attrs, ".") != 0) { attrs = "-rw-r--r--"; } } ### and finally printf ("%s 1 %s %s %d %02d/%02d/%02d %s ./%s\n", attrs, uid, gid, size, date[2], date[3], date[1], time, name); } ' } mcrarfs_list () { [ x$UNRAR_VERSION = x5 ] && mcrar5fs_list "$@" || mcrar4fs_list "$@" } mcrarfs_copyin () { # copyin by christian.gennerat@alcatel.fr # preserve pwd. It is clean, but is it necessary? pwd=`pwd` # Create a directory and copy in it the tmp file with the good name mkdir "$3.dir" cd "$3.dir" di="${2%/*}" # if file is to be written upper in the archive tree, make fake dir if test x"$di" != x"${2##*/}" ; then mkdir -p "$di" fi cp -fp "$3" "$3.dir/$2" $RAR a "$1" "$2" >/dev/null cd "$pwd" rm -rf "$3.dir" } mcrarfs_copyout () { $UNRAR p -p- -c- -cfg- -inul "$1" "$2" > "$3" } mcrarfs_mkdir () { # preserve pwd. It is clean, but is it necessary? pwd=`pwd` # Create a directory and create in it a tmp directory with the good name dir=`mktemp -d "${MC_TMPDIR:-/tmp}/mctmpdir-urar.XXXXXX"` || exit 1 cd "$dir" mkdir -p "$2" # rar cannot create an empty directory touch "$2"/.rarfs $RAR a -r "$1" "$2" >/dev/null $RAR d "$1" "$2/.rarfs" >/dev/null cd "$pwd" rm -rf "$dir" } mcrarfs_rm () { $RAR d "$1" "$2" >/dev/null } umask 077 cmd="$1" shift case "$cmd" in # Workaround for a bug in mc - directories must precede files to # avoid duplicate entries, so we sort output by filenames list) mcrarfs_list "$@" | sort -k 8 ;; rm) mcrarfs_rm "$@" ;; rmdir) mcrarfs_rm "$@" ;; mkdir) mcrarfs_mkdir "$@" ;; copyin) mcrarfs_copyin "$@" ;; copyout) mcrarfs_copyout "$@" ;; *) exit 1 ;; esac exit 0 PK!a extfs.d/uacenuȯ#! /bin/sh # # ACE Virtual filesystem executive v0.1 # Works with unace v2.5 # Note: There are two packages for Debian: 'unace' (v1.2b) and # 'unace-nonfree' (v2.x). This script supports 'unace-nonfree' only. # 'unace', which supports only old versions of ACE archives (and is # therefore of little use), uses the pipe character to separate columns # in its listing format. # Copyright (C) 2008 Jacques Pelletier # May be distributed under the terms of the GNU Public License # # # Define which archiver you are using with appropriate options ACE_LIST=${MC_TEST_EXTFS_LIST_CMD:-"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() { if [ "x$UID" = "x" ]; then UID=`id -ru 2>/dev/null` if [ "x$UID" = "x" ]; then UID=0 fi fi $ACE_LIST "$1" | gawk -v uid=$UID ' /%/ { 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 %02d-%02d-%04d %s %s\n", uid, 0, $4, date[2], 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 PK!~*(( extfs.d/audionuȯ#! /bin/sh # # Written by Pavel Machek # CDDB support by Adam Byrtek # # (C) 2000 The Free Software Foundation. # set -e CDDB_SERVER="http://freedb.freedb.org" CDDB_HANDSHAKE="hello=user+localhost+mc+1.0&proto=1" CDDB_TIMEOUT=20 # in seconds audiofs_list() { DATE=`date +"%b %d %H:%M"` echo "-r--r--r-- 1 0 0 0 $DATE CDDB" cdparanoia -Q -d "$1" 2>&1 | grep '^[ 0-9][ 0-9][ 0-9]\.' | while read A B C do A=`echo "$A" | sed -e 's/\.//' -e 's/^\(.\)$/0\1/'` SIZE=`expr 44 + $B \* 2352` echo "-r--r--r-- 1 0 0 $SIZE $DATE track-${A}.wav" done } audiofs_copyout() { if [ x"$2" = x"CDDB" ]; then DISCID=`cd-discid "$1" | tr " " "+"` if [ -z "$DISCID" ]; then exit 1 fi RESPONSE=`wget -q -T $CDDB_TIMEOUT -O - "$CDDB_SERVER/~cddb/cddb.cgi?cmd=cddb+query+$DISCID&$CDDB_HANDSHAKE" | tee "$3" | gawk '/^200/ { print $2,$3; }'` wget -q -T $CDDB_TIMEOUT -O - "$CDDB_SERVER/~cddb/cddb.cgi?cmd=cddb+read+$RESPONSE&$CDDB_HANDSHAKE" | grep -v "^#" >> "$3" else TRACK=`echo "$2" | sed 's/track-0*//' | sed 's/\.wav//'` cdparanoia -q -d "$1" "$TRACK" "$3" >/dev/null fi } if [ ! -b "$2" ] then BASE="/dev/cdrom" else BASE="$2" fi case "$1" in list) audiofs_list "$BASE"; exit 0;; copyout) audiofs_copyout "$BASE" "$3" "$4"; exit 0;; esac exit 1 PK!A?0  extfs.d/patchsetfsnuȯ#!/bin/sh LANG=C export LANG LC_TIME=C export LC_TIME # --- GIT ----------------------------------------------------------------------- found_git_dir() { work_dir=$1 while [ -n "$work_dir" -a "$work_dir" != "/" ]; do [ -d "${work_dir}/.git" ] && { echo "${work_dir}/.git/" return } work_dir=`dirname "$work_dir"` done echo '' } patchsetfs_list_git() { WORK_DIR=$1; shift fname=$1; shift USER=$1; shift DATE=$1; shift GIT_DIR=`found_git_dir "$WORK_DIR"` [ -z "$GIT_DIR" ] && GIT_DIR=$WORK_DIR curr_year=`date +"%Y"` git --git-dir="$GIT_DIR" log --abbrev=7 --pretty="format:%at %h %an" -- "$fname" | while read TIMESTAMP chset author do year=`date -d @"$TIMESTAMP" +"%Y"` [ "$year" = "$curr_year" ] && { DATE=`date -d @"$TIMESTAMP" +"%b %d %H:%M"` } || { DATE=`date -d @"$TIMESTAMP" +"%b %d %Y"` } NAME="$chset $author" echo "-rw-rw-rw- 1 $USER 0 0 $DATE $NAME.diff" done } patchsetfs_copyout_git() { WORK_DIR=$1; shift fname=$1; shift orig_fname=$1;shift output_fname=$1;shift chset=`echo "$orig_fname"| cut -f 1 -d " "` GIT_DIR=`found_git_dir "$WORK_DIR"` [ -z "$GIT_DIR" ] && GIT_DIR=$WORK_DIR git --git-dir="$GIT_DIR" show "$chset" -- "$fname" > "$output_fname" } # --- COMMON -------------------------------------------------------------------- patchsetfs_list() { VCS_type=$1; shift WORK_DIR=$1; shift fname=$1; shift DATE=`date +"%b %d %H:%M"` USER=`whoami` case "$VCS_type" in git) patchsetfs_list_git "$WORK_DIR" "$fname" "$USER" "$DATE" ;; esac } patchsetfs_copyout() { VCS_type=$1; shift WORK_DIR=$1; shift fname=$1; shift case "$VCS_type" in git) patchsetfs_copyout_git "$WORK_DIR" "$fname" "$@" ;; esac } # --- MAIN ---------------------------------------------------------------------- command=$1; shift tmp_file=$1; shift WORK_DIR=`head -n1 $tmp_file` fname=`tail -n2 $tmp_file | head -n1` VCS_type=`tail -n1 $tmp_file` case "$command" in list) patchsetfs_list "$VCS_type" "$WORK_DIR" "$fname" ;; copyout) patchsetfs_copyout "$VCS_type" "$WORK_DIR" "$fname" "$@" ;; *) exit 1 ;; esac exit 0 PK!E;r@55 extfs.d/rpmnuȯ#! /bin/sh # VFS-wrapper for RPM (and src.rpm) files # # Copyright (C) 1996-2004,2009 # Free Software Foundation, Inc. # # Written by # Erik Troan 1996 # Jakub Jelinek 1996, 2004 # Tomasz Kłoczko 1997 # Wojtek Pilorz # 1997: minor changes # Michele Marziani # 1997: minor changes # Marc Merlin 1998 # 1998: bug files # Michal Svec 2000 # 2000: locale bugfix # Andrew V. Samoilov # 2004: Whitespace(s) & single quote(s) in filename workaround # https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=64007 # Slava Zanko # 2009: Totally rewritten. # Alexander Chumachenko # 2013: add dependency version output # Denis Silakov # 2013: tar payload support. # Arkadiusz Miśkiewicz # 2013: improve support for EPOCH # add support for PREINPROG/POSTINPROG/PREUNPROG/POSTUNPROG # add support for VERIFYSCRIPTPROG # add support for TRIGGERSCRIPTS/TRIGGERSCRIPTPROG # Jiri Tyr # 2016: add support for PRETRANS/PRETRANSPROG/POSTTRANS/POSTTRANSPROG # # This file is part of the Midnight Commander. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # override any locale for dates unset LC_ALL LC_TIME=C export LC_TIME if rpmbuild --version >/dev/null 2>&1; then RPMBUILD="rpmbuild" else RPMBUILD="rpm" fi if rpm --nosignature --version >/dev/null 2>&1; then RPM="rpm --nosignature" RPMBUILD="$RPMBUILD --nosignature" else RPM="rpm" fi RPM_QUERY_FMT="$RPM -qp --qf" RPM2CPIO="rpm2cpio" SED="sed" param=$1; shift rpm_filename=$1; shift FILEPREF="-r--r--r-- 1 root root " mcrpmfs_getSupportedTags() { rpm --querytags } mcrpmfs_getDesription() { $RPM -qip "${rpm_filename}" } mcrpmfs_getAllNeededTags() { supportedTags=`mcrpmfs_getSupportedTags` if test "`echo supportedTags | grep -c CONFLICTS`" -eq 1; then tag_CONFLICTS="|CONFLICTS=%{CONFLICTS}" else tag_CONFLICTS="" fi $RPM_QUERY_FMT \ "|NAME=%{NAME}"\ "|VERSION=%{VERSION}"\ "|RELEASE=%{RELEASE}"\ "|DISTRIBUTION=%{DISTRIBUTION}"\ "|VENDOR=%{VENDOR}"\ "|DESCRIPTION=%{DESCRIPTION}"\ "|SUMMARY=%{SUMMARY}"\ "|URL=%{URL}"\ "|EPOCH=%{EPOCH}"\ "|LICENSE=%{LICENSE}"\ "|REQUIRES=%{REQUIRENAME} %{REQUIREFLAGS:depflags} %{REQUIREVERSION}"\ "|OBSOLETES=%{OBSOLETES}"\ "|PROVIDES=%{PROVIDES} %{PROVIDEFLAGS:depflags} %{PROVIDEVERSION}"\ ${tag_CONFLICTS}\ "|PACKAGER=%{PACKAGER}" \ "${rpm_filename}" } mcrpmfs_getRawOneTag() { $RPM_QUERY_FMT "$1" "${rpm_filename}" } mcrpmfs_getOneTag() { echo $AllTAGS | $SED "s/.*|${1}=//" | cut -d '|' -f 1 } mcrpmfs_printOneMetaInfo() { if test "$3" = "raw"; then metaInfo=`mcrpmfs_getRawOneTag "%{$2}"` else metaInfo=`mcrpmfs_getOneTag "$2"` fi if test -n "${metaInfo}" -a "${metaInfo}" != "(none)"; then echo "${FILEPREF} 0 ${DATE} ${1}" return 0 fi return 1 } mcrpmfs_list_fastRPM () { echo "$FILEPREF 0 $DATE INFO/DISTRIBUTION" echo "$FILEPREF 0 $DATE INFO/VENDOR" echo "$FILEPREF 0 $DATE INFO/DESCRIPTION" echo "$FILEPREF 0 $DATE INFO/SUMMARY" echo "dr-xr-xr-x 1 root root 0 $DATE INFO/SCRIPTS" echo "$FILEPREF 0 $DATE INFO/SCRIPTS/PRETRANS" echo "$FILEPREF 0 $DATE INFO/SCRIPTS/POSTTRANS" echo "$FILEPREF 0 $DATE INFO/SCRIPTS/PREIN" echo "$FILEPREF 0 $DATE INFO/SCRIPTS/POSTIN" echo "$FILEPREF 0 $DATE INFO/SCRIPTS/PREUN" echo "$FILEPREF 0 $DATE INFO/SCRIPTS/POSTUN" echo "$FILEPREF 0 $DATE INFO/SCRIPTS/VERIFYSCRIPT" echo "$FILEPREF 0 $DATE INFO/SCRIPTS/TRIGGERSCRIPTS" echo "$FILEPREF 0 $DATE INFO/SCRIPTS/ALL" echo "$FILEPREF 0 $DATE INFO/PACKAGER" echo "$FILEPREF 0 $DATE INFO/URL" echo "$FILEPREF 0 $DATE INFO/EPOCH" echo "$FILEPREF 0 $DATE INFO/LICENSE" echo "$FILEPREF 0 $DATE INFO/REQUIRES" echo "$FILEPREF 0 $DATE INFO/OBSOLETES" echo "$FILEPREF 0 $DATE INFO/PROVIDES" echo "$FILEPREF 0 $DATE INFO/CONFLICTS" echo "$FILEPREF 0 $DATE INFO/CHANGELOG" } mcrpmfs_list_fullRPM () { mcrpmfs_printOneMetaInfo "INFO/DISTRIBUTION" "DISTRIBUTION" mcrpmfs_printOneMetaInfo "INFO/VENDOR" "VENDOR" mcrpmfs_printOneMetaInfo "INFO/DESCRIPTION" "DESCRIPTION" mcrpmfs_printOneMetaInfo "INFO/SUMMARY" "SUMMARY" if test "`mcrpmfs_getRawOneTag \"%{RPMTAG_PRETRANS}%{RPMTAG_POSTTRANS}%{RPMTAG_PREIN}%{RPMTAG_POSTIN}%{RPMTAG_PREUN}%{RPMTAG_POSTUN}%{VERIFYSCRIPT}%{TRIGGERSCRIPTS}\"`" != "(none)(none)(none)(none)(none)(none)(none)(none)"; then mcrpmfs_printOneMetaInfo "INFO/SCRIPTS/PRETRANS" "RPMTAG_PRETRANS" "raw" mcrpmfs_printOneMetaInfo "INFO/SCRIPTS/POSTTRANS" "RPMTAG_POSTTRANS" "raw" mcrpmfs_printOneMetaInfo "INFO/SCRIPTS/PREIN" "RPMTAG_PREIN" "raw" mcrpmfs_printOneMetaInfo "INFO/SCRIPTS/POSTIN" "RPMTAG_POSTIN" "raw" mcrpmfs_printOneMetaInfo "INFO/SCRIPTS/PREUN" "RPMTAG_PREUN" "raw" mcrpmfs_printOneMetaInfo "INFO/SCRIPTS/POSTUN" "RPMTAG_POSTUN" "raw" mcrpmfs_printOneMetaInfo "INFO/SCRIPTS/VERIFYSCRIPT" "VERIFYSCRIPT" "raw" mcrpmfs_printOneMetaInfo "INFO/SCRIPTS/TRIGGERSCRIPTS" "TRIGGERSCRIPTS" "raw" echo "$FILEPREF 0 $DATE INFO/SCRIPTS/ALL" fi if test "`mcrpmfs_getRawOneTag \"%{RPMTAG_PRETRANSPROG}%{RPMTAG_POSTTRANSPROG}%{RPMTAG_PREINPROG}%{RPMTAG_POSTINPROG}%{RPMTAG_PREUNPROG}%{RPMTAG_POSTUNPROG}%{VERIFYSCRIPTPROG}%{TRIGGERSCRIPTPROG}\"`" != "(none)(none)(none)(none)(none)(none)(none)(none)"; then mcrpmfs_printOneMetaInfo "INFO/SCRIPTS/PRETRANSPROG" "RPMTAG_PRETRANSPROG" "raw" mcrpmfs_printOneMetaInfo "INFO/SCRIPTS/POSTTRANSPROG" "RPMTAG_POSTTRANSPROG" "raw" mcrpmfs_printOneMetaInfo "INFO/SCRIPTS/PREINPROG" "RPMTAG_PREINPROG" "raw" mcrpmfs_printOneMetaInfo "INFO/SCRIPTS/POSTINPROG" "RPMTAG_POSTINPROG" "raw" mcrpmfs_printOneMetaInfo "INFO/SCRIPTS/PREUNPROG" "RPMTAG_PREUNPROG" "raw" mcrpmfs_printOneMetaInfo "INFO/SCRIPTS/POSTUNPROG" "RPMTAG_POSTUNPROG" "raw" mcrpmfs_printOneMetaInfo "INFO/SCRIPTS/VERIFYSCRIPTPROG" "VERIFYSCRIPTPROG" "raw" mcrpmfs_printOneMetaInfo "INFO/SCRIPTS/TRIGGERSCRIPTPROG" "TRIGGERSCRIPTPROG" "raw" fi mcrpmfs_printOneMetaInfo "INFO/PACKAGER" "PACKAGER" mcrpmfs_printOneMetaInfo "INFO/URL" "URL" mcrpmfs_printOneMetaInfo "INFO/EPOCH" "EPOCH" mcrpmfs_printOneMetaInfo "INFO/LICENSE" "LICENSE" mcrpmfs_printOneMetaInfo "INFO/REQUIRES" "REQUIRES" mcrpmfs_printOneMetaInfo "INFO/OBSOLETES" "OBSOLETES" mcrpmfs_printOneMetaInfo "INFO/PROVIDES" "PROVIDES" mcrpmfs_printOneMetaInfo "INFO/CONFLICTS" "CONFLICTS" mcrpmfs_printOneMetaInfo "INFO/CHANGELOG" "CHANGELOGTEXT" "raw" } mcrpmfs_list () { # set MCFASTRPM_DFLT to 1 for faster rpm files handling by default, to 0 for # slower handling MCFASTRPM_DFLT=0 if test -z "$MCFASTRPM"; then MCFASTRPM=$MCFASTRPM_DFLT fi DESC=`mcrpmfs_getDesription 2>/dev/null` || { echo "$FILEPREF 0 "`date +"%b %d %H:%M"`" ERROR" exit 1 } DATE=`mcrpmfs_getRawOneTag "%{BUILDTIME:date}\n" | cut -c 5-11,21-24` PAYLOAD=`mcrpmfs_getRawOneTag "%{PAYLOADFORMAT}\n" | sed s/ustar/tar/` HEADERSIZE=`echo "$DESC" | wc -c` printf '%s %s %s HEADER\n' "${FILEPREF}" "${HEADERSIZE}" "${DATE}" echo "-r-xr-xr-x 1 root root 39 $DATE INSTALL" case "${rpm_filename}" in *.src.rpm) echo "-r-xr-xr-x 1 root root 39 $DATE REBUILD" ;; *) echo "-r-xr-xr-x 1 root root 39 $DATE UPGRADE" ;; esac echo "dr-xr-xr-x 3 root root 0 $DATE INFO" if [ `mcrpmfs_getRawOneTag "%{EPOCH}"` = "(none)" ]; then echo "$FILEPREF 0 $DATE INFO/NAME-VERSION-RELEASE" else echo "$FILEPREF 0 $DATE INFO/NAME-EPOCH:VERSION-RELEASE" fi echo "$FILEPREF 0 $DATE INFO/GROUP" echo "$FILEPREF 0 $DATE INFO/BUILDHOST" echo "$FILEPREF 0 $DATE INFO/SOURCERPM" echo "$FILEPREF 0 $DATE INFO/BUILDTIME" echo "$FILEPREF 0 $DATE INFO/RPMVERSION" echo "$FILEPREF 0 $DATE INFO/OS" echo "$FILEPREF 0 $DATE INFO/SIZE" if test "$MCFASTRPM" = 0 ; then mcrpmfs_list_fullRPM else mcrpmfs_list_fastRPM fi echo "$FILEPREF 0 $DATE CONTENTS.$PAYLOAD" } mcrpmfs_copyout () { case "$1" in HEADER) mcrpmfs_getDesription > "$2"; exit 0;; INSTALL) echo "# Run this script to install this RPM package" > "$2" echo $RPM -ivh "${rpm_filename}" >> "$2" exit 0 ;; UPGRADE) echo "# Run this to upgrade this RPM package" > "$2" echo $RPM -Uvh "${rpm_filename}" >> "$2" exit 0 ;; REBUILD) echo "# Run this to rebuild this RPM package" > "$2" echo $RPMBUILD --rebuild "${rpm_filename}" >> "$2" exit 0 ;; ERROR) mcrpmfs_getDesription > /dev/null 2> "$2"; exit 0;; INFO/NAME-VERSION-RELEASE) echo `mcrpmfs_getOneTag "NAME"`-`mcrpmfs_getOneTag "VERSION"`-`mcrpmfs_getOneTag "RELEASE"` > "$2" exit 0 ;; INFO/NAME-EPOCH:VERSION-RELEASE) echo `mcrpmfs_getOneTag "NAME"`-`mcrpmfs_getOneTag "EPOCH"`:`mcrpmfs_getOneTag "VERSION"`-`mcrpmfs_getOneTag "RELEASE"` > "$2" exit 0 ;; INFO/RELEASE) mcrpmfs_getOneTag "RELEASE" > "$2"; exit 0;; INFO/GROUP) mcrpmfs_getRawOneTag "%{GROUP}\n" > "$2"; exit 0;; INFO/DISTRIBUTION) mcrpmfs_getOneTag "DISTRIBUTION" > "$2"; exit 0;; INFO/VENDOR) mcrpmfs_getOneTag "VENDOR" > "$2"; exit 0;; INFO/BUILDHOST) mcrpmfs_getRawOneTag "%{BUILDHOST}\n" > "$2"; exit 0;; INFO/SOURCERPM) mcrpmfs_getRawOneTag "%{SOURCERPM}\n" > "$2"; exit 0;; INFO/DESCRIPTION) mcrpmfs_getRawOneTag "%{DESCRIPTION}\n" > "$2"; exit 0;; INFO/PACKAGER) mcrpmfs_getOneTag "PACKAGER" > "$2"; exit 0;; INFO/URL) mcrpmfs_getOneTag "URL" >"$2"; exit 0;; INFO/BUILDTIME) mcrpmfs_getRawOneTag "%{BUILDTIME:date}\n" >"$2"; exit 0;; INFO/EPOCH) mcrpmfs_getOneTag "EPOCH" >"$2"; exit 0;; INFO/LICENSE) mcrpmfs_getOneTag "LICENSE" >"$2"; exit 0;; INFO/RPMVERSION) mcrpmfs_getRawOneTag "%{RPMVERSION}\n" >"$2"; exit 0;; INFO/REQUIRES) mcrpmfs_getRawOneTag "[%{REQUIRENAME} %{REQUIREFLAGS:depflags} %{REQUIREVERSION}\n]" >"$2"; exit 0;; INFO/PROVIDES) mcrpmfs_getRawOneTag "[%{PROVIDES} %{PROVIDEFLAGS:depflags} %{PROVIDEVERSION}\n]" >"$2"; exit 0;; INFO/SCRIPTS/PRETRANS) mcrpmfs_getRawOneTag "%{RPMTAG_PRETRANS}\n" >"$2"; exit 0;; INFO/SCRIPTS/PRETRANSPROG) mcrpmfs_getRawOneTag "%{RPMTAG_PRETRANSPROG}\n" >"$2"; exit 0;; INFO/SCRIPTS/POSTTRANS) mcrpmfs_getRawOneTag "%{RPMTAG_POSTTRANS}\n" >"$2"; exit 0;; INFO/SCRIPTS/POSTTRANSPROG) mcrpmfs_getRawOneTag "%{RPMTAG_POSTTRANSPROG}\n" >"$2"; exit 0;; INFO/SCRIPTS/PREIN) mcrpmfs_getRawOneTag "%{RPMTAG_PREIN}\n" >"$2"; exit 0;; INFO/SCRIPTS/PREINPROG) mcrpmfs_getRawOneTag "%{RPMTAG_PREINPROG}\n" >"$2"; exit 0;; INFO/SCRIPTS/POSTIN) mcrpmfs_getRawOneTag "%{RPMTAG_POSTIN}\n" >"$2"; exit 0;; INFO/SCRIPTS/POSTINPROG) mcrpmfs_getRawOneTag "%{RPMTAG_POSTINPROG}\n" >"$2"; exit 0;; INFO/SCRIPTS/PREUN) mcrpmfs_getRawOneTag "%{RPMTAG_PREUN}\n" >"$2"; exit 0;; INFO/SCRIPTS/PREUNPROG) mcrpmfs_getRawOneTag "%{RPMTAG_PREUNPROG}\n" >"$2"; exit 0;; INFO/SCRIPTS/POSTUN) mcrpmfs_getRawOneTag "%{RPMTAG_POSTUN}\n" >"$2"; exit 0;; INFO/SCRIPTS/POSTUNPROG) mcrpmfs_getRawOneTag "%{RPMTAG_POSTUNPROG}\n" >"$2"; exit 0;; INFO/SCRIPTS/VERIFYSCRIPT) mcrpmfs_getRawOneTag "%{VERIFYSCRIPT}\n" > "$2"; exit 0;; INFO/SCRIPTS/VERIFYSCRIPTPROG) mcrpmfs_getRawOneTag "%{VERIFYSCRIPTPROG}\n" > "$2"; exit 0;; INFO/SCRIPTS/TRIGGERSCRIPTS) $RPM -qp --triggers "${rpm_filename}" > "$2"; exit 0;; INFO/SCRIPTS/TRIGGERSCRIPTPROG) mcrpmfs_getRawOneTag "%{TRIGGERSCRIPTPROG}\n" > "$2"; exit 0;; INFO/SCRIPTS/ALL) $RPM -qp --scripts "${rpm_filename}" > "$2"; exit 0;; INFO/SUMMARY) mcrpmfs_getRawOneTag "%{SUMMARY}\n" > "$2"; exit 0;; INFO/OS) mcrpmfs_getRawOneTag "%{OS}\n" > "$2"; exit 0;; INFO/CHANGELOG) mcrpmfs_getRawOneTag "[* %{CHANGELOGTIME:date} %{CHANGELOGNAME}\n%{CHANGELOGTEXT}\n\n]\n" > "$2"; exit 0;; INFO/SIZE) mcrpmfs_getRawOneTag "%{SIZE} bytes\n" > "$2"; exit 0;; INFO/OBSOLETES) mcrpmfs_getRawOneTag "[%{OBSOLETENAME} %|OBSOLETEFLAGS?{%{OBSOLETEFLAGS:depflags} %{OBSOLETEVERSION}}:{}|\n]" > "$2"; exit 0;; INFO/CONFLICTS) mcrpmfs_getRawOneTag "[%{CONFLICTNAME} %{CONFLICTFLAGS:depflags} %{CONFLICTVERSION}\n]" >"$2"; exit 0;; CONTENTS.*) $RPM2CPIO "${rpm_filename}" > "$2"; exit 0;; *) ;; esac } mcrpmfs_run () { case "$1" in INSTALL) echo "Installing \"${rpm_filename}\""; $RPM -ivh "${rpm_filename}"; exit 0;; UPGRADE) echo "Upgrading \"${rpm_filename}\""; $RPM -Uvh "${rpm_filename}"; exit 0;; REBUILD) echo "Rebuilding \"${rpm_filename}\""; $RPMBUILD --rebuild "${rpm_filename}"; exit 0;; esac } # Let the test framework override functions and variables. [ -n "$MC_TEST_RPM_REWRITE" ] && . "$MC_TEST_RPM_REWRITE" AllTAGS=`mcrpmfs_getAllNeededTags "$1"` umask 077 case "${param}" in list) mcrpmfs_list; exit 0;; copyout) mcrpmfs_copyout "$1" "$2"; exit 0;; run) mcrpmfs_run "$1"; exit 1;; esac exit 1 PK!O extfs.d/ulhanuȯ#! /bin/sh # # LHa Virtual filesystem executive v0.1 # Copyright (C) 1996, 1997 Joseph M. Hinkle # May be distributed under the terms of the GNU Public License # # # Code for mc_lha_fs_run() suggested by: # Jan 97 Zdenek Kabelac # Tested with mc 3.5.18 and gawk 3.0.0 on Linux 2.0.0 # Tested with lha v1.01 and lharc v1.02 # Information and sources for other forms of lha/lzh appreciated # Nota bene: # There are several compression utilities which produce *.lha files. # LHArc and LHa in exist several versions, and their listing output varies. # Another variable is the architecture on which the compressed file was made. # This program attempts to sort out the variables known to me, but it is likely # to display an empty panel if it encounters a mystery. # In that case it will be useful to execute this file from the command line: # ./lha list Mystery.lha # to examine the output directly on the console. The output string must be # precisely in the format described in the README in this directory. # Caveat emptor. # Learn Latin. # Define your awk AWK=gawk # Define which archiver you are using with appropriate options LHA_LIST="lha lq" LHA_GET="lha pq" LHA_PUT="lha aq" # The 'list' command executive mc_lha_fs_list() { # List the contents of the archive and sort it out $LHA_LIST "$1" | $AWK -v uid=`id -nu` -v gid=`id -ng` ' # Strip a leading '/' if present in a filepath $(NF) ~ /^\// { $(NF) = substr($NF,2) } # Print the line this way if there is no permission string $1 ~ /^\[.*\]/ { # Invent a generic permission $1 = ($NF ~ /\/$/) ? "drwxr-xr-x":"-rwxr--r--"; # Print it printf "%s 1 %-8s %-8s %-8d %s %s %s %s\n", $1, uid, gid, $2, $4, $5, $6, $7; # Get the next line of the list next; } # Do it this way for a defined permission $1 !~ /^\[.*\]/ { # If the permissions and UID run together if ($1 ~ /\//) { $8 = $7; $7 = $6; $6 = $5; $5 = $4; $3 = $2; $2 = substr($1,10); $1 = substr($1,1,9); } # If the permission string is missing a type if (length($1) == 9) { if ($NF ~ /\/$/) $1 = ("d" $1); else $1 = ("-" $1); } # UID:GID might not be the same as on your system so print numbers # Well, that is the intent. At the moment mc is translating them. split($2, id, "/"); printf "%s 1 %-8d %-8d %-8d %s %s %s %s\n", $1, id[1], id[2], $3, $5, $6, $7, $8; # Get the next line of the list next; } ' } # The 'copyout' command executive to copy displayed files to a destination mc_lha_fs_copyout() { $LHA_GET "$1" "$2" > "$3" } # The 'copyin' command executive to add something to the archive mc_lha_fs_copyin () { NAME2=`basename "$2"`; DIR2=${2%$NAME2} NAME3=`basename "$3"`; DIR3=${3%$NAME3} cd "${DIR3}" ONE2=${2%%/*} [ -n "${ONE2}" ] || exit 1 [ -e "${ONE2}" ] && exit 1 [ -e "${DIR2}" ] || mkdir -p "${DIR2}" ln "$3" "$2" || exit 1 $LHA_PUT "$1" "$2" rm -r "${ONE2}" } # The 'run' command executive to run a command from within an archive mc_lha_fs_run() { TMPDIR=`mktemp -d "${MC_TMPDIR:-/tmp}/mctmpdir-ulha.XXXXXX"` || exit 1 trap "rm -rf \"$TMPDIR\"; exit 0" 1 2 3 4 15 TMPCMD=$TMPDIR/run $LHA_GET "$1" "$2" > $TMPCMD chmod a+x "$TMPCMD" "$TMPCMD" rm -rf "$TMPDIR" } # The main routine umask 077 cmd="$1" shift case "$cmd" in list) mc_lha_fs_list "$@" ;; copyout) mc_lha_fs_copyout "$@" ;; copyin) mc_lha_fs_copyin "$@" ;; run) mc_lha_fs_run "$@" ;; *) exit 1 ;; esac exit 0 PK! ʬW++extfs.d/patchfsnuȯ#! /usr/bin/perl -w # # Written by Adam Byrtek , 2002 # Rewritten by David Sterba , 2009 # # Extfs to handle patches in context and unified diff format. # Known issues: When name of file to patch is modified during editing, # hunk is duplicated on copyin. It is unavoidable. use bytes; use strict; use POSIX; use File::Temp 'tempfile'; # standard binaries my $lzip = 'lzip'; my $lz4 = 'lz4'; my $lzma = 'lzma'; my $xz = 'xz'; my $bzip = 'bzip2'; my $gzip = 'gzip'; my $fileutil = 'file -b'; # date parsing requires Date::Parse from TimeDate module my $parsedates = eval 'require Date::Parse'; # regular expressions my $unified_header=qr/^--- .*\t.*\n\+\+\+ .*\t.*\n$/; my $unified_extract=qr/^--- ([^\t]+).*\n\+\+\+ ([^\t]+)\s*(.*)\n/; my $unified_header2=qr/^--- .*\n\+\+\+ .*\n$/; my $unified_extract2=qr/^--- ([^\s]+).*\n\+\+\+ ([^\s]+)\s*(.*)\n/; my $unified_contents=qr/^([+\-\\ \n]|@@ .* @@)/; my $unified_hunk=qr/@@ -(\d+)(,(\d+))? \+(\d+)(,(\d+))? @@.*\n/; my $context_header=qr/^\*\*\* .*\t.*\n--- .*\t.*\n$/; my $context_extract=qr/^\*\*\* ([^\t]+).*\n--- ([^\t]+)\s*(.*)\n/; my $context_header2=qr/^\*\*\* .*\n--- .*\n$/; my $context_extract2=qr/^\*\*\* ([^\s]+).*\n--- ([^\s]+)\s*(.*)\n/; my $context_contents=qr/^([!+\-\\ \n]|-{3} .* -{4}|\*{3} .* \*{4}|\*{15})/; my $ls_extract_id=qr/^[^\s]+\s+[^\s]+\s+([^\s]+)\s+([^\s]+)/; my $basename=qr|^(.*/)*([^/]+)$|; sub patchfs_canonicalize_path ($) { my ($fname) = @_; $fname =~ s,/+,/,g; $fname =~ s,(^|/)(?:\.?\./)+,$1,; return $fname; } # output unix date in a mc-readable format sub timef { my @time=localtime($_[0]); return sprintf '%02d-%02d-%02d %02d:%02d', $time[4]+1, $time[3], $time[5]+1900, $time[2], $time[1]; } # parse given string as a date and return unix time sub datetime { # in case of problems fall back to 0 in unix time # note: str2time interprets some wrong values (eg. " ") as 'today' if ($parsedates && defined (my $t=str2time($_[0]))) { return timef($t); } return timef(time); } # print message on stderr and exit sub error { print STDERR $_[0], "\n"; exit 1; } # (compressed) input sub myin { my ($qfname)=(quotemeta $_[0]); $_=`$fileutil $qfname`; if (/^'*lz4/) { return "$lz4 -dc $qfname"; } elsif (/^'*lzip/) { return "$lzip -dc $qfname"; } elsif (/^'*lzma/) { return "$lzma -dc $qfname"; } elsif (/^'*xz/) { return "$xz -dc $qfname"; } elsif (/^'*bzip/) { return "$bzip -dc $qfname"; } elsif (/^'*gzip/) { return "$gzip -dc $qfname"; } else { return "cat $qfname"; } } # (compressed) output sub myout { my ($qfname,$append)=(quotemeta $_[0],$_[1]); my ($sep) = $append ? '>>' : '>'; $_=`$fileutil $qfname`; if (/^'*lz4/) { return "$lz4 -c $sep $qfname"; } elsif (/^'*lzip/) { return "$lzip -c $sep $qfname"; } elsif (/^'*lzma/) { return "$lzma -c $sep $qfname"; } elsif (/^'*xz/) { return "$xz -c $sep $qfname"; } elsif (/^'*bzip/) { return "$bzip -c $sep $qfname"; } elsif (/^'*gzip/) { return "$gzip -c $sep $qfname"; } else { return "cat $sep $qfname"; } } # select diff filename conforming with rules found in diff.info sub diff_filename { my ($fsrc,$fdst)= @_; # TODO: can remove these two calls later $fsrc = patchfs_canonicalize_path ($fsrc); $fdst = patchfs_canonicalize_path ($fdst); if (!$fdst && !$fsrc) { error 'Index: not yet implemented'; } elsif (!$fsrc || $fsrc eq '/dev/null') { return ($fdst,'PATCH-CREATE/'); } elsif (!$fdst || $fdst eq '/dev/null') { return ($fsrc,'PATCH-REMOVE/'); } elsif (($fdst eq '/dev/null') && ($fsrc eq '/dev/null')) { error 'Malformed diff, missing a sane filename'; } else { # fewest path name components if ($fdst=~s|/|/|g < $fsrc=~s|/|/|g) { return ($fdst,''); } elsif ($fdst=~s|/|/|g > $fsrc=~s|/|/|g) { return ($fsrc,''); } else { # shorter base name if (($fdst=~/$basename/o,length $2) < ($fsrc=~/$basename/o,length $2)) { return ($fdst,''); } elsif (($fdst=~/$basename/o,length $2) > ($fsrc=~/$basename/o,length $2)) { return ($fsrc,''); } else { # shortest names if (length $fdst < length $fsrc) { return ($fdst,''); } else { return ($fsrc,''); } } } } } # IN: diff "archive" name # IN: file handle for output; STDIN for list, tempfile else # IN: filename to watch (for: copyout, rm), '' for: list # IN: remove the file? # true - ... and print out the rest # false - ie. copyout mode, print just the file sub parse($$$$) { my $archive=quotemeta shift; my $fh=shift; my $file=shift; my $rmmod=shift; my ($state,$fsize,$time); my ($f,$fsrc,$fdst,$prefix); my ($unified,$context); my ($skipread, $filetoprint, $filefound); my ($h_add,$h_del,$h_ctx); # hunk line counts my ($h_r1,$h_r2); # hunk ranges my @outsrc; # if desired ... my @outdst; my $line; my %fmap_size=(); my %fmap_time=(); import Date::Parse if ($parsedates && $file eq ''); $line=1; $state=0; $fsize=0; $f=''; $filefound=0; while ($skipread || ($line++,$_=)) { $skipread=0; if($state == 0) { # expecting comments $unified=$context=0; $unified=1 if (/^--- /); $context=1 if (/^\*\*\* /); if (!$unified && !$context) { $filefound=0 if($file ne '' && $filetoprint); # shortcut for rmmod xor filefound # - in rmmod we print if not found # - in copyout (!rmmod) we print if found print $fh $_ if($rmmod != $filefound); next; } if($file eq '' && $filetoprint) { $fmap_size{"$prefix$f"}+=$fsize; $fmap_time{"$prefix$f"}=$time; } # start of new file $_ .=; # steal next line, both formats $line++; if($unified) { if(/$unified_header/o) { ($fsrc,$fdst,$time) = /$unified_extract/o; } elsif(/$unified_header2/o) { ($fsrc,$fdst,$time) = /$unified_extract2/o; } else { error "Can't parse unified diff header"; } } elsif($context) { if(/$context_header/o) { ($fsrc,$fdst,$time) = /$context_extract/o; } elsif(/$context_header2/o) { ($fsrc,$fdst,$time) = /$context_extract2/o; } else { error "Can't parse context diff header"; } } else { error "Unrecognized diff header"; } $fsrc=patchfs_canonicalize_path($fsrc); $fdst=patchfs_canonicalize_path($fdst); if(wantarray) { push @outsrc,$fsrc; push @outdst,$fdst; } ($f,$prefix)=diff_filename($fsrc,$fdst); $filefound=($f eq $file); $f="$f.diff"; $filetoprint=1; $fsize=length; print $fh $_ if($rmmod != $filefound); $state=1; } elsif($state == 1) { # expecting diff hunk headers, end of file or comments if($unified) { my ($a,$b,$c,$d); ($a,$b,$h_r1,$c,$d,$h_r2)=/$unified_hunk/o; if(!defined($a) || !defined($c)) { # hunk header does not come, a comment inside # or maybe a new file, state 0 will decide $skipread=1; $state=0; next; } $fsize+=length; print $fh $_ if($rmmod != $filefound); $h_r1=1 if(!defined($b)); $h_r2=1 if(!defined($d)); $h_add=$h_del=$h_ctx=0; $state=2; } elsif($context) { if(!/$context_contents/o) { $skipread=1; $state=0; next; } print $fh $_ if($rmmod != $filefound); $fsize+=length; } } elsif($state == 2) { # expecting hunk contents if($h_del + $h_ctx == $h_r1 && $h_add + $h_ctx == $h_r2) { # hooray, end of hunk # we optimistically ended with a hunk before but # the line has been read already $skipread=1; $state=1; next; } print $fh $_ if($rmmod != $filefound); $fsize+=length; my ($first)= /^(.)/; if(ord($first) == ord('+')) { $h_add++; } elsif(ord($first) == ord('-')) { $h_del++; } elsif(ord($first) == ord(' ')) { $h_ctx++; } elsif(ord($first) == ord('\\')) { 0; } elsif(ord($first) == ord('@')) { error "Malformed hunk, header came too early"; } else { error "Unrecognized character in hunk"; } } } if($file eq '' && $filetoprint) { $fmap_size{"$prefix$f"}+=$fsize; $fmap_time{"$prefix$f"}=$time; } # use uid and gid from file my ($uid,$gid)=(`ls -l $archive`=~/$ls_extract_id/o); # flush all file names with cumulative file size while(my ($fn, $fs) = each %fmap_size) { printf $fh "-rw-r--r-- 1 %s %s %d %s %s\n", $uid, $gid, $fs, datetime($fmap_time{$fn}), $fn; } close($fh) if($file ne ''); return \(@outsrc, @outdst) if wantarray; } # list files affected by patch sub list($) { parse($_[0], *STDOUT, '', 0); close(I); } # extract diff from patch # IN: diff file to find # IN: output file name sub copyout($$) { my ($file,$out)=@_; $file=~s/^(PATCH-(CREATE|REMOVE)\/)?(.*)\.diff$/$3/; $file = patchfs_canonicalize_path ($file); open(FH, ">$out") or error("Cannot open output file"); parse('', *FH, $file, 0); } # remove diff(s) from patch # IN: archive # IN: file to delete sub rm($$) { my $archive=shift; my ($tmp,$tmpname)=tempfile(); @_=map {scalar(s/^(PATCH-(CREATE|REMOVE)\/)?(.*)\.diff$/$3/,$_)} @_; # just the first file for now parse($archive, $tmp, $_[0], 1); close I; # replace archive system("cat \Q$tmpname\E | " . myout($archive,0))==0 or error "Can't write to archive"; system("rm -f -- \Q$tmpname\E"); } # append diff to archive # IN: diff archive name # IN: newly created file name in archive # IN: the real source file sub copyin($$$) { # TODO: seems to be tricky. what to do? # copyin of file which is already there may: # * delete the original and copy only the new # * just append the new hunks to the same file # problems: may not be a valid diff, unmerged hunks # * try to merge the two together # ... but we do not want write patchutils again, right? error "Copying files into diff not supported"; return; my ($archive,$name,$src)=@_; # in case we are appending another diff, we have # to delete/merge all the files open(DEVNULL, ">/dev/null"); open I, myin($src).'|'; my ($srclist,$dstlist)=parse($archive, *DEVNULL, '', 0); close(I); close(DEVNULL); foreach(@$srclist) { print("SRC: del $_\n"); } foreach(@$dstlist) { print("DST: del $_\n"); } return; # remove overwritten file open I, myin($archive).'|'; rm ($archive, $name); close I; my $cmd1=myin("$src.diff"); my $cmd2=myout($archive,1); system("$cmd1 | $cmd2")==0 or error "Can't write to archive"; } my $fin = $ARGV[1]; # resolve symlink while (-l $fin) { $fin = readlink $fin; } if ($ARGV[0] eq 'list') { open I, myin($fin).'|'; list ($fin); exit 0; } elsif ($ARGV[0] eq 'copyout') { open I, myin($fin)."|"; copyout ($ARGV[2], $ARGV[3]); exit 0; } elsif ($ARGV[0] eq 'rm') { open I, myin($fin)."|"; rm ($fin, $ARGV[2]); exit 0; } elsif ($ARGV[0] eq 'rmdir') { exit 0; } elsif ($ARGV[0] eq 'mkdir') { exit 0; } elsif ($ARGV[0] eq 'copyin') { copyin ($fin, $ARGV[2], $ARGV[3]); exit 0; } exit 1; PK!r extfs.d/lslRnuȯ#! /bin/sh # Based on previous version of lslR # Modified by Tomas Novak April 2000 # (to allow spaces in filenames) # # It's assumed that lslR was generated in C locale. LC_ALL=C export LC_ALL=C AWK=gawk mclslRfs_list () { case "$1" in *.lz) MYCAT="lzip -dc";; *.lz4) MYCAT="lz4 -dc";; *.lzma) MYCAT="lzma -dc";; *.xz) MYCAT="xz -dc";; *.bz2) MYCAT="bzip2 -dc";; *.gz) MYCAT="gzip -dc";; *.z) MYCAT="gzip -dc";; *.Z) MYCAT="gzip -dc";; *) MYCAT="cat";; esac MYCAT=${MC_TEST_EXTFS_LIST_CMD:-$MYCAT} # Let the test framework hook in. $MYCAT "$1" | $AWK ' BEGIN { dir=""; empty=1; rx = "[^ ]+[ ]+"; # Pattern to match 7 first fields. rx7 = "^" rx rx rx rx rx rx "[^ ]+[ ]"; # Pattern to match 8 first fields. rx8 = "^" rx rx rx rx rx rx rx "[^ ]+[ ]"; } /^total\ [0-9]*$/ { next } /^$/ { empty=1; next } empty==1 && /:$/ { empty=0 if ($0 ~ /^\//) dir=substr($0, 2); else dir=$0; if (dir ~ /\/:$/) sub(/:$/, "", dir); else sub(/:$/, "/", dir); if (dir ~ /^[ ]/) dir="./"dir; next; } ( NF > 7 ) { empty=0 # gensub() is not portable. name=$0 i=index($6, "-") if (i) { sub(rx7, "", name) NF = 7 $6=substr($6,i+1)"-"substr($6,1,i-1) } else { sub(rx8, "", name) NF = 8 } printf "%s %s%s\n", $0, dir, name } { empty=0 }' } case "$1" in list) mclslRfs_list "$2"; exit 0;; esac exit 1 PK!&&extfs.d/READMEnu[ Writing scripts for Midnight Commander's external vfs IMPORTANT NOTE: There may be some bugs left in extfs. Enjoy. Starting with version 3.1, the Midnight Commander comes with so called extfs, which is one of the virtual filesystems. This system makes it possible to create new virtual filesystems for the GNU MC very easily. To handle requests, create a shell/perl/python/etc script/program (with executable permissions) in $(libexecdir)/mc/extfs.d or in ~/.mc/extfs.d. (Note: $(libexecdir) should be substituted for actual libexecdir path stored when configured or compiled, like /usr/local/libexec or /usr/libexec). Assign a vfs suffix. For example, if you have .zip file, and would like to see what's inside it, path will be /anypath/my.zip/uzip://some_path/... In this example, .zip is suffix, but I call vfs 'uzip'. Why? Well, what this vfs essentially does is UNzip. UN is too long, so I choosed U. Note that sometime in future filesystem like zip may exist: It will take whole tree and create .zip file from it. So /usr/zip:// will be zipfile containing whole /usr tree. If your vfs does not require file to work on, add '+' to the end of name. Note, that trailing '+' in file name is not a part of vfs name, it is just an vfs attribue. So you have not use it in vfs commands: cd rpms:// is correct command, and cd rpms+:// is incorrect command. * Commands that should be implemented by your shell script ---------------------------------------------------------- Return zero from your script upon completion of the command, otherwise nonzero for failure or in case of an unsupported command. $libdir/extfs/prefix command [arguments] * Command: list archivename This command should list the complete archive content in the following format (a little modified ls -l listing): AAAAAAA NNN OOOOOOOO GGGGGGGG SSSSSSSS DATETIME [PATH/]FILENAME [-> [PATH/]FILENAME[/]]] where (things in [] are optional): AAAAAAA is the permission string like in ls -l NNN is the number of links OOOOOOOO is the owner (either UID or name) GGGGGGGG is the group (either GID or name) SSSSSSSS is the file size FILENAME is the filename PATH is the path from the archive's root without the leading slash (/) DATETIME has one of the following formats: Mon DD hh:mm[:ss], Mon DD YYYY, MM-DD-YYYY hh:mm[:ss] where Mon is a three letter English month name, DD is day 01-31 (can be 1-31, if following Mon), MM is month 01-12, YYYY is four digit year, hh is hours, mm is minutes, and ss is optional seconds. If the -> [PATH/]FILENAME part is present, it means: If permissions start with an l (ell), then it is the name that symlink points to. (If this PATH starts with a MC vfs prefix, then it is a symlink somewhere to the other virtual filesystem (if you want to specify path from the local root, use local:/path_name instead of /path_name, since /path_name means from root of the archive listed). If permissions do not start with l, but number of links is greater than one, then it says that this file should be a hardlinked with the other file. * Command: copyout archivename storedfilename extractto This should extract from archive archivename the file called storedfilename (possibly with path if not located in archive's root [this is wrong. current extfs strips paths! -- pavel@ucw.cz]) to file extractto. * Command: copyin archivename storedfilename sourcefile This should add to the archivename the sourcefile with the name storedfilename inside the archive. Important note: archivename in the above examples may not have the extension you are expecting to have, like it may happen that archivename will be something like /tmp/f43513254 or just anything. Some archivers do not like it, so you'll have to find some workaround. * Command: rm archivename storedfilename This should remove storedfilename from archivename. * Command: mkdir archivename dirname This should create a new directory called dirname inside archivename. * Command: rmdir archivename dirname This should remove an existing directory dirname. If the directory is not empty, mc will recursively delete it (possibly prompting). * Command: run Undocumented :-) --------------------------------------------------------- Don't forget to mark this file executable (chmod 755 ThisFile, for example) For skeleton structure of executable, look at some of filesystems similar to yours. --------------------------------------------------------- In constructing these routines, errors will be made, and mc will not display a malformed printing line. That can lead the programmer down many false trails in search of the bug. Since this routine is an executable shell script it can be run from the command line independently of mc, and its output will show on the console or can be redirected to a file. * Putting it to use ---------------------------------------------------------- The file .mc.ext in a home directory, and in mc's user directory (commonly /etc/mc), contains instructions for operations on files depending on filename extensions. It is well documented in other files in this distribution, so here are just a few notes specifically on use of the Virtual File System you just built. There are entries in .mc.ext defining a few operations that can be done on a file from an mc panel. Typically they are annotated with a hash mark and a file extension like this: # zip There must be a way to find the file by extension, so the next line does that. In essence it says "identify the string ".zip" or (|) ".ZIP" at the end ($) of a filename": regex/\.(zip|ZIP)$ The operations themselves follow that. They must be indented by at least a space, and a tab works as well. In particular, the Open operation will now use your new virtual file system by cd'ing to it like this: Open=%cd zip:%d/%p This is the line used when a file is highlighted in a panel and the user presses or . The contents of the archive should show just as if they were in a real directory, and can be manipulated as such. The rest of the entry pertains to use of the F3 View key: View=%view{ascii} unzip -v %f And perhaps an optional icon for X: Icon=zip.xpm And perhaps an operation to extract the contents of the file, called from a menu selection: Extract=unzip %f '*' This is just an example. The current entry for .zip files has a menu selection of 'Unzip' which could be used in place of 'Extract'. What goes here depends on what items you have in, or add to, the menu system, and that's another subject. The sum of this is the .mc.ext entry: # zip regex/\.(zip|ZIP)$ Open=%cd %p/uzip:// View=%view{ascii} unzip -v %f Icon=zip.xpm Extract=unzip %f '*' Add an entry like this to the .mc.ext file in a user's home directory, If you want others to have it, add it to the mc.ext file in the mc system directory, often /etc/mc/mc.ext. Notice this file is not prepended with a dot. Once all this is done, and things are in their proper places, exit mc if you were using it, and restart it so it picks up the new information. That's all there is to it. The hardest part is making a listing function that sorts the output of a system listing command and turns it into a form that mc can use. Currently awk (or gawk) is used because nearly all systems have it. If another scripting language is available, like perl, that could also be used. PK!XX extfs.d/debnuȯ#! /usr/bin/perl # # Written by Fernando Alegre 1996 # # Applied patch by Dimitri Maziuk 1997 # (to handle new tar format) # # Modified by Fernando Alegre 1997 # (to handle both new and old tar formats) # # Modified by Patrik Rak 1998 # (add by Michael Bramer Debian-mc-maintainer ) # (to allow access to package control files) # # Modified by Martin Bialasinski 1999 # (deal with change in tar format) # # # Copyright (C) 1997 Free Software Foundation # sub quote { $_ = shift(@_); s/([^\w\/.+-])/\\$1/g; return($_); } sub mcdebfs_list { # # CAVEAT: Hard links are listed as if they were symlinks # Empty directories do not appear at all # local($archivename)=@_; local $qarchivename = quote($archivename); chop($date=`LC_ALL=C date "+%b %d %H:%M"`); chop($info_size=`dpkg -I $qarchivename | wc -c`); $install_size=length($pressinstall); print "dr-xr-xr-x 1 root root 0 $date CONTENTS\n"; print "dr-xr-xr-x 1 root root 0 $date DEBIAN\n"; print "-r--r--r-- 1 root root $info_size $date INFO\n"; print "-r-xr--r-- 1 root root $install_size $date INSTALL\n"; if ( open(PIPEIN, "LC_ALL=C dpkg-deb -c $qarchivename |") ) { while() { @_ = split; $perm=$_[0]; $owgr=$_[1]; $size=$_[2]; if($_[3] =~ /^\d\d\d\d\-/) { # New tar format ($year,$mon,$day) = split(/-/,$_[3]); $month = ("Gee","Jan","Feb","Mar","Apr","May","Jun", "Jul","Aug","Sep","Oct","Nov","Dec")[$mon] || "Gee"; $time=$_[4]; $pathindex=5; } else { $mstring='GeeJanFebMarAprMayJunJulAugSepOctNovDec'; $month=$_[3]; $mon=index($mstring,$month) / 3; $day=$_[4]; $time=$_[5]; $year=$_[6]; $pathindex=7; } $path=$_[$pathindex++]; $arrow=$_[$pathindex++]; $link=$_[$pathindex++]; $link2=$_[$pathindex++]; $owgr=~s!/! !; if($arrow eq 'link') { # report hard links as soft links $arrow='->'; $link="/$link2"; substr($perm, 0, 1) = "l"; } if($arrow ne '') { $arrow=' ' . $arrow; $link= ' ' . $link; } $now=`date "+%Y %m"`; ($thisyear, $thismon) = split(/ /, $now); # show time for files younger than 6 months # but not for files with dates in the future if ($year * 12 + $mon > $thisyear * 12 + $thismon - 6 && $year * 12 + $mon <= $thisyear * 12 + $thismon) { print "$perm 1 $owgr $size $month $day $time CONTENTS/$path$arrow$link\n"; } else { print "$perm 1 $owgr $size $month $day $year CONTENTS/$path$arrow$link\n"; } } } if ( open(PIPEIN, "LC_ALL=C dpkg-deb -I $qarchivename |") ) { while() { @_ = split; $size=$_[0]; last if $size =~ /:/; next if $size !~ /\d+/; if($_[4] eq '*') { $perm='-r-xr-xr-x'; $name=$_[5]; } else { $perm='-r--r--r--'; $name=$_[4]; } print "$perm 1 root root $size $date DEBIAN/$name\n"; } } } sub mcdebfs_copyout { local($archive,$filename,$destfile)=@_; local $qarchive = quote($archive); local $qfilename = quote($filename); local $qdestfile = quote($destfile); if($filename eq "INFO") { system("dpkg-deb -I $qarchive > $qdestfile"); } elsif($filename =~ /^DEBIAN/) { $qfilename=~s!^DEBIAN/!!; system("dpkg-deb -I $qarchive $qfilename > $qdestfile"); } elsif($filename eq "INSTALL") { if ( open(FILEOUT,">$destfile") ) { print FILEOUT $pressinstall; close FILEOUT; system("chmod a+x $qdestfile"); } } else { # files can be prepended with ./ or not, depending on the version of tar $qfilename=~s!^CONTENTS/!!; system("dpkg-deb --fsys-tarfile $qarchive | tar xOf - $qfilename ./$qfilename > $qdestfile 2>/dev/null"); } } sub mcdebfs_run { local($archive,$filename)=@_; local $qarchive = quote($archive); if($filename eq "INSTALL") { print "Installing $archive\n"; system("dpkg -i $qarchive"); } else { use File::Temp qw(mkdtemp); my $template = "/tmp/mcdebfs.run.XXXXXX"; $template="$ENV{MC_TMPDIR}/mcdebfs.XXXXXX" if ($ENV{MC_TMPDIR}); $tmpdir = mkdtemp($template); $tmpcmd="$tmpdir/run"; &mcdebfs_copyout($archive, $filename, $tmpcmd); system("chmod u+x $tmpcmd"); system($tmpcmd); unlink($tmpcmd); rmdir($tmpdir); } } $pressinstall=< April 2000 # # Copyright (C) 2000, 2003 # The Free Software Foundation, Inc. # # Written by: # Michael Shigorin , # Grigory Milev , # Kachalov Anton , 2003 # Victor Ananjevsky , 2013 # slava zanko , 2013 # # This file is part of the Midnight Commander. # # The Midnight Commander is free software: you can redistribute it # and/or modify it under the terms of the GNU General Public License as # published by the Free Software Foundation, either version 3 of the License, # or (at your option) any later version. # # The Midnight Commander is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . #*** include section (source functions, for example) ******************* #*** file scope functions ********************************************** XORRISO=$(which xorriso 2>/dev/null) xorriso_list() { if test -z "$XORRISO"; then return 1 fi local dir attr ln usr gr sz dt1 dt2 dt3 nm len name lsl r dir="${2:-/}" lsl=$( $XORRISO -abort_on FATAL -dev stdio:"$1" -cd "$dir" -lsl 2> /dev/null ) r=$? test $r -gt 0 && return $r echo "$lsl" | /usr/bin/grep "^[-d]" | \ while read attr ln usr gr sz dt1 dt2 dt3 nm ; do len=$((${#nm} - 1)) name=$(printf -- "$nm" | cut -c2-$len) # remove quotes if test $(printf -- "$attr" | cut -c1-1) != "d"; then printf -- "%s %s %s %s %s %s %s %s %s/%s\n" "$attr" "$ln" "$usr" "$gr" "$sz" "$dt1" "$dt2" "$dt3" "$dir" "$name" else xorriso_list "$1" "$dir/$name" fi done } xorriso_copyout() { if test -z "$XORRISO"; then return 1 fi $XORRISO -dev stdio:"$1" -osirrox on -extract "$2" "$3" >/dev/null 2>&1 } xorriso_copyin() { if test -z "$XORRISO"; then return 1 fi $XORRISO -dev stdio:"$1" -cpr "$3" "$2" >/dev/null 2>&1 } xorriso_mkdir() { if test -z "$XORRISO"; then return 1 fi $XORRISO -dev stdio:"$1" -mkdir "$2" >/dev/null 2>&1 } xorriso_rmdir() { if test -z "$XORRISO"; then return 1 fi $XORRISO -dev stdio:"$1" -rmdir "$2" >/dev/null 2>&1 } xorriso_rm() { if test -z "$XORRISO"; then return 1 fi $XORRISO -dev stdio:"$1" -rm "$2" >/dev/null 2>&1 } # tested to comply with isoinfo 2.0's output test_iso () { CHARSET=$(locale charmap 2>/dev/null) if test -z "$CHARSET"; then CHARSET=$(locale 2>/dev/null | /usr/bin/grep LC_CTYPE | sed -n -e 's/.*\.\(.*\)"$/\1/p') fi if test -n "$CHARSET"; then CHARSET=$(echo "$CHARSET" | tr '[A-Z]' '[a-z]' | sed -e 's/^iso-/iso/') isoinfo -j $CHARSET -i /dev/null 2>&1 | /usr/bin/grep "Iconv not yet supported\|Unknown charset" >/dev/null && CHARSET= fi if test -n "$CHARSET"; then JOLIET_OPT="-j $CHARSET -J" else JOLIET_OPT="-J" fi ISOINFO="isoinfo -R" ISOINFO_D_I="$(isoinfo -d -i "$1" 2>/dev/null)" echo "$ISOINFO_D_I" | /usr/bin/grep "UCS level 1\|NO Joliet" > /dev/null || ISOINFO="$ISOINFO $JOLIET_OPT" if [ $(echo "$ISOINFO_D_I" | /usr/bin/grep "Joliet with UCS level 3 found" | wc -l) = 1 \ -a $(echo "$ISOINFO_D_I" | /usr/bin/grep "NO Rock Ridge" | wc -l) = 1 ] ; then SEMICOLON="YES" fi } mcisofs_list () { # left as a reminder to implement compressed image support =) case "$1" in *.lz) MYCAT="lzip -dc";; *.lz4) MYCAT="lz4 -dc";; *.lzma) MYCAT="lzma -dc";; *.xz) MYCAT="xz -dc";; *.bz2) MYCAT="bzip2 -dc";; *.gz) MYCAT="gzip -dc";; *.z) MYCAT="gzip -dc";; *.Z) MYCAT="gzip -dc";; *) MYCAT="cat";; esac $ISOINFO -l -i "$1" 2>/dev/null | gawk -v SEMICOLON=$SEMICOLON ' BEGIN { dir=""; # Pattern to match 8 first fields. rx = "[^ ]+[ ]+"; rx = "^" rx rx rx rx rx rx rx rx; irx = "^\\[ *-?[0-9]* *[0-9]+\\] +"; } /^$/ { next } /^d---------/ { next } /^Directory listing of [^ ].*$/ { dir=substr($0, 23); next; } { $11 != "" } { name=$0 sub(rx, "", name) attr=substr($0, 1, length($0)-length(name)) # strip inodes and extra dir entries; fix perms sub(irx, "", name) sub("^---------- 0 0 0", "-r--r--r-- 1 root root", attr) sub(" $", "", name) # for Joliet UCS level 3 if (SEMICOLON == "YES") sub(";1$", "", name); ## sub(";[0-9]+$", "", name) ## would break copyout # skip . and .. if (name == ".") next; if (name == "..") next; printf "%s%s%s\n", attr, dir, name }' } mcisofs_copyout () { if [ "x$SEMICOLON" = "xYES" ]; then $ISOINFO -i "$1" -x "/$2;1" 2>/dev/null > "$3" else $ISOINFO -i "$1" -x "/$2" 2>/dev/null > "$3" fi } #*** main code ********************************************************* LC_ALL=C cmd="$1" shift case "$cmd" in list) xorriso_list "$@" || { test_iso "$@"; mcisofs_list "$@"; } exit 0 ;; rm) xorriso_rm "$@" || { exit 1 } exit 0 ;; rmdir) xorriso_rmdir "$@" || { exit 1 } exit 0 ;; mkdir) xorriso_mkdir "$@" || { exit 1 } exit 0 ;; copyin) xorriso_copyin "$@" || { exit 1 } exit 0 ;; copyout) xorriso_copyout "$@" || { test_iso "$@"; mcisofs_copyout "$@"; } exit 0 ;; esac exit 1 PK!j  extfs.d/debanuȯ#! /usr/bin/perl # # 1999 (c) Piotr Roszatycki # This software is under GNU license # last modification: 1999-12-08 # # deba sub quote { $_ = shift(@_); s/([^\w\/.+-])/\\$1/g; return($_); } sub list { my($qarchive)=@_; $qarchive = quote($qarchive); chop($date=`LC_ALL=C date "+%m-%d-%Y %H:%M"`); chop($info_size=`apt-cache show $qarchive | wc -c`); $install_size=length($pressinstall); $upgrade_size=length($pressupgrade); print "-r--r--r-- 1 root root $info_size $date INFO\n"; chop($debd = `dpkg -s $qarchive | grep -i ^Version | sed 's/^version: //i'`); chop($deba = `apt-cache show $qarchive | grep -i ^Version | sed 's/^version: //i'`); if( ! $debd ) { print "-r-xr--r-- 1 root root $install_size $date INSTALL\n"; } elsif( $debd ne $deba ) { print "-r-xr--r-- 1 root root $upgrade_size $date UPGRADE\n"; } } sub copyout { my($archive,$filename,$destfile)=@_; my $qarchive = quote($archive); my $qdestfile = quote($destfile); if($filename eq "INFO") { system("apt-cache show $qarchive > $qdestfile"); } elsif($filename eq "INSTALL") { if ( open(FILEOUT, "> $destfile") ) { print FILEOUT $pressinstall; close FILEOUT; system("chmod a+x $qdestfile"); } } elsif($filename eq "UPGRADE") { if ( open(FILEOUT, ">, $destfile") ) { print FILEOUT $pressupgrade; close FILEOUT; system("chmod a+x $qdestfile"); } } else { die "extfs: $filename: No such file or directory\n"; } } sub run { my($archive,$filename)=@_; my $qarchive = quote($archive); if($filename eq "INSTALL") { system("apt-get install $qarchive"); } elsif($filename eq "UPGRADE") { system("apt-get install $qarchive"); } else { die "extfs: $filename: Permission denied\n"; } } $pressinstall=< '01', 'feb' => '02', 'mar' => '03', 'apr' => '04', 'may' => '05', 'jun' => '06', 'jul' => '07', 'aug' => '08', 'sep' => '09', 'oct' => '10', 'nov' => '11', 'dec' => '12'); my @PATHS = ('/usr/bin/gplib', '/usr/local/bin/gplib'); my $gplib = ''; foreach my $i (@PATHS) { if (-x $i) { $gplib = $i; last; } } if ($gplib eq '') { print STDERR "\a\t$0 : Gplib not found!\n"; exit(1); } my $cmd = shift; my $archive = shift; #------------------------------------------------------------------------------- sub mc_ulib_fs_list { open(PIPE, "$gplib -tq $archive |") || die("Error in $gplib -tq"); my($dev, $inode, $mode, $nlink, $uid, $gid) = stat($archive); while () { chomp; my @w = split(/\s+/o); my $fname = $w[0]; $fname =~ s|\\|/|g; printf("-rw-r--r-- 1 %s %s %d %s-%02u-%s %s %s\n", $uid, $gid, int($w[1]), $month{lc($w[4])}, $w[5], $w[7], substr($w[6], 0, 5), $fname); } close (PIPE); } #------------------------------------------------------------------------------- sub mc_ulib_fs_copyin { system("$gplib -r $archive $_[0]"); my $ret = $?; if ($ret) { die("Error in: $gplib -r"); } } #------------------------------------------------------------------------------- sub mc_ulib_fs_copyout { my($module, $fname) = @_; my $tmpdir = $ENV{'TMPDIR'}; $tmpdir = '/tmp' if (! defined $tmpdir or $tmpdir eq ''); open(PIPE, "$gplib -tq $archive |") || die("Error in: $gplib -tq"); while () { chomp; my @w = split(/\s+/o); my $module_orig = $w[0]; my $count = () = ($module_orig =~ /(\\)/g); my $md = $module_orig; $md =~ s|\\|/|g; if ($module eq $md) { return if ($count); } } close (PIPE); chdir($tmpdir); system("$gplib -x $archive $module"); my $ret = $?; if ($ret) { die("Error in: $gplib -x"); } rename($module, $fname) || die("Error in: rename($module, $fname)"); } #------------------------------------------------------------------------------- sub mc_ulib_fs_rm { system("$gplib -d $archive $_[0]"); my $ret = $?; if ($ret) { die("Error in: $gplib -d"); } } ################################################################################ if ($cmd eq 'list') { mc_ulib_fs_list(@ARGV); } elsif ($cmd eq 'copyin') { mc_ulib_fs_copyin(@ARGV); } elsif ($cmd eq 'copyout') { mc_ulib_fs_copyout(@ARGV); } elsif ($cmd eq 'rm') { mc_ulib_fs_rm(@ARGV); } else { exit(1); } PK!8AA extfs.d/uzoonuȯ#! /bin/sh # # Zoo file system # # Source of zoo can be found at # ftp://ftp.ibiblio.org/pub/Linux/utils/compress/ ZOO=${MC_TEST_EXTFS_LIST_CMD:-zoo} # Stupid zoo won't work if the archive name has no .zoo extension, so we # have to make a symlink with a "better" name. Also, zoo can create # directories even if printing files to stdout, so it's safer to confine # it to a temporary directory. mklink () { TMPDIR=`mktemp -d ${MC_TMPDIR:-/tmp}/mctmpdir-uzoo.XXXXXX` || exit 1 trap 'cd /; rm -rf "$TMPDIR"' 0 1 2 3 5 13 15 ARCHIVE="$TMPDIR/tmp.zoo" ln -sf "$1" "$ARCHIVE" cd "$TMPDIR" || exit 1 } mczoofs_list () { mklink "$1" $ZOO lq "$ARCHIVE" | gawk -v uid=$(id -ru) ' /^[^\ ]/ { next } { if (NF < 8) next if ($8 ~ /^\^/) $8=substr($8, 2) if ($6 > 50) $6=$6 + 1900 else $6=$6 + 2000 split($7, a, ":") split("Jan:Feb:Mar:Apr:May:Jun:Jul:Aug:Sep:Oct:Nov:Dec", month_list, ":") for (i=1; i<=12; i++) { month[month_list[i]] = i } if ($8 ~ /\/$/) printf "drwxr-xr-x 1 %-8d %-8d %8d %02d-%02d-%4d %02d:%02d %s\n", uid, 0, $1, month[$5], $4, $6, a[1], a[2], $8 else printf "-rw-r--r-- 1 %-8d %-8d %8d %02d-%02d-%4d %02d:%02d %s\n", uid, 0, $1, month[$5], $4, $6, a[1], a[2], $8 }' 2>/dev/null exit 0 } mczoofs_copyout () { mklink "$1" # zoo only accepts name without directory as file to extract base=`echo "$2" | sed 's,.*/,,'` $ZOO xpq: "$ARCHIVE" "$base" > "$3" cd / exit 0 } umask 077 cmd="$1" shift case "$cmd" in list) mczoofs_list "$@" ;; copyout) mczoofs_copyout "$@" ;; *) exit 1 ;; esac exit 0 PK!3; extfs.d/rpms+nuȯ#! /usr/bin/perl # # Written by Balazs Nagy (julian7@kva.hu) 1998 # locale bugfix by Michal Svec (rebel@penguin.cz) 2000 # (C) 1998 The Free Software Foundation. # # # override any locale for dates delete $ENV{"LC_ALL"}; $ENV{"LC_TIME"}="C"; #print $ENV{"LC_ALL"}; #exit 0; sub gd { my ($dt) = @_; $dt =~ tr/ //s; $dt =~ s/^\w+ (\w+) (\d+) (\d+:\d+):\d+ .+\n?$/$1 $2 $3/; return $dt; } $DATE=gd(`date`); sub list { my (@rpms, %files, $i, $fn, $dn, $sz, $bt); # @rpms = `rpm -qa --qf "\%{NAME}-\%{VERSION}-\%{RELEASE}:\%{GROUP}:\%{SIZE}:\%{BUILDTIME:date}\n"`; @rpms = `rpm -qa --qf "\%{NAME}-\%{VERSION}:\%{GROUP}:\%{SIZE}:\%{BUILDTIME:date}\n"`; print @trpms; %files = (); %sizes = (); %dates = (); for $i (@rpms) { if ($i =~ /^([^:]+):([^:]+):([^:]+):(.+)$/) { ($fn, $dn, $sz, $bt) = ($1, $2, $3, $4); $dn =~ s/ /_/g; if (defined $files{$dn}) { push(@{$files{$dn}}, $fn); } else { @{$files{$dn}} = ($fn); } $sizes{$fn} = $sz; $dates{$fn} = gd($bt); } } for $i (sort keys %files) { print "dr-xr-xr-x 1 root root 0 $DATE $i/\n"; for $fn (sort @{$files{$i}}) { print "-r--r--r-- 1 root root $sizes{$fn} $dates{$fn} $i/$fn.trpm\n"; } } } #open O, ">>/tmp/tt"; #print O "RPMS: "; #for $i (@ARGV) { # print O "$i "; #} #print O "\n"; #close O; if ($ARGV[0] eq "list") { list(); exit(0); } elsif ($ARGV[0] eq "copyout") { open O, ">$ARGV[3]"; print O $ARGV[2], "\n"; close O; exit(0); } exit(1); PK!++ extfs.d/uarnuȯ#!/bin/sh # # Written by Alex Kuchma # Alex Tkachenko # Updated by Vitezslav Samel # # (C) 1997, 1998 The Free Software Foundation. # # XAR=ar mcarfs_list () { # If $temp_replace string is part of the filename that part might get lost temp_replace='Unique Separator String' thisyear="`date +%Y`" $XAR tv "$1" | sed 's,^,-,;s, , 1 ,;s,/, ,' | sed -e "s/\( [0-2][0-9]\:[0-5][0-9]\)\( $thisyear \)\(.*\)/\1$temp_replace\3/" | sed -e "s/\( [0-2][0-9]\:[0-5][0-9] \)\([12][0-9][0-9][0-9] \)\(.*\)/ \2\3/" | sed -e "s/$temp_replace/ /" } mcarfs_copyout () { $XAR p "$1" "$2" > "$3" } mcarfs_copyin () { TMPDIR=`mktemp -d "${MC_TMPDIR:-/tmp}/mctmpdir-uar.XXXXXX"` || exit 1 name=`basename "$2"` (cd "$TMPDIR" && cp -fp "$3" "$name" && $XAR r "$1" "$name") rm -rf "$TMPDIR" } mcarfs_rm () { $XAR d "$1" "$2" } # override any locale for dates LC_ALL=C export LC_ALL umask 077 case "$1" in list) mcarfs_list "$2" ;; copyout) shift; mcarfs_copyout "$@" ;; copyin) shift; mcarfs_copyin "$@" ;; rm) shift; mcarfs_rm "$@" ;; mkdir|rmdir) echo "mcarfs: ar archives cannot contain directories." 1>&2 exit 1;; *) echo "mcarfs: unknown command: \"$1\"." 1>&2 exit 1;; esac exit 0 PK! extfs.d/ualznuȯ#!/bin/sh # # Written by Pavel Roskin # (C) 2005 The Free Software Foundation. # # UNALZ=unalz mcualz_list () { $UNALZ -l "$1" | gawk -v uid=`id -nu` -v gid=`id -ng` ' { if ($1 ~ /[0-9][0-9][:/][0-9][0-9][:/][0-9][0-9]$/) { # Kludge for non-POSIX date format in unalz 0.50 split($1, date, "[/:]") if (length(date[1]) == 4) { pdate = date[2] "/" date[3] "/" date[1] } else { pdate = date[1] "/" date[2] "/" date[3] } time=$2 perm=$3 size=$4 sub(/^ *[^ ]* *[^ ]* *[^ ]* *[^ ]* *[^ ]* */, "") file=$0 gsub(/\\/, "/", file) if (perm ~ /.D../) perm = "drwxr-xr-x" else perm = "-rw-r--r--" printf "%s 1 %s %s %d %s %s %s\n", perm, uid, gid, size, pdate, time, file } } ' } mcualz_copyout () { TMPDIR=`mktemp -d ${MC_TMPDIR:-/tmp}/mctmpdir-ualz.XXXXXX` || exit 1 # This is a workaround for a bug in unalz 0.50 - it crashes if the # output directory is an absolute path. dir=`dirname "$TMPDIR/$2"` mkdir -p "$dir" $UNALZ -d "$TMPDIR" "$1" "$2" >/dev/null cat "$TMPDIR/$2" > "$3" rm -rf "$TMPDIR" } # override any locale for dates LC_ALL=C export LC_ALL umask 077 cmd="$1" shift case "$cmd" in list) mcualz_list "$@" ;; copyout) mcualz_copyout "$@" ;; *) exit 1 ;; esac exit 0 PK!:MM extfs.d/hp48+nuȯ#!/bin/sh # # Written by Christofer Edvardsen , Feb 1998 # # This script makes it possible to view and copy files to/from a hp48 # (tested with a HP48G and the emulator x48) # # To use the hp48 external filesystem: # - read the relevant parts of your HP48 manual # - install kermit # - connect the HP48 to your computer or start x48 # - below change the line which reflects the serial device you use # - configure your HP48 ( - i/o - iopar): # port: wire # baud: 9600 # transfer format: binary (fast transfers) or # ascii (editable on the pc) # - start the server on the HP48: - i/o - srvr - serve # or the shortcut - # - on MC's commandline enter "cd hp48://" # # Make sure you have kermit installed and that it's using the right serial # device by changing /dev/ttyXX on the next line AWK=gawk KERMIT=${MC_TEST_EXTFS_LIST_CMD:-"kermit -l /dev/ttyS1 -b 9600"} NOW=`date +"%m-%d-%Y %H:%M"` hp48_cmd() { $KERMIT -C "SET EXIT WARNING OFF,REMOTE $1,QUIT" } hp48_cd() { (echo SET EXIT WARNING OFF;echo REMOTE HOST HOME for HP48_DIR in `echo "$1" | tr '/' ' '`;do if [ "x$HP48_DIR" != "x." ];then echo REMOTE HOST "$HP48_DIR"; fi done echo QUIT)| $KERMIT -B >/dev/null } # # Parses the reply to the DIRECTORY command. # # Here's an example reply (taken from [1][2]): # # { HOME } 105617 # STRAY 185.5 Directory 29225 # YEN 30.5 Program 53391 # JYTLIGHT 21848.5 String 62692 # IOPAR 37.5 List 61074 # # The meaning of the fields (according to [3][4]): # # { Current_directory } Free_space # Object_name Object_size_bytes Object_type Object_CRC # ... # # [1] http://newarea48.tripod.com/kermit.html # [2] http://www.hpmuseum.org/forum/thread-4684.html # [3] https://groups.google.com/d/msg/comp.sys.hp48/bYTCu9K3k20/YWQfF--W3EEJ # [4] http://www.columbia.edu/kermit/hp48.html (also has a link to the HP's user manual). # hp48_parser() { HP48_DIRS= read -r INPUT while [ "x$INPUT" != "xEOF" ] do set -- $INPUT obj_name=$1 obj_size=$2 obj_type=$3 obj_size=`echo $obj_size | $AWK '{ print int($0) }'` # Truncates floats to ints; anything else to "0". if [ "$obj_size" != "0" ]; then # Skips the 1st reply line (purportedly there aren't zero-size files b/c, according to resource [4], the size is "including name"). case "$obj_type" in Directory) HP48_DIRS="$HP48_DIRS $obj_name" printf "%crwxr-xr-x 1 %-8d %-8d %8d %s %s\n" 'd' \ 0 0 $obj_size "$NOW" "$HP48_CDIR/$obj_name" ;; *) printf "%crw-r--r-- 1 %-8d %-8d %8d %s %s\n" '-' \ 0 0 $obj_size "$NOW" "$HP48_CDIR/$obj_name" ;; esac fi read -r INPUT done for HP48_DIR in $HP48_DIRS; do HP48_PDIR="$HP48_CDIR" HP48_CDIR="$HP48_CDIR/$HP48_DIR"; hp48_cmd "HOST $HP48_DIR" >/dev/null hp48_list HP48_CDIR="$HP48_PDIR"; hp48_cmd "HOST UPDIR" >/dev/null done } hp48_list() { # It's hard to see why this "EOF" thing is needed. The loop above can be changed to "while read -r obj_name ...". @TODO. { hp48_cmd "DIRECTORY"; echo; echo EOF; } | hp48_parser } # override any locale for dates LC_ALL=C export LC_ALL case "$1" in list) HP48_CDIR= hp48_cmd "HOST HOME" >/dev/null hp48_list exit 0;; copyout) cd "`dirname "$4"`" hp48_cd "`dirname "$3"`" $KERMIT -B -g "`basename "$3"`" -a "$4" >/dev/null exit 0;; copyin) cd "`dirname "$4"`" hp48_cd "`dirname "$3"`" $KERMIT -B -s "$4" -a "`basename "$3"`" >/dev/null exit 0;; esac exit 1 PK!6[%% extfs.d/apt+nuȯ#! /usr/bin/perl # # 1999 (c) Piotr Roszatycki # This software is under GNU license # last modification: 1999-12-08 # # apt sub quote { $_ = shift(@_); s/([^\w\/.+-])/\\$1/g; return($_); } sub bt { my ($dt) = @_; my (@time); @time = localtime($dt); $bt = sprintf "%02d-%02d-%d %02d:%02d", $time[4] + 1, $time[3], $time[5] + 1900, $time[2], $time[1]; return $bt; } sub ft { my ($f) = @_; return "d" if -d $f; return "l" if -l $f; return "p" if -p $f; return "S" if -S $f; return "b" if -b $f; return "c" if -c $f; return "-"; } sub fm { my ($n) = @_; my ($m); if( $n & 0400 ) { $m .= "r"; } else { $m .= "-"; } if( $n & 0200 ) { $m .= "w"; } else { $m .= "-"; } if( $n & 04000 ) { $m .= "s"; } elsif( $n & 0100 ) { $m .= "x"; } else { $m .= "-"; } if( $n & 0040 ) { $m .= "r"; } else { $m .= "-"; } if( $n & 0020 ) { $m .= "w"; } else { $m .= "-"; } if( $n & 02000 ) { $m .= "s"; } elsif( $n & 0010 ) { $m .= "x"; } else { $m .= "-"; } if( $n & 0004 ) { $m .= "r"; } else { $m .= "-"; } if( $n & 0002 ) { $m .= "w"; } else { $m .= "-"; } if( $n & 01000 ) { $m .= "t"; } elsif( $n & 0001 ) { $m .= "x"; } else { $m .= "-"; } return $m; } sub ls { my ($file,$path,$mode) = @_; if (-f $file) { my @stat = stat(_); # mode, nlink, uid, gid, size, mtime, filename printf "%s %d %d %d %d %s %s\n", $mode || ft($file).fm($stat[2] & 07777), $stat[3], $stat[4], $stat[5], $stat[7], bt($stat[9]), $path; } } $DATE=bt(time()); sub list { my ($pkg, $fn, $dn, $sz, $bt); my($check,$stats,$config); chop($check = `apt-get -q check 2>/dev/null`); chop($available = `apt-cache dumpavail 2>/dev/null`); chop($stats = `apt-cache stats 2>/dev/null`); chop($config = `apt-config dump 2>&1`); $sz = length($check); print "-r--r--r-- 1 root root $sz $DATE CHECK\n"; $sz = length($available); print "-r--r--r-- 1 root root $sz $DATE AVAILABLE\n"; $sz = length($stats); print "-r--r--r-- 1 root root $sz $DATE STATS\n"; $sz = length($config); print "-r--r--r-- 1 root root $sz $DATE CONFIG\n"; $sz = length($pressupdate); print "-r-xr--r-- 1 root root $sz $DATE UPDATE\n"; $sz = length($pressupgrade); print "-r-xr--r-- 1 root root $sz $DATE UPGRADE\n"; print "-r-xr--r-- 1 root root $sz $DATE DIST-UPGRADE\n"; ls("/etc/apt/sources.list","sources.list"); ls('/etc/apt/apt.conf','apt.conf') if (-f '/etc/apt/apt.conf'); print "drwxr-xr-x 1 root root 0 $DATE all\n"; if ( open(PIPEIN, "find /var/cache/apt/archives -type f |") ) { while() { chop; next if /\/lock$/; my $file = $_; s%/var/cache/apt/archives/%CACHE/%; ls($file, $_); } close PIPEIN; } my %sects = (); my %debd = (); my %deba = (); open STAT, "/var/lib/dpkg/status" or exit 1; while( ) { chop; if( /^([\w-]*): (.*)/ ) { $pkg = $2 if( lc($1) eq 'package' ); $debd{$pkg}{lc($1)} = $2; } } close STAT; foreach $pkg (sort keys %debd) { next if $debd{$pkg}{status} =~ /not-installed/; $fn = $debd{$pkg}{package}. "_". $debd{$pkg}{version}; $dn = $debd{$pkg}{section}; if( ! $dn ) { $dn = "unknown"; } elsif( $dn =~ /^(non-us)$/i ) { $dn .= "/main"; } elsif( $dn !~ /\// ) { $dn = "main/". $dn; } unless( $sects{$dn} ) { my $sub = $dn; while( $sub =~ s!^(.*)/[^/]*$!$1! ) { unless( $sects{$sub} ) { print "drwxr-xr-x 1 root root 0 $DATE $sub/\n"; $sects{$sub} = 1; } } print "drwxr-xr-x 1 root root 0 $DATE $dn/\n"; $sects{$dn} = 1; } $sz = $debd{$pkg}{'status'} =~ /config-files/ ? 0 : $debd{$pkg}{'installed-size'} * 1024; @stat = stat("/var/lib/dpkg/info/".$debd{$pkg}{package}.".list"); $bt = bt($stat[9]); print "-rw-r--r-- 1 root root $sz $bt $dn/$fn.debd\n"; print "lrwxrwxrwx 1 root root $sz $bt all/$fn.debd -> ../$dn/$fn.debd\n"; } open STAT, "apt-cache dumpavail |" or exit 1; while( ) { chop; if( /^([\w-]*): (.*)/ ) { $pkg = $2 if( lc($1) eq 'package' ); $deba{$pkg}{lc($1)} = $2; } } close STAT; foreach $pkg (sort keys %deba) { next if $deba{$pkg}{version} eq $debd{$pkg}{version}; $fn = $deba{$pkg}{package}. "_". $deba{$pkg}{version}; $dn = $deba{$pkg}{section}; if( ! $dn ) { $dn = "unknown"; } elsif( $dn =~ /^(non-us)$/i ) { $dn .= "/main"; } elsif( $dn !~ /\// ) { $dn = "main/". $dn; } unless( $sects{$dn} ) { my $sub = $dn; while( $sub =~ s!^(.*)/[^/]*$!$1! ) { unless( $sects{$sub} ) { print "drwxr-xr-x 1 root root 0 $DATE $sub/\n"; $sects{$sub} = 1; } } print "drwxr-xr-x 1 root root 0 $DATE $dn/\n"; $sects{$dn} = 1; } $sz = $deba{$pkg}{'status'} =~ /config-files/ ? 0 : $deba{$pkg}{'installed-size'} * 1024; print "-rw-r--r-- 1 root root $sz $DATE $dn/$fn.deba\n"; print "lrwxrwxrwx 1 root root $sz $DATE all/$fn.deba -> ../$dn/$fn.deba\n"; } } sub copyout { my($archive,$filename) = @_; my $qarchive = quote($archive); my $qfilename = quote($filename); if( $archive eq 'CHECK' ) { system("apt-get -q check > $qfilename"); } elsif( $archive eq 'AVAILABLE' ) { system("apt-cache dumpavail > $qfilename"); } elsif( $archive eq 'STATS' ) { system("apt-cache stats > $qfilename"); } elsif( $archive eq 'CONFIG' ) { system("(apt-config dump 2>&1) > $qfilename"); } elsif( $archive eq 'UPDATE' ) { open O, ">$filename"; print O $pressupdate; close O; } elsif( $archive eq 'UPGRADE' || $archive eq 'DIST-UPGRADE' ) { open O, ">$filename"; print O $pressupgrade; close O; } elsif( $archive eq 'apt.conf' ) { system("cp /etc/apt/apt.conf $qfilename"); } elsif( $archive eq 'sources.list' ) { system("cp /etc/apt/sources.list $qfilename"); } elsif( $archive =~ /^CACHE\// ) { $archive =~ s%^CACHE/%/var/cache/apt/archives/%; system("cp $qarchive $qfilename"); } else { open O, ">$filename"; print O $archive, "\n"; close O; } } sub copyin { my($archive,$filename) = @_; my $qarchive = quote($archive); my $qfilename = quote($filename); if( $archive =~ /\.deb$/ ) { system("dpkg -i $qfilename>/dev/null"); } elsif( $archive eq 'apt.conf' ) { system("cp $qfilename /etc/apt/apt.conf"); } elsif( $archive eq 'sources.list' ) { system("cp $qfilename /etc/apt/sources.list"); } elsif( $archive =~ /^CACHE\// ) { $qarchive =~ s%^CACHE/%/var/cache/apt/archives/%; system("cp $qfilename $qarchive"); } else { die "extfs: cannot create regular file \`$archive\': Permission denied\n"; } } sub run { my($archive,$filename) = @_; if( $archive eq 'UPDATE' ) { system("apt-get update"); } elsif( $archive eq 'UPGRADE' ) { system("apt-get upgrade -u"); } elsif( $archive eq 'DIST-UPGRADE' ) { system("apt-get dist-upgrade -u"); } else { die "extfs: $archive: command not found\n"; } } sub rm { my($archive) = @_; my $qarchive = quote($archive); if( $archive =~ /^CACHE\// ) { $qarchive =~ s%^CACHE/%/var/cache/apt/archives/%; system("rm -f $qarchive"); } elsif( $archive eq 'apt.conf' ) { system("rm -f /etc/apt/apt.conf"); } elsif( $archive eq 'sources.list' ) { system("rm -f /etc/apt/sources.list"); } elsif( $archive =~ /\.debd?$/ ) { # uncommented and changed to use dpkg - alpha my $qname = $qarchive; $qname =~ s%.*/%%g; $qname =~ s%_.*%%g; system("dpkg --remove $qname >/dev/null"); die("extfs: $archive: Operation not permitted\n") if $? != 0; } else { die "extfs: $archive: Operation not permitted\n"; } } $pressupdate=<S extfs.d/trpmnuȯ#! /bin/sh # # Browse contents of an installed RPM package. # This filesystem works on the entries of the "rpms" filesystem. # # Written by Erik Troan (ewt@redhat.com) 1996 # Jakub Jelinek (jj@sunsite.mff.cuni.cz) 1996 # Tomasz Koczko (kloczek@rudy.mif.pg.gda.pl) 1997 # minor changes by Wojtek Pilorz (wpilorz@bdk.lublin.pl) 1997 # minor changes by Michele Marziani (marziani@fe.infn.it) 1997 # slight changes to put rpm to Trpm by Balazs Nagy (julian7@kva.hu) 1998 # locale bugfix by Michal Svec (rebel@penguin.cz) 2000 # (C) 1996 The Free Software Foundation. # # # override any locale for dates unset LC_ALL LC_TIME=C export LC_TIME if rpm --nosignature --version >/dev/null 2>&1; then RPM="rpm --nosignature" else RPM="rpm" fi mcrpmfs_list () { # set MCFASTRPM_DFLT to 1 for faster rpm files handling by default, to 0 for # slower handling MCFASTRPM_DFLT=0 if test -z "$MCFASTRPM"; then MCFASTRPM=$MCFASTRPM_DFLT fi FILEPREF="-r--r--r-- 1 root root " DESC=`$RPM -qi -- "$1"` DATE=`$RPM -q --qf "%{BUILDTIME:date}" -- "$1" | cut -c 5-11,21-24` HEADERSIZE=`echo "$DESC" | wc -c` echo "-r--r--r-- 1 root root $HEADERSIZE $DATE HEADER" echo "-r-xr-xr-x 1 root root 40 $DATE UNINSTALL" echo "dr-xr-xr-x 3 root root 0 $DATE INFO" echo "$FILEPREF 0 $DATE INFO/NAME-VERSION-RELEASE" echo "$FILEPREF 0 $DATE INFO/GROUP" echo "$FILEPREF 0 $DATE INFO/BUILDHOST" echo "$FILEPREF 0 $DATE INFO/SOURCERPM" if test "$MCFASTRPM" = 0 ; then test "`$RPM -q --qf \"%{DISTRIBUTION}\" -- "$1"`" = "(none)" || echo "$FILEPREF 0 $DATE INFO/DISTRIBUTION" test "`$RPM -q --qf \"%{VENDOR}\" -- "$1"`" = "(none)" || echo "$FILEPREF 0 $DATE INFO/VENDOR" test "`$RPM -q --qf \"%{DESCRIPTION}\" -- "$1"`" = "(none)" || echo "$FILEPREF 0 $DATE INFO/DESCRIPTION" test "`$RPM -q --qf \"%{SUMMARY}\" -- "$1"`" = "(none)" || echo "$FILEPREF 0 $DATE INFO/SUMMARY" if test "`$RPM -q --qf \"%{RPMTAG_PREIN}%{RPMTAG_POSTIN}%{RPMTAG_PREUN}%{RPMTAG_POSTUN}%{VERIFYSCRIPT}\" -- "$1"`" != "(none)(none)(none)(none)(none)"; then echo "dr-xr-xr-x 1 root root 0 $DATE INFO/SCRIPTS" test "`$RPM -q --qf \"%{RPMTAG_PREIN}\" -- "$1"`" = '(none)' || echo "$FILEPREF 0 $DATE INFO/SCRIPTS/PREIN" test "`$RPM -q --qf \"%{RPMTAG_POSTIN}\" -- "$1"`" = '(none)' || echo "$FILEPREF 0 $DATE INFO/SCRIPTS/POSTIN" test "`$RPM -q --qf \"%{RPMTAG_PREUN}\" -- "$1"`" = '(none)' || echo "$FILEPREF 0 $DATE INFO/SCRIPTS/PREUN" test "`$RPM -q --qf \"%{RPMTAG_POSTUN}\" -- "$1"`" = '(none)' || echo "$FILEPREF 0 $DATE INFO/SCRIPTS/POSTUN" test "`$RPM -q --qf \"%{VERIFYSCRIPT}\" -- "$1"`" = '(none)' || echo "$FILEPREF 0 $DATE INFO/SCRIPTS/VERIFYSCRIPT" echo "$FILEPREF 0 $DATE INFO/SCRIPTS/ALL" fi else echo "$FILEPREF 0 $DATE INFO/DISTRIBUTION" echo "$FILEPREF 0 $DATE INFO/VENDOR" echo "$FILEPREF 0 $DATE INFO/DESCRIPTION" echo "$FILEPREF 0 $DATE INFO/SUMMARY" echo "dr-xr-xr-x 1 root root 0 $DATE INFO/SCRIPTS" echo "$FILEPREF 0 $DATE INFO/SCRIPTS/PREIN" echo "$FILEPREF 0 $DATE INFO/SCRIPTS/POSTIN" echo "$FILEPREF 0 $DATE INFO/SCRIPTS/PREUN" echo "$FILEPREF 0 $DATE INFO/SCRIPTS/POSTUN" echo "$FILEPREF 0 $DATE INFO/SCRIPTS/VERIFYSCRIPT" echo "$FILEPREF 0 $DATE INFO/SCRIPTS/ALL" fi if test "$MCFASTRPM" = 0 ; then test "`$RPM -q --qf \"%{PACKAGER}\" -- "$1"`" = "(none)" || echo "$FILEPREF 0 $DATE INFO/PACKAGER" test "`$RPM -q --qf \"%{URL}\" -- "$1"`" = "(none)" || echo "$FILEPREF 0 $DATE INFO/URL" test "`$RPM -q --qf \"%{EPOCH}\" -- "$1"`" = "(none)" || echo "$FILEPREF 0 $DATE INFO/EPOCH" test "`$RPM -q --qf \"%{LICENSE}\" -- "$1"`" = "(none)" || echo "$FILEPREF 0 $DATE INFO/LICENSE" else echo "$FILEPREF 0 $DATE INFO/PACKAGER" echo "$FILEPREF 0 $DATE INFO/URL" echo "$FILEPREF 0 $DATE INFO/EPOCH" echo "$FILEPREF 0 $DATE INFO/LICENSE" fi echo "$FILEPREF 0 $DATE INFO/BUILDTIME" echo "$FILEPREF 0 $DATE INFO/RPMVERSION" echo "$FILEPREF 0 $DATE INFO/OS" echo "$FILEPREF 0 $DATE INFO/SIZE" if test "$MCFASTRPM" != 0 ; then $RPM -q --qf "[%{REQUIRENAME}\n]" -- "$1" | grep "(none)" > /dev/null || echo "$FILEPREF 0 $DATE INFO/REQUIRENAME" $RPM -q --qf "[%{OBSOLETES}\n]" -- "$1" | grep "(none)" > /dev/null || echo "$FILEPREF 0 $DATE INFO/OBSOLETES" $RPM -q --qf "[%{PROVIDES}\n]" -- "$1" | grep "(none)" > /dev/null || echo "$FILEPREF 0 $DATE INFO/PROVIDES" $RPM -q --qf "[%{CONFLICTS}\n]" -- "$1" | grep "(none)" > /dev/null || echo "$FILEPREF 0 $DATE INFO/CONFLICTS" test "`$RPM -q --qf \"%{CHANGELOGTEXT}\" -- "$1"`" = "(none)" || echo "$FILEPREF 0 $DATE INFO/CHANGELOG" else echo "$FILEPREF 0 $DATE INFO/REQUIRENAME" echo "$FILEPREF 0 $DATE INFO/OBSOLETES" echo "$FILEPREF 0 $DATE INFO/PROVIDES" echo "$FILEPREF 0 $DATE INFO/CONFLICTS" echo "$FILEPREF 0 $DATE INFO/CHANGELOG" fi $RPM -qlv -- "$1" | grep '^[A-Za-z0-9-]' } mcrpmfs_copyout () { case "$2" in HEADER) $RPM -qi -- "$1" > "$3"; exit 0;; UNINSTALL) echo "# Run this to uninstall this RPM package" > "$3"; exit 0;; INFO/NAME-VERSION-RELEASE) $RPM -q --qf "%{NAME}-%{VERSION}-%{RELEASE}\n" -- "$1" > "$3"; exit 0;; INFO/RELEASE) $RPM -q --qf "%{RELEASE}\n" -- "$1" > "$3"; exit 0;; INFO/GROUP) $RPM -q --qf "%{GROUP}\n" -- "$1" > "$3"; exit 0;; INFO/DISTRIBUTION) $RPM -q --qf "%{DISTRIBUTION}\n" -- "$1" > "$3"; exit 0;; INFO/VENDOR) $RPM -q --qf "%{VENDOR}\n" -- "$1" > "$3"; exit 0;; INFO/BUILDHOST) $RPM -q --qf "%{BUILDHOST}\n" -- "$1" > "$3"; exit 0;; INFO/SOURCERPM) $RPM -q --qf "%{SOURCERPM}\n" -- "$1" > "$3"; exit 0;; INFO/DESCRIPTION) $RPM -q --qf "%{DESCRIPTION}\n" -- "$1" > "$3"; exit 0;; INFO/PACKAGER) $RPM -q --qf "%{PACKAGER}\n" -- "$1" > "$3"; exit 0;; INFO/URL) $RPM -q --qf "%{URL}\n" -- "$1" > "$3"; exit 0;; INFO/BUILDTIME) $RPM -q --qf "%{BUILDTIME:date}\n" -- "$1" > "$3"; exit 0;; INFO/EPOCH) $RPM -q --qf "%{EPOCH}\n" -- "$1" > "$3"; exit 0;; INFO/LICENSE) $RPM -q --qf "%{LICENSE}\n" -- "$1" > "$3"; exit 0;; INFO/RPMVERSION) $RPM -q --qf "%{RPMVERSION}\n" -- "$1" > "$3"; exit 0;; INFO/REQUIRENAME) $RPM -q --qf "[%{REQUIRENAME} %{REQUIREFLAGS:depflags} %{REQUIREVERSION}\n]" -- "$1" > "$3"; exit 0;; INFO/OBSOLETES) $RPM -q --qf "[%{OBSOLETENAME} %|OBSOLETEFLAGS?{%{OBSOLETEFLAGS:depflags} %{OBSOLETEVERSION}}:{}|\n]" -- "$1" > "$3"; exit 0;; INFO/PROVIDES) $RPM -q --qf "[%{PROVIDES}\n]" -- "$1" > "$3"; exit 0;; INFO/CONFLICTS) $RPM -q --qf "[%{CONFLICTS}\n]" -- "$1" > "$3"; exit 0;; INFO/SCRIPTS/PREIN) $RPM -q --qf "%{RPMTAG_PREIN}\n" -- "$1" > "$3"; exit 0;; INFO/SCRIPTS/POSTIN) $RPM -q --qf "%{RPMTAG_POSTIN}\n" -- "$1" > "$3"; exit 0;; INFO/SCRIPTS/PREUN) $RPM -q --qf "%{RPMTAG_PREUN}\n" -- "$1" > "$3"; exit 0;; INFO/SCRIPTS/POSTUN) $RPM -q --qf "%{RPMTAG_POSTUN}\n" -- "$1" > "$3"; exit 0;; INFO/SCRIPTS/VERIFYSCRIPT) $RPM -q --qf "%{VERIFYSCRIPT}\n" -- "$1" > "$3"; exit 0;; INFO/SCRIPTS/ALL) $RPM -q --scripts -- "$1" > "$3"; exit 0;; INFO/SUMMARY) $RPM -q --qf "%{SUMMARY}\n" -- "$1" > "$3"; exit 0;; INFO/OS) $RPM -q --qf "%{OS}\n" -- "$1" > "$3"; exit 0;; INFO/CHANGELOG) $RPM -q --qf "[* %{CHANGELOGTIME:date} %{CHANGELOGNAME}\n%{CHANGELOGTEXT}\n\n]\n" -- "$1" > "$3"; exit 0;; INFO/SIZE) $RPM -q --qf "%{SIZE} bytes\n" -- "$1" > "$3"; exit 0;; *) cp "/$2" "$3" esac } mcrpmfs_run () { case "$2" in UNINSTALL) echo "Uninstalling $1"; rpm -e -- "$1"; exit 0;; esac } name=`sed 's/.*\///;s/\.trpm$//' "$2"` case "$1" in list) mcrpmfs_list "$name"; exit 0;; copyout) mcrpmfs_copyout "$name" "$3" "$4"; exit 0;; run) mcrpmfs_run "$name" "$3"; exit 1;; esac exit 1 PK!y<;; extfs.d/uzipnuȯ#! /usr/bin/perl -w # # zip file archive Virtual File System for Midnight Commander # Version 1.4.0 (2001-08-07). # # (C) 2000-2001 Oskar Liljeblad . # use POSIX; use File::Basename; use strict; # # Configuration options # # Location of the zip program my $app_zip = "/usr/bin/zip"; # Location of the unzip program my $app_unzip = $ENV{MC_TEST_EXTFS_LIST_CMD} || "/usr/bin/unzip"; # Set this to 1 if zipinfo (unzip -Z) is to be used (recommended), otherwise 0. my $op_has_zipinfo = exists($ENV{MC_TEST_EXTFS_HAVE_ZIPINFO}) ? $ENV{MC_TEST_EXTFS_HAVE_ZIPINFO} : 0; # Command used to list archives (zipinfo mode) my $cmd_list_zi = "$app_unzip -Z -l -T"; # Command used to list archives (non-zipinfo mode) my $cmd_list_nzi = "$app_unzip -qq -v"; # Command used to add a file to the archive my $cmd_add = "$app_zip -g"; # Command used to add a link file to the archive (unused) my $cmd_addlink = "$app_zip -g -y"; # Command used to delete a file from the archive my $cmd_delete = "$app_zip -d"; # Command used to extract a file to standard out my $cmd_extract = "$app_unzip -p"; # -rw-r--r-- 2.2 unx 2891 tx 1435 defN 20000330.211927 ./edit.html # (perm) (?) (?) (size) (?) (zippedsize) (method) (yyyy)(mm)(dd).(HH)(MM)(SS) (fname) my $regex_zipinfo_line = qr"^(\S{7,10})\s+(\d+\.\d+)\s+(\S+)\s+(\d+)\s+(\S\S)\s+(\d+)\s+(\S{4})\s+(\d{4})(\d\d)(\d\d)\.(\d\d)(\d\d)(\d\d)\s(.*)$"; # 2891 Defl:N 1435 50% 03-30-00 21:19 50cbaaf8 ./edit.html # (size) (method) (zippedsize) (zipratio) (mm)-(dd)-(yy|yyyy) (HH):(MM) (cksum) (fname) # or: (yyyy)-(mm)-(dd) my $regex_nonzipinfo_line = qr"^\s*(\d+)\s+(\S+)\s+(\d+)\s+(-?\d+\%)\s+(\d+)-(\d?\d)-(\d+)\s+(\d?\d):(\d\d)\s+([0-9a-f]+)\s\s(.*)$"; # # Main code # die "uzip: missing command and/or archive arguments\n" if ($#ARGV < 1); # Initialization of some global variables my $cmd = shift; my %known = ( './' => 1 ); my %pending = (); my $oldpwd = POSIX::getcwd(); my $archive = shift; my $aarchive = absolutize($archive, $oldpwd); my $cmd_list = ($op_has_zipinfo ? $cmd_list_zi : $cmd_list_nzi); my ($qarchive, $aqarchive) = map (quotemeta, $archive, $aarchive); # Strip all "." and ".." path components from a pathname. sub zipfs_canonicalize_pathname($) { my ($fname) = @_; $fname =~ s,/+,/,g; $fname =~ s,(^|/)(?:\.?\./)+,$1,; return $fname; } # The Midnight Commander never calls this script with archive pathnames # starting with either "./" or "../". Some ZIP files contain such names, # so we need to build a translation table for them. my $zipfs_realpathname_table = undef; sub zipfs_realpathname($) { my ($fname) = @_; if (!defined($zipfs_realpathname_table)) { $zipfs_realpathname_table = {}; if (!open(ZIP, "$cmd_list $qarchive |")) { return $fname; } foreach my $line () { $line =~ s/\r*\n*$//; if ($op_has_zipinfo) { if ($line =~ $regex_zipinfo_line) { my ($fname) = ($14); $zipfs_realpathname_table->{zipfs_canonicalize_pathname($fname)} = $fname; } } else { if ($line =~ $regex_nonzipinfo_line) { my ($fname) = ($11); $zipfs_realpathname_table->{zipfs_canonicalize_pathname($fname)} = $fname; } } } if (!close(ZIP)) { return $fname; } } if (exists($zipfs_realpathname_table->{$fname})) { return $zipfs_realpathname_table->{$fname}; } return $fname; } if ($cmd eq 'list') { &mczipfs_list(@ARGV); } if ($cmd eq 'rm') { &mczipfs_rm(@ARGV); } if ($cmd eq 'rmdir') { &mczipfs_rmdir(@ARGV); } if ($cmd eq 'mkdir') { &mczipfs_mkdir(@ARGV); } if ($cmd eq 'copyin') { &mczipfs_copyin(@ARGV); } if ($cmd eq 'copyout') { &mczipfs_copyout(@ARGV); } if ($cmd eq 'run') { &mczipfs_run(@ARGV); } #if ($cmd eq 'mklink') { &mczipfs_mklink(@ARGV); } # Not supported by MC extfs #if ($cmd eq 'linkout') { &mczipfs_linkout(@ARGV); } # Not supported by MC extfs exit 1; # Remove a file from the archive. sub mczipfs_rm { my ($qfile) = map { &zipquotemeta(zipfs_realpathname($_)) } @_; # "./" at the beginning of pathnames is stripped by Info-ZIP, # so convert it to "[.]/" to prevent stripping. $qfile =~ s/^\\\./[.]/; &checkargs(1, 'archive file', @_); &safesystem("$cmd_delete $qarchive $qfile >/dev/null"); exit; } # Remove an empty directory from the archive. # The only difference from mczipfs_rm is that we append an # additional slash to the directory name to remove. I am not # sure this is absolutely necessary, but it doesn't hurt. sub mczipfs_rmdir { my ($qfile) = map { &zipquotemeta(zipfs_realpathname($_)) } @_; &checkargs(1, 'archive directory', @_); &safesystem("$cmd_delete $qarchive $qfile/ >/dev/null", 12); exit; } # Extract a file from the archive. # Note that we don't need to check if the file is a link, # because mc apparently doesn't call copyout for symbolic links. sub mczipfs_copyout { my ($qafile, $qfsfile) = map { &zipquotemeta(zipfs_realpathname($_)) } @_; &checkargs(1, 'archive file', @_); &checkargs(2, 'local file', @_); &safesystem("$cmd_extract $qarchive $qafile > $qfsfile", 11); exit; } # Add a file to the archive. # This is done by making a temporary directory, in which # we create a symlink the original file (with a new name). # Zip is then run to include the real file in the archive, # with the name of the symbolic link. # Here we also doesn't need to check for symbolic links, # because the mc extfs doesn't allow adding of symbolic # links. sub mczipfs_copyin { my ($afile, $fsfile) = @_; &checkargs(1, 'archive file', @_); &checkargs(2, 'local file', @_); my ($qafile) = quotemeta $afile; $fsfile = &absolutize($fsfile, $oldpwd); my $adir = File::Basename::dirname($afile); my $tmpdir = &mktmpdir(); chdir $tmpdir || &croak("chdir $tmpdir failed"); &mkdirs($adir, 0700); symlink ($fsfile, $afile) || &croak("link $afile failed"); &safesystem("$cmd_add $aqarchive $qafile >/dev/null"); unlink $afile || &croak("unlink $afile failed"); &rmdirs($adir); chdir $oldpwd || &croak("chdir $oldpwd failed"); rmdir $tmpdir || &croak("rmdir $tmpdir failed"); exit; } # Add an empty directory the the archive. # This is similar to mczipfs_copyin, except that we don't need # to use symlinks. sub mczipfs_mkdir { my ($dir) = @_; &checkargs(1, 'directory', @_); my ($qdir) = quotemeta $dir; my $tmpdir = &mktmpdir(); chdir $tmpdir || &croak("chdir $tmpdir failed"); &mkdirs($dir, 0700); &safesystem("$cmd_add $aqarchive $qdir >/dev/null"); &rmdirs($dir); chdir $oldpwd || &croak("chdir $oldpwd failed"); rmdir $tmpdir || &croak("rmdir $tmpdir failed"); exit; } # Add a link to the archive. This operation is not used yet, # because it is not supported by the MC extfs. sub mczipfs_mklink { my ($linkdest, $afile) = @_; &checkargs(1, 'link destination', @_); &checkargs(2, 'archive file', @_); my ($qafile) = quotemeta $afile; my $adir = File::Basename::dirname($afile); my $tmpdir = &mktmpdir(); chdir $tmpdir || &croak("chdir $tmpdir failed"); &mkdirs($adir, 0700); symlink ($linkdest, $afile) || &croak("link $afile failed"); &safesystem("$cmd_addlink $aqarchive $qafile >/dev/null"); unlink $afile || &croak("unlink $afile failed"); &rmdirs($adir); chdir $oldpwd || &croak("chdir $oldpwd failed"); rmdir $tmpdir || &croak("rmdir $tmpdir failed"); exit; } # This operation is not used yet, because it is not # supported by the MC extfs. sub mczipfs_linkout { my ($afile, $fsfile) = @_; &checkargs(1, 'archive file', @_); &checkargs(2, 'local file', @_); my ($qafile) = map { &zipquotemeta($_) } $afile; my $linkdest = &get_link_destination($afile); symlink ($linkdest, $fsfile) || &croak("link $fsfile failed"); exit; } # Use unzip to find the link destination of a certain file in the # archive. sub get_link_destination { my ($afile) = @_; my ($qafile) = map { &zipquotemeta($_) } $afile; my $linkdest = safeticks("$cmd_extract $qarchive $qafile"); &croak ("extract failed", "link destination of $afile not found") if (!defined $linkdest || $linkdest eq ''); return $linkdest; } # List files in the archive. # Because mc currently doesn't allow a file's parent directory # to be listed after the file itself, we need to do some # rearranging of the output. Most of this is done in # checked_print_file. sub mczipfs_list { open (PIPE, "$cmd_list $qarchive |") || &croak("$app_unzip failed"); if ($op_has_zipinfo) { while () { chomp; next if /^Archive:/; next if /^\d+ file/; next if /^Empty zipfile\.$/; my @match = /$regex_zipinfo_line/; next if ($#match != 13); &checked_print_file(@match); } } else { while () { chomp; my @match = /$regex_nonzipinfo_line/; next if ($#match != 10); # Massage the date. my ($year, $month, $day) = $match[4] > 12 ? ($match[4], $match[5], $match[6]) # 4,5,6 = Y,M,D : ($match[6], $match[4], $match[5]); # 4,5,6 = M,D,Y $year += ($year < 70 ? 2000 : 1900) if $year < 100; # Fix 2-digit year. my @rmatch = ('', '', 'unknown', $match[0], '', $match[2], $match[1], $year, $month, $day, $match[7], $match[8], "00", $match[10]); &checked_print_file(@rmatch); } } if (!close (PIPE)) { &croak("$app_unzip failed") if ($! != 0); &croak("$app_unzip failed", 'non-zero exit status ('.($? >> 8).')') } foreach my $key (sort keys %pending) { foreach my $file (@{ $pending{$key} }) { &print_file(@{ $file }); } } exit; } # Execute a file in the archive, by first extracting it to a # temporary directory. The name of the extracted file will be # the same as the name of it in the archive. sub mczipfs_run { my ($afile) = @_; &checkargs(1, 'archive file', @_); my $qafile = &zipquotemeta(zipfs_realpathname($afile)); my $tmpdir = &mktmpdir(); my $tmpfile = File::Basename::basename($afile); chdir $tmpdir || &croak("chdir $tmpdir failed"); &safesystem("$cmd_extract $aqarchive $qafile > $tmpfile"); chmod 0700, $tmpfile; &safesystem("./$tmpfile"); unlink $tmpfile || &croak("rm $tmpfile failed"); chdir $oldpwd || &croak("chdir $oldpwd failed"); rmdir $tmpdir || &croak("rmdir $tmpdir failed"); exit; } # This is called prior to printing the listing of a file. # A check is done to see if the parent directory of the file has already # been printed or not. If it hasn't, we must cache it (in %pending) and # print it later once the parent directory has been listed. When all # files have been processed, there may still be some that haven't been # printed because their parent directories weren't listed at all. These # files are dealt with in mczipfs_list. sub checked_print_file { my @waiting = ([ @_ ]); while ($#waiting != -1) { my $item = shift @waiting; my $filename = ${$item}[13]; my $dirname = File::Basename::dirname($filename) . '/'; if (exists $known{$dirname}) { &print_file(@{$item}); if ($filename =~ /\/$/) { $known{$filename} = 1; if (exists $pending{$filename}) { push @waiting, @{ $pending{$filename} }; delete $pending{$filename}; } } } else { push @{$pending{$dirname}}, $item; } } } # Print the mc extfs listing of a file from a set of parsed fields. # If the file is a link, we extract it from the zip archive and # include the output as the link destination. Because this output # is not newline terminated, we must execute unzip once for each # link file encountered. sub print_file { my ($perms,$zipver,$platform,$realsize,$format,$cmpsize,$comp,$year,$mon,$day,$hours,$mins,$secs,$filename) = @_; if ($platform ne 'unx') { $perms = ($filename =~ /\/$/ ? 'drwxr-xr-x' : '-rw-r--r--'); } # adjust abnormal perms on directory if ($platform eq 'unx' && $filename =~ /\/$/ && $perms =~ /^\?(.*)$/) { $perms = 'd'.$1; } printf "%-10s 1 %-8d %-8d %8s %s/%s/%s %s:%s:%s %s", $perms, $<, $(, $realsize, $mon, $day, $year, $hours, $mins, $secs, $filename; if ($platform eq 'unx' && $perms =~ /^l/) { my $linkdest = &get_link_destination($filename); print " -> $linkdest"; } print "\n"; } # Die with a reasonable error message. sub croak { my ($command, $desc) = @_; die "uzip ($cmd): $command - $desc\n" if (defined $desc); die "uzip ($cmd): $command - $!\n"; } # Make a set of directories, like the command `mkdir -p'. # This subroutine has been tailored for this script, and # because of that, it ignored the directory name '.'. sub mkdirs { my ($dirs, $mode) = @_; $dirs = &cleandirs($dirs); return if ($dirs eq '.'); my $newpos = -1; while (($newpos = index($dirs, '/', $newpos+1)) != -1) { my $dir = substr($dirs, 0, $newpos); mkdir ($dir, $mode) || &croak("mkdir $dir failed"); } mkdir ($dirs, $mode) || &croak("mkdir $dirs failed"); } # Remove a set of directories, failing if the directories # contain other files. # This subroutine has been tailored for this script, and # because of that, it ignored the directory name '.'. sub rmdirs { my ($dirs) = @_; $dirs = &cleandirs($dirs); return if ($dirs eq '.'); rmdir $dirs || &croak("rmdir $dirs failed"); my $newpos = length($dirs); while (($newpos = rindex($dirs, '/', $newpos-1)) != -1) { my $dir = substr($dirs, 0, $newpos); rmdir $dir || &croak("rmdir $dir failed"); } } # Return a semi-canonical directory name. sub cleandirs { my ($dir) = @_; $dir =~ s:/+:/:g; $dir =~ s:/*$::; return $dir; } # Make a temporary directory with mode 0700. sub mktmpdir { use File::Temp qw(mkdtemp); my $template = "/tmp/mcuzipfs.XXXXXX"; $template="$ENV{MC_TMPDIR}/mcuzipfs.XXXXXX" if ($ENV{MC_TMPDIR}); return mkdtemp($template); } # Make a filename absolute and return it. sub absolutize { my ($file, $pwd) = @_; return "$pwd/$file" if ($file !~ /^\//); return $file; } # Like the system built-in function, but with error checking. # The other argument is an exit status to allow. sub safesystem { my ($command, @allowrc) = @_; my ($desc) = ($command =~ /^([^ ]*) */); $desc = File::Basename::basename($desc); system $command; my $rc = $?; &croak("`$desc' failed") if (($rc & 0xFF) != 0); if ($rc != 0) { $rc = $rc >> 8; foreach my $arc (@allowrc) { return if ($rc == $arc); } &croak("`$desc' failed", "non-zero exit status ($rc)"); } } # Like backticks built-in, but with error checking. sub safeticks { my ($command, @allowrc) = @_; my ($desc) = ($command =~ /^([^ ]*) /); $desc = File::Basename::basename($desc); my $out = `$command`; my $rc = $?; &croak("`$desc' failed") if (($rc & 0xFF) != 0); if ($rc != 0) { $rc = $rc >> 8; foreach my $arc (@allowrc) { return if ($rc == $arc); } &croak("`$desc' failed", "non-zero exit status ($rc)"); } return $out; } # Make sure enough arguments are supplied, or die. sub checkargs { my $count = shift; my $desc = shift; &croak('missing argument', $desc) if ($count-1 > $#_); } # Quote zip wildcard metacharacters. Unfortunately Info-ZIP zip and unzip # on unix interpret some wildcards in filenames, despite the fact that # the shell already does this. Thus this function. sub zipquotemeta { my ($name) = @_; my $out = ''; for (my $c = 0; $c < length $name; $c++) { my $ch = substr($name, $c, 1); $out .= '\\' if (index('*?[]\\', $ch) != -1); $out .= $ch; } return quotemeta($out); } PK!+hww extfs.d/uarjnuȯ#! /bin/sh # # Written by Viatcheslav Odintsov (2:5020/181) # (C) 2002 ARJ Software Russia. # # This is an updated parser for ARJ archives in Midnight Commander. You need # full ARJ rather than UNARJ. Open-source ARJ v 3.10 for Unix platforms can # be obtained here: # # - http://www.sourceforge.net/projects/arj/ # - http://arj.sourceforge.net/ ARJ="arj -+ -ja1" mcarjfs_list () { $ARJ v "$1" | gawk -v uuid=$(id -ru) ' { if (($0 ~ /^[0-9]+\) .*/)||($0 ~ /^------------ ---------- ---------- -----/)){ if (filestr ~ /^[0-9]+\) .*/) { printf "%s 1 %-8d %-8d %8d %02d-%02d-%02d %02d:%02d %s%s\n", perm, uid, gid, size, date[2], date[3], date[1], time[1], time[2], file, symfile perm="" file="" symfile="" filestr="" } } if ($0 ~ /^[0-9]+\) .*/) { filestr=$0 sub(/^[0-9]*\) /, "") file=$0 uid=uuid gid=0 } if ($0 ~ /^.* [0-9]+[\t ]+[0-9]+ [0-9]\.[0-9][0-9][0-9] [0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].*/) { size=$3 split($6, date, "-") split($7, time, ":") if ($8 ~ /^[rwx-]/) {perm=$8;} else {perm="-rw-r--r--"} } if ($0 ~ /^[\t ]+SymLink -> .*/) { symfile = " -> "$3 perm="l"substr(perm, 2) } if ($0 ~ /^[\t ]+Owner: UID [0-9]+\, GID [0-9]+/) { uid=$3 gid=$5 owner=1 } }' } mcarjfs_copyout () { $ARJ e -y "$1" "$2" -jw"$3" >/dev/null 2>/dev/null } umask 077 cmd="$1" shift case "$cmd" in list) mcarjfs_list "$@" ;; copyout) mcarjfs_copyout "$@" ;; *) exit 1 ;; esac exit 0 PK!rextfs.d/gitfs+nuȯ#!/bin/sh LANG=C export LANG LC_TIME=C export LC_TIME umask 077 prefix='[git]' gitfs_list() { DATE=`date +"%b %d %H:%M"` GIT_DIR="$2/.git" user=`whoami` git ls-files -v -c -m -d | sort -k 2 | uniq -f 1 | while read status fname do [ "$status" = "H" ] && status=" " [ "$status" = "C" ] && status="*" echo "-r--r--r-- 1 $user 0 0 $DATE `dirname $fname`/$prefix$status`basename $fname`" done } gitfs_copyout() { printf "%s\n" "$2" > "$4" b=`echo "$prefix"| wc -c` b=`expr "$b" + 1` # remove prefix from file name echo "`dirname "$3"`/`basename "$3" | tail -c+"$b"`" >> "$4" echo "git" >> "$4" } case "$1" in list) gitfs_list "$@" ;; copyout) gitfs_copyout "$@" ;; *) exit 1 ;; esac exit 0 PK!$$ extfs.d/uarcnuȯ#! /bin/sh # # ARC Virtual filesystem executive # Copyright (C) 2008 Jacques Pelletier # May be distributed under the terms of the GNU Public License # # # Define which archiver you are using with appropriate options ARC_LIST=${MC_TEST_EXTFS_LIST_CMD:-"arc v"} ARC_GET="arc x" ARC_PUT="arc a" ARC_DEL="arc d" # The 'list' command executive mc_arc_fs_list() { if [ "x$UID" = "x" ]; then UID=`id -ru 2>/dev/null` if [ "x$UID" = "x" ]; then UID=0 fi fi $ARC_LIST "$1" | gawk -v uid=$UID ' BEGIN { # Copied from uzoo.in. split("Jan:Feb:Mar:Apr:May:Jun:Jul:Aug:Sep:Oct:Nov:Dec", month_list, ":") for (i=1; i<=12; i++) { month[month_list[i]] = i } } /^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 %02d-%02d-%04d %02d:%02d %s\n", uid, 0, $2, month[$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 PK!砜)) extfs.d/debdnuȯ#! /usr/bin/perl # # 1999 (c) Piotr Roszatycki # This software is under GNU license # last modification: 1999-12-08 # # debd sub quote { $_ = shift(@_); s/([^\w\/.+-])/\\$1/g; return($_); } sub bt { my ($dt) = @_; my (@time); @time = localtime($dt); $bt = sprintf "%02d-%02d-%d %02d:%02d", $time[4] + 1, $time[3], $time[5] + 1900, $time[2], $time[1]; return $bt; } sub ft { my ($f) = @_; return "d" if -d $f; return "l" if -l $f; return "p" if -p $f; return "S" if -S $f; return "b" if -b $f; return "c" if -c $f; return "-"; } sub fm { my ($n) = @_; my ($m); if( $n & 0400 ) { $m .= "r"; } else { $m .= "-"; } if( $n & 0200 ) { $m .= "w"; } else { $m .= "-"; } if( $n & 04000 ) { $m .= "s"; } elsif( $n & 0100 ) { $m .= "x"; } else { $m .= "-"; } if( $n & 0040 ) { $m .= "r"; } else { $m .= "-"; } if( $n & 0020 ) { $m .= "w"; } else { $m .= "-"; } if( $n & 02000 ) { $m .= "s"; } elsif( $n & 0010 ) { $m .= "x"; } else { $m .= "-"; } if( $n & 0004 ) { $m .= "r"; } else { $m .= "-"; } if( $n & 0002 ) { $m .= "w"; } else { $m .= "-"; } if( $n & 01000 ) { $m .= "t"; } elsif( $n & 0001 ) { $m .= "x"; } else { $m .= "-"; } return $m; } sub ls { my ($file) = @_; my @stat = stat($file); # mode, nlink, uid, gid, size, mtime, filename printf "%s%s %d %d %d %d %s CONTENTS%s\n", ft($file), fm($stat[2] & 07777), $stat[3], $stat[4], $stat[5], $stat[7], bt($stat[9]), $file; } sub list { my($archive)=@_; my $qarchive = quote($archive); chop($date=`LC_ALL=C date "+%m-%d-%Y %H:%M"`); chop($info_size=`dpkg -s $qarchive | wc -c`); $repack_size=length($pressrepack); $reinstall_size=length($pressreinstall); $remove_size=length($pressremove); $purge_size=length($presspurge); $reconfigure_size=length($pressreconfigure); $reinstall_size=length($pressreinstall); $select_size=length($pressselect); $unselect_size=length($pressunselect); print "dr-xr-xr-x 1 root root 0 $date CONTENTS\n"; print "dr-xr-xr-x 1 root root 0 $date DEBIAN\n"; print "-r--r--r-- 1 root root $info_size $date INFO\n"; print "-r-xr--r-- 1 root root $purge_size $date DPKG-PURGE\n"; chop($status = `dpkg -s $qarchive | grep ^Status`); if( $status =~ /deinstall/ ) { print "-r-xr--r-- 1 root root $select_size $date DPKG-SELECT\n"; } elsif( $status =~ /install/ ) { print "-r-xr--r-- 1 root root $unselect_size $date DPKG-UNSELECT\n"; } if( $status !~ /config-files/ ) { if ( -x "/usr/bin/dpkg-repack" ) { print "-r-xr--r-- 1 root root $repack_size $date DPKG-REPACK\n"; } print "-r-xr--r-- 1 root root $remove_size $date DPKG-REMOVE\n"; if ( -x "/usr/bin/apt-get" ) { print "-r-xr--r-- 1 root root $remove_size $date APT-REMOVE\n"; print "-r-xr--r-- 1 root root $reinstall_size $date APT-REINSTALL\n"; print "-r-xr--r-- 1 root root $purge_size $date APT-PURGE\n"; } } if( -x "/usr/bin/dpkg-reconfigure" && -x "/var/lib/dpkg/info/$archive.config" ) { print "-r-xr--r-- 1 root root $reconfigure_size $date DPKG-RECONFIGURE\n"; } if ( open(PIPEIN, "LC_TIME=C LANG=C ls -l /var/lib/dpkg/info/$qarchive.* |") ) { while() { chop; next if /\.list$/; s%/var/lib/dpkg/info/$archive.%DEBIAN/%; print $_, "\n"; } close PIPEIN; } if ( open(LIST, "/var/lib/dpkg/info/$archive.list") ) { while() { chop; ls($_); } close LIST; } } sub copyout { my($archive,$filename,$destfile)=@_; my $qarchive = quote($archive); my $qfilename = quote($filename); my $qdestfile = quote($destfile); if($filename eq "INFO") { system("dpkg -s $qarchive > $qdestfile"); } elsif($filename eq "DPKG-REPACK") { if ( open(FILEOUT,">$destfile") ) { print FILEOUT $pressrepack; close FILEOUT; system("chmod a+x $qdestfile"); } } elsif($filename =~ /^DEBIAN/) { $qfilename=~s!^DEBIAN/!!; system("cat /var/lib/dpkg/info/$qarchive.$qfilename > $qdestfile"); } elsif($filename eq "DPKG-REMOVE" || $filename eq "APT-REMOVE") { if ( open(FILEOUT,">$destfile") ) { print FILEOUT $pressremove; close FILEOUT; system("chmod a+x $qdestfile"); } } elsif($filename eq "DPKG-PURGE" || $filename eq "APT-PURGE") { if ( open(FILEOUT,">$destfile") ) { print FILEOUT $presspurge; close FILEOUT; system("chmod a+x $qdestfile"); } } elsif($filename eq "DPKG-RECONFIGURE") { if ( open(FILEOUT,">$destfile") ) { print FILEOUT $pressreconfigure; close FILEOUT; system("chmod a+x $qdestfile"); } } elsif($filename eq "APT-REINSTALL") { if ( open(FILEOUT,">$destfile") ) { print FILEOUT $pressreinstall; close FILEOUT; system("chmod a+x $destfile"); } } elsif($filename eq "DPKG-SELECT") { if ( open(FILEOUT,">$destfile") ) { print FILEOUT $pressselect; close FILEOUT; system("chmod a+x $destfile"); } } elsif($filename eq "DPKG-UNSELECT") { if ( open(FILEOUT,">$destfile") ) { print FILEOUT $pressunselect; close FILEOUT; system("chmod a+x $qdestfile"); } } else { $qfilename=~s!^CONTENTS!!; system("cat $qfilename > $qdestfile"); } } sub run { my($archive,$filename)=@_; my $qarchive = quote($archive); my $qfilename = quote($filename); if($filename eq "DPKG-REMOVE") { system("dpkg --remove $qarchive"); } elsif($filename eq "APT-REMOVE") { system("apt-get remove $qarchive"); } elsif($filename eq "DPKG-PURGE") { system("dpkg --purge $qarchive"); } elsif($filename eq "APT-PURGE") { system("apt-get --purge remove $qarchive"); } elsif($filename eq "DPKG-REPACK") { system("dpkg-repack $qarchive"); } elsif($filename eq "DPKG-SELECT") { system("echo $aqrchive install | dpkg --set-selections"); } elsif($filename eq "DPKG-UNSELECT") { system("echo $qarchive deinstall | dpkg --set-selections"); } elsif($filename eq "APT-REINSTALL") { system("apt-get -u --reinstall install $qarchive"); } elsif($filename eq "DPKG-RECONFIGURE") { system("dpkg-reconfigure $qarchive"); } elsif($filename=~/^DEBIAN/) { $qfilename=~s!^DEBIAN!!; system("/var/lib/dpkg/info/$qarchive.$qfilename"); } else { $qfilename=~s!^CONTENTS!!; system($qfilename); } } $pressrepack=< # Some Bugfixes/workarounds by Sergiy Niskorodov # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . P7ZIP=`which 7z 2>/dev/null` || P7ZIP=`which 7za 2>/dev/null` || P7ZIP=`which 7zr 2>/dev/null` || P7ZIP="" # Let the test framework hook in: P7ZIP=${MC_TEST_EXTFS_LIST_CMD:-$P7ZIP} STAT=${MC_TEST_EXTFS_U7Z_STAT:-stat} mcu7zip_list () { # Symlinks are not shown - no idea how to distinguish them # Read-only files are not shown as such - it's rarely useful ugid="`id -nu` `id -ng`" date_re='^\(....\)-\(..\)-\(..\) \(..:..:..\)' # 19 chars. date_mc='\2-\3-\1 \4' empty_date_re='^ \{19\}' size_re='............' # 12 chars. empty_size_re=' \{12\}' zero_size=' 0' # archive entries can have no datetime info, 7z will use archive file datetime date_archive=`$STAT -c %y "$1" 2>/dev/null | sed -n "s/${date_re}.*/${date_mc}/p" 2>/dev/null` [ "${date_archive}"x = x ] && date_archive=`ls -lan "$1" 2>/dev/null | awk '{print $6, $7, $8}' 2>/dev/null` [ "${date_archive}"x = x ] && date_archive="01-01-1970 00:00:00" $P7ZIP l "$1" | sed -n " # If the uncompressed size is missing, we copy the compressed size onto it. # # But first, if the compressed size is missing too, set it to zero: s/^\(.\{19\} [D.]....\) $empty_size_re $empty_size_re/\1 $zero_size $zero_size/ # Next, do the copy: s/^\(.\{19\} [D.]....\) $empty_size_re \($size_re\)/\1 \2 \2/ # # (We use '.\{19\}' as the date may be missing. It may give false positives # but we don't mind: the printing commands that follow use strict patterns.). # Handle directories. s/$date_re D.... $size_re $size_re\(.*\)/drwxr-xr-x 1 $ugid 0 $date_mc \5/p s/$empty_date_re D.... $size_re $size_re\(.*\)/drwxr-xr-x 1 $ugid 0 $date_archive \1/p # Handle normal files. s/$date_re \..... \($size_re\) $size_re\(.*\)/-rw-r--r-- 1 $ugid \5 $date_mc \6/p s/$empty_date_re \..... \($size_re\) $size_re\(.*\)/-rw-r--r-- 1 $ugid \1 $date_archive \2/p " } mcu7zip_copyout () { #first we check if we have old p7zip archive with prefix ./ in filename $P7ZIP l "$1" "$2" | grep -q "0 files, 0 folders" && \ EXFNAME='*./'"$2" || EXFNAME="$2" $P7ZIP e -so "$1" "$EXFNAME" > "$3" 2>/dev/null } mcu7zip_copyin () { $P7ZIP a -si"$2" "$1" <"$3" >/dev/null 2>&1 } mcu7zip_mkdir () { dir=`mktemp -d "${MC_TMPDIR:-/tmp}/mctmpdir-u7z.XXXXXX"` || exit 1 mkdir -p "$dir"/"$2" $P7ZIP a -w"$dir" "$1" "$dir"/"$2" >/dev/null 2>&1 rm -rf "$dir" } mcu7zip_rm () { # NOTE: Version 4.20 fails to delete files in subdirectories #first we check if we have old p7zip archive with prefix ./ in filename $P7ZIP l "$1" "$2" | grep -q "0 files, 0 folders" && \ EXFNAME='*./'"$2" || EXFNAME="$2" $P7ZIP d "$1" "$EXFNAME" 2>&1 | grep -q E_NOTIMPL > /dev/null 2>&1 && \ { printf "Function not implemented...\n7z cannot delete from solid archive." >&2 ; exit 1 ; } } mcu7zip_rmdir () { #first we check if we have old p7zip archive with prefix ./ in filename $P7ZIP l "$1" "$2" | grep -q "0 files, 0 folders" && \ EXFNAME='*./'"$2" || EXFNAME="$2" $P7ZIP d "$1" "$EXFNAME"/ 2>&1 | grep -q E_NOTIMPL > /dev/null 2>&1 && \ { printf "Function not implemented...\n7z cannot delete from solid archive." >&2 ; exit 1 ; } } # override any locale for dates LC_DATE=C export LC_DATE umask 077 if [ -z "$P7ZIP" ]; then echo "Error: could not find p7zip (looked for 7z, 7za and 7zr)" >&2 exit 1 fi cmd="$1" shift case "$cmd" in list) mcu7zip_list "$@" | sort -k 8 ;; copyout) mcu7zip_copyout "$@" ;; copyin) mcu7zip_copyin "$@" ;; mkdir) mcu7zip_mkdir "$@" ;; rm) mcu7zip_rm "$@" ;; rmdir) mcu7zip_rmdir "$@" ;; *) exit 1 ;; esac exit 0 PK!w extfs.d/ucabnuȯ#! /bin/sh CAB=cabextract mccabfs_list () { $CAB -l "$1" | gawk -v uid=`id -un` -v gid=`id -gn` ' BEGIN { flag=0 } /^-------/ { flag++; if (flag > 1) exit 0; next } { if (flag == 0) next if (length($6) == 0) next pr="-rw-r--r--" split($3, a, ".") split($4, b, ":") printf "%s 1 %s %s %d %02d/%02d/%02d %02d:%02d %s\n", pr, uid, gid, $1, a[2], a[1], a[3], b[1], b[2], $6 }' } mccabfs_copyout () { $CAB -F "$2" -p "$1" > "$3" } LC_ALL=C export LC_ALL umask 077 cmd="$1" case "$cmd" in # Workaround for a bug in mc - directories must precede files to # avoid duplicate entries, so we sort output by filenames list) mccabfs_list "$2" ;; copyout) mccabfs_copyout "$2" "$3" "$4" ;; *) exit 1 ;; esac exit 0 PK!~&#&# extfs.d/dpkg+nuȯ#! /usr/bin/perl # # 1999 (c) Piotr Roszatycki # This software is under GNU license # last modification: 1999-12-08 # # dpkg sub quote { $_ = shift(@_); s/([^\w\/.+-])/\\$1/g; return($_); } sub bt { my ($dt) = @_; my (@time); @time = localtime($dt); $bt = sprintf "%02d-%02d-%d %02d:%02d", $time[4] + 1, $time[3], $time[5] + 1900, $time[2], $time[1]; return $bt; } sub ft { my ($f) = @_; return "d" if -d $f; return "l" if -l $f; return "p" if -p $f; return "S" if -S $f; return "b" if -b $f; return "c" if -c $f; return "-"; } sub fm { my ($n) = @_; my ($m); if( $n & 0400 ) { $m .= "r"; } else { $m .= "-"; } if( $n & 0200 ) { $m .= "w"; } else { $m .= "-"; } if( $n & 04000 ) { $m .= "s"; } elsif( $n & 0100 ) { $m .= "x"; } else { $m .= "-"; } if( $n & 0040 ) { $m .= "r"; } else { $m .= "-"; } if( $n & 0020 ) { $m .= "w"; } else { $m .= "-"; } if( $n & 02000 ) { $m .= "s"; } elsif( $n & 0010 ) { $m .= "x"; } else { $m .= "-"; } if( $n & 0004 ) { $m .= "r"; } else { $m .= "-"; } if( $n & 0002 ) { $m .= "w"; } else { $m .= "-"; } if( $n & 01000 ) { $m .= "t"; } elsif( $n & 0001 ) { $m .= "x"; } else { $m .= "-"; } return $m; } sub ls { my ($file,$path,$mode) = @_; if (-f $file) { my @stat = stat(_); # mode, nlink, uid, gid, size, mtime, filename printf "%s %d %d %d %d %s %s\n", $mode || ft($file).fm($stat[2] & 07777), $stat[3], $stat[4], $stat[5], $stat[7], bt($stat[9]), $path; } } $DATE=bt(time()); sub list { my ($pkg, $fn, $dn, $sz, $bt); my %debs = (); my %sects = (); my($diversions,$architecture); chop($diversions = `dpkg-divert --list 2>/dev/null`); chop($architecture = `dpkg-architecture 2>/dev/null`); chop($list = `dpkg -l '*' 2>/dev/null`); chop($getselections = `dpkg --get-selections 2>/dev/null`); chop($audit = `dpkg --audit 2>/dev/null`); $sz = length($diversions); print "-r--r--r-- 1 root root $sz $DATE DIVERSIONS\n"; $sz = length($architecture); print "-r--r--r-- 1 root root $sz $DATE ARCHITECTURE\n"; $sz = length($list); print "-r--r--r-- 1 root root $sz $DATE LIST\n"; $sz = length($getselections); print "-r--r--r-- 1 root root $sz $DATE GET-SELECTIONS\n"; $sz = length($audit); print "-r--r--r-- 1 root root $sz $DATE AUDIT\n"; $sz = length($pressconfigure); print "-r-xr--r-- 1 root root $sz $DATE CONFIGURE\n"; $sz = length($pressremove); print "-r-xr--r-- 1 root root $sz $DATE REMOVE\n"; $sz = length($pressclearavail); print "-r-xr--r-- 1 root root $sz $DATE CLEAR-AVAIL\n"; $sz = length($pressforgetoldunavail); print "-r-xr--r-- 1 root root $sz $DATE FORGET-OLD-UNAVAIL\n"; ls("/var/lib/dpkg/status","STATUS","-r--r--r--"); # ls("/var/lib/dpkg/available","AVAILABLE","-r--r--r--"); print "drwxr-xr-x 1 root root 0 $DATE all\n"; open STAT, "/var/lib/dpkg/status" or exit 1; while( ) { chop; if( /^([\w-]*): (.*)/ ) { $pkg = $2 if( lc($1) eq 'package' ); $debs{$pkg}{lc($1)} = $2; } } close STAT; foreach $pkg (sort keys %debs) { next if $debs{$pkg}{status} =~ /not-installed/; $fn = $debs{$pkg}{package}. "_". $debs{$pkg}{version}; $dn = $debs{$pkg}{section}; if( ! $dn ) { $dn = "unknown"; } elsif( $dn =~ /^(non-us)$/i ) { $dn .= "/main"; } elsif( $dn !~ /\// ) { $dn = "main/". $dn; } unless( $sects{$dn} ) { my $sub = $dn; while( $sub =~ s!^(.*)/[^/]*$!$1! ) { unless( $sects{$sub} ) { print "drwxr-xr-x 1 root root 0 $DATE $sub/\n"; $sects{$sub} = 1; } } print "drwxr-xr-x 1 root root 0 $DATE $dn/\n"; $sects{$dn} = 1; } $sz = $debs{$pkg}{'status'} =~ /config-files/ ? 0 : $debs{$pkg}{'installed-size'} * 1024; @stat = stat("/var/lib/dpkg/info/".$debs{$pkg}{package}.".list"); $bt = bt($stat[9]); print "-rw-r--r-- 1 root root $sz $bt $dn/$fn.debd\n"; print "lrwxrwxrwx 1 root root $sz $bt all/$fn.debd -> ../$dn/$fn.debd\n"; } } sub copyout { my($archive,$filename) = @_; my $qfilename = quote($filename); if( $archive eq 'DIVERSIONS' ) { system("dpkg-divert --list > $qfilename 2>/dev/null"); } elsif( $archive eq 'ARCHITECTURE' ) { system("dpkg-architecture > $qfilename 2>/dev/null"); } elsif( $archive eq 'LIST' ) { system("dpkg -l '*' > $qfilename 2>/dev/null"); } elsif( $archive eq 'AUDIT' ) { system("dpkg --audit > $qfilename 2>/dev/null"); } elsif( $archive eq 'GET-SELECTIONS' ) { system("dpkg --get-selections > $qfilename 2>/dev/null"); } elsif( $archive eq 'STATUS' ) { system("cp /var/lib/dpkg/status $qfilename"); } elsif( $archive eq 'AVAILABLE' ) { system("cp /var/lib/dpkg/available $qfilename"); } elsif( $archive eq 'CONFIGURE' ) { open O, ">$filename"; print O $pressconfigure; close O; } elsif( $archive eq 'REMOVE' ) { open O, ">$filename"; print O $pressremove; close O; } elsif( $archive eq 'CLEAR-AVAIL' ) { open O, ">$filename"; print O $pressclearavail; close O; } elsif( $archive eq 'FORGET-OLD-UNAVAIL' ) { open O, ">$filename"; print O $pressforgetoldunavail; close O; } else { open O, ">$filename"; print O $archive, "\n"; close O; } } # too noisy but less dangerouse sub copyin { my($archive,$filename) = @_; my $qfilename = quote($filename); if( $archive =~ /\.deb$/ ) { system("dpkg -i $qfilename>/dev/null"); } else { die "extfs: cannot create regular file \`$archive\': Permission denied\n"; } } sub run { my($archive,$filename) = @_; if( $archive eq 'CONFIGURE' ) { system("dpkg --pending --configure"); } elsif( $archive eq 'REMOVE' ) { system("dpkg --pending --remove"); } elsif( $archive eq 'CLEAR-AVAIL' ) { system("dpkg --clear-avail"); } elsif( $archive eq 'FORGET-OLD-UNAVAIL' ) { system("dpkg --forget-old-unavail"); } else { die "extfs: $filename: command not found\n"; } } # Disabled - too dangerous and too noisy sub rm_disabled { my($archive) = @_; if( $archive =~ /\.debd?$/ ) { my $qname = quote($archive); $qname =~ s%.*/%%g; $qname =~ s%_.*%%g; system("if dpkg -s $qname | grep ^Status | grep -qs config-files; \ then dpkg --purge $qname>/dev/null; \ else dpkg --remove $qname>/dev/null; fi"); die("extfs: $archive: Operation not permitted\n") if $? != 0; } else { die "extfs: $archive: Operation not permitted\n"; } } $pressconfigure=</dev/null | gawk -v uid=$(id -ru) ' /^===========/ {next} { if ($5="%" && $8~/DIR|ASC|HSC|CPY/) { split($6, a, "-") split($7, t, ":") filename=$1 filesize=$2 getline if ($2=="(none)") $2="" path=$2 getline if ($1~/^d.*/) next printf "%s %s %-8d %-8d %8d %s-%s-%s %s:%s %s%s\n",\ $1,1,0,0,filesize,a[3],a[2],a[1],t[1],t[2],path,filename } }' } mchafs_copyout () { TMPDIR=`mktemp -d "${MC_TMPDIR:-/tmp}/mctmpdir-uha.XXXXXX"` || exit 1 cd "$TMPDIR" $HA xyq "$1" "$2" >/dev/null cat "$2" > "$3" cd / rm -rf "$TMPDIR" } cmd="$1" shift case "$cmd" in list) mchafs_list "$@" ;; copyout) mchafs_copyout "$@" ;; *) exit 1 ;; esac exit 0 PK!iU0XXextfs.d/mailfsnuȯ#! /usr/bin/perl -w use bytes; # MC extfs for (possibly compressed) Berkeley style mailbox files # Peter Daum (Jan 1998, mc-4.1.24) $zcat="zcat"; # gunzip to stdout $bzcat="bzip2 -dc"; # bunzip2 to stdout $lzipcat="lzip -dc"; # unlzip to stdout $lz4cat="lz4 -dc"; # unlz4 to stdout $lzcat="lzma -dc"; # unlzma to stdout $xzcat="xz -dc"; # unxz to stdout $file="file"; # "file" command $TZ='GMT'; # default timezone (for Date module) if (eval "require Date::Parse") { import Date::Parse; $parse_date= sub { local $ftime = str2time($_[0],$TZ); $_ = localtime($ftime); /^(...) (...) ([ \d]\d) (\d\d:\d\d):\d\d (\d\d\d\d)$/; if ($ftime + 6 * 30 * 24 * 60 * 60 < $now || $ftime + 60 * 60 > $now) { return "$2 $3 $5"; } else { return "$2 $3 $4"; } } } elsif (eval "require Date::Manip") { import Date::Manip; $parse_date= sub { return UnixDate($_[0], "%l"); # "ls -l" format } } else { # use "light" version $parse_date= sub { local $mstring='GeeJanFebMarAprMayJunJulAugSepOctNovDec'; # assumes something like: Mon, 5 Jan 1998 16:08:19 +0200 (GMT+0200) # if you have mails with another date format, add it here if (/(\d\d?) ([A-Z][a-z][a-z]) (\d\d\d\d) (\d\d?):(\d\d)/) { $day = $1; $month = $2; $mon = index($mstring,$month) / 3; $year = $3; $hour = $4; $min = $5; # pass time not year for files younger than roughly 6 months # but not for files with dates more than 1-2 hours in the future if ($year * 12 + $mon > $thisyear * 12 + $thismon - 7 && $year * 12 + $mon <= $thisyear * 12 + $thismon && ! (($year * 12 + $mon) * 31 + $day == ($thisyear * 12 + $thismon) * 31 + $thisday && $hour > $thishour + 2)) { return "$month $day $hour:$min"; } else { return "$month $day $year"; } } # Y2K bug. # Date: Mon, 27 Mar 100 16:30:47 +0000 (GMT) if (/(\d\d?) ([A-Z][a-z][a-z]) (1?\d\d) (\d\d?):(\d\d)/) { $day = $1; $month = $2; $mon = index($mstring,$month) / 3; $year = 1900 + $3; $hour = $4; $min = $5; if ($year < 1970) { $year += 100; } if ($year * 12 + $mon > $thisyear * 12 + $thismon - 7 && $year * 12 + $mon <= $thisyear * 12 + $thismon && ! (($year * 12 + $mon) * 31 + $day == ($thisyear * 12 + $thismon) * 31 + $thisday && $hour > $thishour + 2)) { return "$month $day $hour:$min"; } else { return "$month $day $year"; } } # AOLMail(SM). # Date: Sat Jul 01 10:06:06 2000 if (/([A-Z][a-z][a-z]) (\d\d?) (\d\d?):(\d\d)(:\d\d)? (\d\d\d\d)/) { $month = $1; $mon = index($mstring,$month) / 3; $day = $2; $hour = $3; $min = $4; $year = $6; if ($year * 12 + $mon > $thisyear * 12 + $thismon - 7 && $year * 12 + $mon <= $thisyear * 12 + $thismon && ! (($year * 12 + $mon) * 31 + $day == ($thisyear * 12 + $thismon) * 31 + $thisday && $hour > $thishour + 2)) { return "$month $day $hour:$min"; } else { return "$month $day $year"; } } # Fallback return $fallback; } } sub process_header { while () { $size+=length; s/\r$//; last if /^$/; die "unexpected EOF\n" if eof; if (/^date:\s(.*)$/i) { $date=&$parse_date($1); } elsif (/^subject:\s(.*)$/i) { $subj=lc($1); $subj=~ s/^(re:\s?)+//gi; # no leading Re: $subj=~ tr/a-zA-Z0-9//cd; # strip all "special" characters } elsif (/^from:\s.*?(\w+)\@/i) { $from=$1; } elsif (/^to:\s.*?(\w+)\@/i) { $to=lc($1); } } } sub print_dir_line { $from=$to if ($from eq $user); # otherwise, it would look pretty boring $date=localtime(time) if (!defined $date); printf "-r-------- 1 $< $< %d %s %3.3d_%.25s\n", $size, $date, $msg_nr, "${from}_${subj}"; } sub mailfs_list { my $blank = 1; $user=$ENV{USER}||getlogin||getpwuid($<) || "nobody"; while() { s/\r$//; if($blank && /^from\s+\w+(\.\w+)*@/i) { # Start of header print_dir_line unless (!$msg_nr); $size=length; $msg_nr++; ($from,$to,$subj,$date)=("none","none","none", "01-01-80"); process_header; $line=$blank=0; } else { $size+=length; $line++; $blank= /^$/; } } print_dir_line unless (!$msg_nr); exit 0; } sub mailfs_copyout { my($source,$dest)=@_; exit 1 unless (open STDOUT, ">$dest"); ($nr)= ($source =~ /^(\d+)/); # extract message number from "filename" my $blank = 1; while() { s/\r$//; if($blank && /^from\s+\w+(\.\w+)*@/i) { $msg_nr++; exit(0) if ($msg_nr > $nr); $blank= 0; } else { $blank= /^$/; } print if ($msg_nr == $nr); } } # main { exit 1 unless ($#ARGV >= 1); $msg_nr=0; $cmd=shift; $mbox_name=shift; my $mbox_qname = quotemeta ($mbox_name); $_=`$file $mbox_qname`; if (/gzip/) { exit 1 unless (open IN, "$zcat $mbox_qname|"); } elsif (/bzip/) { exit 1 unless (open IN, "$bzcat $mbox_qname|"); } elsif (/lzip/) { exit 1 unless (open IN, "$lzipcat $mbox_qname|"); } elsif (/lz4/) { exit 1 unless (open IN, "$lz4cat $mbox_qname|"); } elsif (/lzma/) { exit 1 unless (open IN, "$lzcat $mbox_qname|"); } elsif (/xz/) { exit 1 unless (open IN, "$xzcat $mbox_qname|"); } else { exit 1 unless (open IN, "<$mbox_name"); } umask 077; if($cmd eq "list") { $now = time; $_ = localtime($now); /^... (... [ \d]\d \d\d:\d\d):\d\d \d\d\d\d$/; $fallback = $1; $nowstring=`date "+%Y %m %d %H"`; ($thisyear, $thismon, $thisday, $thishour) = split(/ /, $nowstring); &mailfs_list; exit 0; } elsif($cmd eq "copyout") { &mailfs_copyout(@ARGV); exit 0; } exit 1; PK!A˷ extfs.d/bppnuȯ#! /bin/sh # # Written by Marco Ciampa 2000 # (a simple cut & paste from rpm vfs) # (C) 1996 The Free Software Foundation. # # Package of a new italian distribution: Bad Penguin # http://www.badpenguin.org/ # override any locale for dates unset LC_ALL LC_TIME=C export LC_TIME mcbppfs_list () { FILEPREF="-r--r--r-- 1 root root " FIEXPREF="-r-xr-xr-x 1 root root " DATE=`date +"%b %d %H:%M"` set x `ls -l "$1"` size=$6 echo "$FILEPREF $size $DATE CONTENTS.tar.gz" echo "$FIEXPREF 35 $DATE INSTALL" echo "$FIEXPREF 35 $DATE UPGRADE" } mcbppfs_copyout () { case "$2" in CONTENTS.tar.gz) cat "$1" > "$3"; exit 0;; INSTALL) echo "# Run this to install this package" > "$3"; exit 0;; UPGRADE) echo "# Run this to upgrade this package" > "$3"; exit 0;; esac } mcbppfs_run () { case "$2" in INSTALL) echo "Installing \"$1\""; package-setup --install "$1"; exit 0;; UPGRADE) echo "Upgrading \"$1\""; package-setup --update "$1"; exit 0;; esac } umask 077 case "$1" in list) mcbppfs_list "$2"; exit 0;; copyout) mcbppfs_copyout "$2" "$3" "$4"; exit 0;; run) mcbppfs_run "$2" "$3"; exit 1;; esac exit 1 PK!Wp extfs.d/a+nuȯ#! /usr/bin/perl -w # # External filesystem for mc, using mtools # Written Ludek Brukner , 1997 # Much improved by Tom Perkins <968794022@noid.net>, 2000 # # WARNING - This software is ALPHA - Absolutely NO WARRANTY # # These mtools components must be in PATH for this to work sub quote { $_ = shift(@_); s/([^\w\/.+-])/\\$1/g; return($_); } $mmd = "mmd"; $mrd = "mrd"; $mdel = "mdel"; $mdir = "mdir -a"; $mcopy = "mcopy -noQ"; $0 =~ s|.*/||; $qdisk = quote($0); $ENV{MTOOLS_DATE_STRING} = "mm-dd-yyyy"; $ENV{MTOOLS_TWENTY_FOUR_HOUR_CLOCK} = "1"; SWITCH: for ( $ARGV[0] ) { /list/ && do { @dirs = get_dirs(""); while ($dir = shift(@dirs)) { push @dirs, get_dirs("$dir/"); } exit 0; }; /mkdir/ && do { shift; shift; exit 1 if scalar(@ARGV) != 1; $qname = quote($ARGV[0]); system("$mmd $qdisk:/$qname >/dev/null"); exit 0; }; /rmdir/ && do { shift; shift; exit 1 if scalar(@ARGV) != 1; $qname = quote($ARGV[0]); system("$mrd $qdisk:/$qname >/dev/null"); exit 0; }; /rm/ && do { shift; shift; exit 1 if scalar(@ARGV) != 1; $qname = quote($ARGV[0]); system("$mdel $qdisk:/$qname >/dev/null"); exit 0; }; /copyout/ && do { shift; shift; exit 1 if scalar(@ARGV) != 2; ( $qsrc, $qdest ) = @ARGV; $qsrc = quote($qsrc); $qdest = quote($qdest); system("$mcopy $qdisk:/$qsrc $qdest >/dev/null"); exit 0; }; /copyin/ && do { shift; shift; exit 1 if scalar(@ARGV) != 2; ( $qdest, $qsrc ) = @ARGV; $qsrc = quote($qsrc); $qdest = quote($qdest); system("$mcopy $qsrc $qdisk:/$qdest >/dev/null"); exit 0; }; /.*/ && do { # an unfamiliar command exit 1; }; } sub get_dirs { my ($path, $name, $size, $date, $time, $longname, @lst, @rv); $path = shift(@_); my $qpath = quote($path); @rv = (); open(FILE,"$mdir $qdisk:/$qpath |"); while ( ) { chomp(); /^ / && next; # ignore `non-file' lines m{^Directory for $0:/}i && next; # ignore `non-file' lines /^$/ && next; # ignore empty lines /^\.\.?/ && next; # ignore `.' and `..' $name = substr($_,0,12); $name =~ s/^([^ ]*) +([^ ]+)[ \t]*$/$1.$2/; $name =~ s/[ .]+$//; $_ = substr($_,12); s/^[ ]+//; ($size,$date,$time,$longname) = split(/[ \t]+/, $_, 4); defined $time || next; # process "am" and "pm". Should not be needed if # MTOOLS_TWENTY_FOUR_HOUR_CLOCK is respected. @lst = split(/([:ap])/, $time); $lst[0] += 12 if (defined $lst[3] && $lst[3] eq "p"); $time = sprintf("%02d:%02d", $lst[0], $lst[2]); @lst = split(/-/, $date); $lst[2] %= 100 if ($lst[2] > 100); $date = sprintf ("%02d-%02d-%02d", @lst); $name = $path . lc(($longname) ? $longname : $name); if ($size =~ /DIR/) { printf("drwxr-xr-x 1 %-8d %-8d %8d %s %s %s\n", 0, 0, 0, $date, $time, $name); push @rv, $name; } else { printf("-rw-r--r-- 1 %-8d %-8d %8d %s %s %s\n", 0, 0, $size, $date, $time, $name); } } close(FILE); return @rv; } 1; PK!,XX fish/fexistsnu[#ISEXISTS $FISH_FILENAME ls -l "/${FISH_FILENAME}" >/dev/null 2>/dev/null echo '### '$? PK!%,eefish/README.fishnu[ FIles transferred over SHell protocol (V 0.0.3) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This protocol was designed for transferring files over a remote shell connection (rsh and compatibles). It can be as well used for transfers over rsh, and there may be other uses. Client sends requests of following form: #FISH_COMMAND equivalent shell commands, which may be multiline Only fish commands are defined here, shell equivalents are for your information only and will probably vary from implementation to implementation. Fish commands always have priority: server is expected to execute fish command if it understands it. If it does not, however, it can try the luck and execute shell command. Since version 4.7.3, the scripts that FISH sends to host machines after a command is transmitted are no longer hardwired in the Midnight Commander source code. First, mc looks for system-wide set of scripts, then it checks whether current user has host-specific overrides in his per-user mc configuration directory. User-defined overrides take priority over sytem-wide scripts if they exist. The order in which the directories are traversed is as follows: /usr/libexec/mc/fish ~/.local/share/mc/fish// Server's reply is multiline, but always ends with ### 000 line. ### is prefix to mark this line, 000 is return code. Return codes are superset to those used in ftp. There are few new exit codes defined: 000 don't know; if there were no previous lines, this marks COMPLETE success, if they were, it marks failure. 001 don't know; if there were no previous lines, this marks PRELIMinary success, if they were, it marks failure Connecting ~~~~~~~~~~ Client uses "echo FISH:;/bin/sh" as command executed on remote machine. This should make it possible for server to distinguish FISH connections from normal rsh/ssh. Commands ~~~~~~~~ #FISH echo; start_fish_server; echo '### 200' This command is sent at the beginning. It marks that client wishes to talk via FISH protocol. #VER command must follow. If server understands FISH protocol, it has option to put FISH server somewhere on system path and name it start_fish_server. #VER 0.0.2 <...> echo '### 000' This command is the second one. It sends client version and extensions to the server. Server should reply with protocol version to be used, and list of extensions accepted. VER 0.0.0 ### 200 #PWD pwd; echo '### 200' Server should reply with current directory (in form /abc/def/ghi) followed by line indicating success. #LIST /directory ls -lLa $1 | grep '^[^cbt]' | ( while read p x u g s m d y n; do echo "P$p $u.$g S$s d$m $d $y :$n "; done ) ls -lLa $1 | grep '^[cb]' | ( while read p x u g a i m d y n; do echo "P$p $u.$g E$a$i dD$m $d $y :$n "; done ) echo '### 200' This allows client to list directory or get status information about single file. Output is in following form (any line except : may be omitted): P . S d<3-letters month name> D [.1234] E, : L Unix permissions are of form X--------- where X is type of file. Currently, '-' means regular file, 'd' means directory, 'c', 'b' means character and block device, 'l' means symbolic link, 'p' means FIFO and 's' means socket. 'd' has three fields: month (one of strings Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec), day of month, and third is either single number indicating year, or HH:MM field (assume current year in such case). As you've probably noticed, this is pretty broken; it is for compatibility with ls listing. #RETR /some/name ls -l /some/name | ( read a b c d x e; echo $x ); echo '### 100'; cat /some/name; echo '### 200' Server sends line with filesize on it, followed by line with ### 100 indicating partial success, then it sends binary data (exactly filesize bytes) and follows them with (with no preceding newline) ### 200. Note that there's no way to abort running RETR command - except closing the connection. #STOR /file/name > /file/name; echo '### 001'; ( dd bs=4096 count=; dd bs= count=1 ) 2>/dev/null | ( cat > %s; cat > /dev/null ); echo '### 200' This command is for storing /file/name, which is exactly size bytes big. You probably think I went crazy. Well, I did not: that strange cat > /dev/null has purpose to discard any extra data which was not written to disk (due to for example out of space condition). [Why? Imagine uploading file with "rm -rf /" line in it.] #CWD /somewhere cd /somewhere; echo '### 000' It is specified here, but I'm not sure how wise idea is to use this one: it breaks stateless-ness of the protocol. Following commands should be rather self-explanatory: #CHMOD 1234 file chmod 1234 file; echo '### 000' #DELE /some/path rm -f /some/path; echo '### 000' #MKD /some/path mkdir /some/path; echo '### 000' #RMD /some/path rmdir /some/path; echo '### 000' #RENAME /path/a /path/b mv /path/a /path/b; echo '### 000' #LINK /path/a /path/b ln /path/a /path/b; echo '### 000' #SYMLINK /path/a /path/b ln -s /path/a /path/b; echo '### 000' #CHOWN user /file/name chown user /file/name; echo '### 000' #CHGRP group /file/name chgrp group /file/name; echo '### 000' #INFO ...collect info about host into $result ... echo $result echo '### 200' #READ /path/and/filename cat /path/and/filename | ( dd bs=4096 count= > /dev/null; dd bs= count=1 > /dev/null; dd bs=4096 count=; dd bs= count=1; ) Returns ### 200 on successful exit, ### 291 on successful exit when reading ended at eof, ### 292 on successfull exit when reading did not end at eof. #WRITE /path/and/filename Hmm, shall we define these ones if we know our client is not going to use them? you can use follow parameters: FISH_FILESIZE FISH_FILENAME FISH_FILEMODE FISH_FILEOWNER FISH_FILEGROUPE FISH_FILEFROM FISH_FILETO NB: 'FISH_FILESIZE' used if we operate with single file name in 'unlink', 'rmdir', 'chmod', etc... 'FISH_FILEFROM','FISH_FILETO' used if we operate with two files in 'ln', 'hardlink', 'mv' etc... 'FISH_FILEOWNER', 'FISH_FILEGROUPE' is a new user/group in chown also flags: FISH_HAVE_HEAD FISH_HAVE_SED FISH_HAVE_AWK FISH_HAVE_PERL FISH_HAVE_LSQ FISH_HAVE_DATE_MDYT That's all, folks! pavel@ucw.cz PK!8fish/mvnu[#RENAME $FISH_FILEFROM $FISH_FILETO if mv "/${FISH_FILEFROM}" "/${FISH_FILETO}" 2>/dev/null; then echo "### 000" else echo "### 500" fi PK!Aoo fish/mkdirnu[#MKD $FISH_FILENAME if mkdir "/$FISH_FILENAME" 2>/dev/null; then echo "### 000" else echo "### 500" fi PK!ȼȬ fish/chownnu[#CHOWN $FISH_FILEOWNER:$FISH_FILEGROUP $FISH_FILENAME if chown ${FISH_FILEOWNER}:${FISH_FILEGROUP} "/${FISH_FILENAME}" ; then echo "### 000" else echo "### 500" fi PK!oo fish/rmdirnu[#RMD $FISH_FILENAME if rmdir "/${FISH_FILENAME}" 2>/dev/null; then echo "### 000" else echo "### 500" fi PK!Xw fish/chmodnu[#CHMOD $FISH_FILEMODE $FISH_FILENAME if chmod ${FISH_FILEMODE} "/${FISH_FILENAME}" 2>/dev/null; then echo "### 000" else echo "### 500" fi PK!kxE fish/hardlinknu[#LINK $FISH_FILEFROM $FISH_FILETO FILEFROM="/${FISH_FILEFROM}" FILETO="/${FISH_FILETO}" if ln "${FILEFROM}" "${FILETO}" 2>/dev/null; then echo "### 000" else echo "### 500" fi PK!Ρfish/lsnu[#LIST /${FISH_DIR} LC_TIME=C export LC_TIME perl_res="1" fish_list_lsq () { FISH_DIR="$1" ls -Qlan "${FISH_DIR}" 2>/dev/null | grep '^[^cbt]' | ( while read p l u g s m d y n; do echo "P$p $u.$g" echo "S$s" echo "d$m $d $y" echo ":$n" echo done ) ls -Qlan "${FISH_DIR}" 2>/dev/null | grep '^[cb]' | ( while read p l u g a i m d y n; do echo "P$p $u.$g" echo "E$a$i" echo "d$m $d $y" echo ":$n" echo done ) echo '### 200' } fish_list_sed () { FISH_DIR="$1" ls -lan "${FISH_DIR}" 2>/dev/null | grep '^[^cbt]' | ( while read p l u g s rec; do if [ -n "$g" ]; then if [ -n "$FISH_HAVE_DATE_MDYT" ]; then filename=`echo "$rec"| sed 's/[^[:space:]]\+ \+[^[:space:]]\+ \+[^[:space:]]\+ //'` filedate=`echo "$rec"| sed 's/\([^[:space:]]\+ \+[^[:space:]]\+ \+[^[:space:]]\+\) .*/\1/'` else filename=`echo "$rec"| sed 's/[^[:space:]]\+ \+[^[:space:]]\+ //'` filedate=`echo "$rec"| sed 's/\([^[:space:]]\+ \+[^[:space:]]\+\) .*/\1/'` fi pfile=\"`echo "$filename" | sed -e 's#^\(.*\) -> \(.*\)#\1" -> "\2#'`\" echo "P$p $u.$g" echo "S$s" if [ -n "$FISH_HAVE_DATE_MDYT" ]; then echo "d$filedate" else echo "D$filedate" fi echo ":$pfile" echo fi done ) ls -lan "${FISH_DIR}" 2>/dev/null | grep '^[cb]' | ( while read p l u g a i rec; do if [ -n "$g" ]; then if [ -n "$FISH_HAVE_DATE_MDYT" ]; then filename=`echo "$rec"| sed 's/[^[:space:]]\+ \+[^[:space:]]\+ \+[^[:space:]]\+ //'` filedate=`echo "$rec"| sed 's/\([^[:space:]]\+ \+[^[:space:]]\+ \+[^[:space:]]\+\) .*/\1/'` else filename=`echo "$rec"| sed 's/[^[:space:]]\+ \+[^[:space:]]\+ //'` filedate=`echo "$rec"| sed 's/\([^[:space:]]\+ \+[^[:space:]]\+\) .*/\1/'` fi pfile=\"`echo "$filename" | sed -e 's#^\(.*\) -> \(.*\)#\1" -> "\2#'`\" echo "P$p $u.$g" echo "E$a$i" if [ -n "$FISH_HAVE_DATE_MDYT" ]; then echo "d$filedate" else echo "D$filedate" fi echo ":$pfile" echo fi done ) echo '### 200' } fish_list_poor_ls () { FISH_DIR="$1" ls -lan "${FISH_DIR}" 2>/dev/null | grep '^[^cbt]' | ( while read p l u g s m d y n n2 n3; do if [ -n "$g" ]; then if [ "$m" = "0" ]; then s=$d; m=$y; d=$n; y=$n2; n=$n3 else n=$n" "$n2" "$n3 fi echo "P$p $u $g" echo "S$s" echo "d$m $d $y" echo ":"$n echo fi done ) ls -lan "${FISH_DIR}" 2>/dev/null | grep '^[cb]' | ( while read p l u g a i m d y n n2 n3; do if [ -n "$g" ]; then if [ "$a" = "0" ]; then a=$m; i=$d; m=$y; d=$n; y=$n2; n=$n3 else n=$n" "$n2" "$n3 fi echo "P$p $u $g" echo "E$a$i" echo "d$m $d $y" echo ":"$n echo fi done ) echo '### 200' } fish_list_perl () { FISH_DIR=$1 perl -e ' use strict; use POSIX; use Fcntl; use POSIX ":fcntl_h"; #S_ISLNK was here until 5.6 import Fcntl ":mode" unless defined &S_ISLNK; #and is now here my $dirname = $ARGV[0]; if (opendir (DIR, $dirname)) { while((my $filename = readdir (DIR))){ my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = lstat("$dirname/$filename"); my $mloctime= strftime("%%m-%%d-%%Y %%H:%%M", localtime $mtime); my $strutils_shell_escape_regex = s/([;<>\*\|`&\$!#\(\)\[\]\{\}:'\''"\ \\])/\\$1/g; my $e_filename = $filename; $e_filename =~ $strutils_shell_escape_regex; if (S_ISLNK ($mode)) { my $linkname = readlink ("$dirname/$filename"); $linkname =~ $strutils_shell_escape_regex; printf("R%%o %%o $uid.$gid\nS$size\nd$mloctime\n:\"%%s\" -> \"%%s\"\n\n", S_IMODE($mode), S_IFMT($mode), $e_filename, $linkname); } elsif (S_ISCHR ($mode) || S_ISBLK ($mode)) { my $minor = $rdev %% 256; my $major = int( $rdev / 256 ); printf("R%%o %%o $uid.$gid\nE$major,$minor\nd$mloctime\n:\"%%s\"\n\n", S_IMODE($mode), S_IFMT($mode), $e_filename); } else { printf("R%%o %%o $uid.$gid\nS$size\nd$mloctime\n:\"%%s\"\n\n", S_IMODE($mode), S_IFMT($mode), $e_filename); } } printf("### 200\n"); closedir(DIR); } else { printf("### 500\n"); } exit 0 ' "/${FISH_DIR}" perl_res=$? } if [ -n "${FISH_HAVE_PERL}" ]; then fish_list_perl "/${FISH_FILENAME}" fi if [ "${perl_res}" != "0" ]; then if [ -n "${FISH_HAVE_LSQ}" ]; then fish_list_lsq "/${FISH_FILENAME}" elif [ -n "${FISH_HAVE_SED}" ]; then fish_list_sed "/${FISH_FILENAME}" else fish_list_poor_ls "/${FISH_FILENAME}" fi fi PK!jOc fish/infonu[LC_TIME=C export LC_TIME #FISH_HAVE_HEAD 1 #FISH_HAVE_SED 2 #FISH_HAVE_AWK 4 #FISH_HAVE_PERL 8 #FISH_HAVE_LSQ 16 #FISH_HAVE_DATE_MDYT 32 #FISH_HAVE_TAIL 64 res=0 if `echo yes| head -c 1 > /dev/null 2>&1` ; then res=`expr $res + 1` fi if `echo 1 | sed 's/1/2/' >/dev/null 2>&1` ; then res=`expr $res + 2` fi if `echo 1| awk '{print}' > /dev/null 2>&1` ; then res=`expr $res + 4` fi if `perl -v > /dev/null 2>&1` ; then res=`expr $res + 8` fi if `ls -Q / >/dev/null 2>&1` ; then res=`expr $res + 16` fi dat=`ls -lan / 2>/dev/null | head -n 3 | ( while read p l u g s rec; do if [ -n "$g" ]; then if [ -n "$l" ]; then echo "$rec" fi fi done )` dat=`echo $dat | cut -c1 2>/dev/null` r=`echo "0123456789"| grep "$dat"` if [ -z "$r" ]; then res=`expr $res + 32` fi if `echo yes| tail -c +1 - > /dev/null 2>&1` ; then res=`expr $res + 64` fi echo $res echo "### 200" PK!H? fish/sendnu[#STOR $FISH_FILESIZE $FISH_FILENAME FILENAME="/${FISH_FILENAME}" echo "### 001" { > "${FILENAME}" bss=4096 bsl=4095 if [ $FISH_FILESIZE -lt $bss ]; then bss=1; bsl=0; fi while [ $FISH_FILESIZE -gt 0 ]; do cnt=`expr \\( $FISH_FILESIZE + $bsl \\) / $bss` n=`dd bs=$bss count=$cnt | tee -a "${FILENAME}" | wc -c` FISH_FILESIZE=`expr $FISH_FILESIZE - $n` done }; echo "### 200" PK!*3fish/lnnu[#SYMLINK $FISH_FILEFROM $FISH_FILETO FILEFROM="${FISH_FILEFROM}" FILETO="/${FISH_FILETO}" if ln -s "${FILEFROM}" "${FILETO}" 2>/dev/null; then echo "### 000" else echo "### 500" fi PK!C fish/appendnu[#APPE $FISH_FILESIZE $FISH_FILENAME FILENAME="/${FISH_FILENAME}" echo "### 001" { bss=4096 bsl=4095 if [ $FISH_FILESIZE -lt $bss ]; then bss=1; bsl=0; fi while [ $FISH_FILESIZE -gt 0 ]; do cnt=`expr \\( $FISH_FILESIZE + $bsl \\) / $bss` n=`dd bs=$bss count=$cnt | tee -a "${FILENAME}" | wc -c` FISH_FILESIZE=`expr $FISH_FILESIZE - $n` done }; echo "### 200" PK! rr fish/unlinknu[#DELE $FISH_FILENAME if rm -f "/${FISH_FILENAME}" 2>/dev/null; then echo "### 000" else echo "### 500" fi PK!ee fish/utimenu[#UTIME "$FISH_TOUCHATIME_W_NSEC" "$FISH_TOUCHMTIME_W_NSEC" "$FISH_FILENAME" if TZ=UTC touch -m -d "$FISH_TOUCHMTIME_W_NSEC" "/${FISH_FILENAME}" 2>/dev/null && \ TZ=UTC touch -a -d "$FISH_TOUCHATIME_W_NSEC" "/${FISH_FILENAME}" 2>/dev/null; then echo "### 000" elif TZ=UTC touch -m -t $FISH_TOUCHMTIME "/${FISH_FILENAME}" 2>/dev/null && \ TZ=UTC touch -a -t $FISH_TOUCHATIME "/${FISH_FILENAME}" 2>/dev/null; then echo "### 000" elif [ -n "$FISH_HAVE_PERL" ] && perl -e 'utime '$FISH_FILEATIME','$FISH_FILEMTIME',@ARGV;' "/${FISH_FILENAME}" 2>/dev/null; then echo "### 000" else echo "### 500" fi PK!eggfish/getnu[#RETR $FISH_FILENAME $FISH_START_OFFSET LC_TIME=C export LC_TIME fish_get_perl () { FILENAME=$1 OFFSET=$2 perl -e ' use strict; use POSIX; use Fcntl; my $filename = $ARGV[0]; my $pos = $ARGV[1]; my $content; my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = lstat("$filename"); my $n; if (open IFILE,$filename) { if ($size<$pos) { printf("0\n"); } else { $size-=$pos; printf("$size\n"); } printf("### 100\n"); seek (IFILE, $pos, 0); while ($n = read(IFILE,$content,$blksize)!= 0) { print $content; } close IFILE; printf("### 200\n"); } else { printf("### 500\n"); } exit 0 ' "${FILENAME}" $OFFSET } fish_get_tail () { FILENAME=$1 OFFSET=$2 LC_TIME=C export LC_TIME if dd if="${FILENAME}" of=/dev/null bs=1 count=1 2>/dev/null ; then file_size=`ls -ln "${FILENAME}" 2>/dev/null | ( read p l u g s r echo $s )` if [ $OFFSET -gt 0 ]; then file_size=`expr $file_size - $OFFSET` OFFSET=`expr $OFFSET + 1` fi if [ $file_size -gt 0 ]; then echo $file_size else echo 0 fi echo "### 100" if [ $OFFSET -gt 0 ]; then tail -c +${OFFSET} "${FILENAME}" else cat "${FILENAME}" fi echo "### 200" else echo "### 500" fi } fish_get_dd () { FILENAME=$1 OFFSET=$2 LC_TIME=C export LC_TIME if dd if="${FILENAME}" of=/dev/null bs=1 count=1 2>/dev/null ; then file_size=`ls -ln "${FILENAME}" 2>/dev/null | ( read p l u g s r echo $s )` file_size=`expr $file_size - $OFFSET` if [ $file_size -gt 0 ]; then echo $file_size else echo 0 fi echo "### 100" if [ $OFFSET -gt 0 ]; then dd skip=$OFFSET ibs=1 if="${FILENAME}" 2>/dev/null else cat "${FILENAME}" fi echo "### 200" else echo "### 500" fi } if [ -n "${FISH_HAVE_PERL}" ]; then fish_get_perl "/${FISH_FILENAME}" ${FISH_START_OFFSET} elif [ -n "${FISH_HAVE_TAIL}" ]; then fish_get_tail "/${FISH_FILENAME}" ${FISH_START_OFFSET} else fish_get_dd "/${FISH_FILENAME}" ${FISH_START_OFFSET} fi PK!WSS1S1 mcedit.menunu[PK!OZ[,,1mc.menunu[PK!V""L^mc.default.keymapnu[PK!99sfs.ininu[PK!i϶)R)Rmc.extnu[PK!i!!umc.emacs.keymapnu[PK! mfilehighlight.ininu[PK! fedit.indent.rcnuȯPK!~~MM mc-wrapper.shnu[PK!L11Bmc.cshnu[PK!붕mc.shnu[PK!Kf0404 wcons.savernuȯPK!^ 7ext.d/video.shnuȯPK!Y:A ;ext.d/doc.shnuȯPK!^ Oext.d/misc.shnuȯPK!\  Xext.d/text.shnuȯPK!lkkOeext.d/image.shnuȯPK!pQiext.d/archive.shnuȯPK!55 xext.d/web.shnuȯPK!||6}ext.d/sound.shnuȯPK!dv\\ext.d/package.shnuȯPK!.(mc-wrapper.cshnu[PK!TGZ{  dextfs.d/changesetfsnuȯPK! :nnextfs.d/README.extfsnu[PK!Yzz [extfs.d/urarnuȯPK!a extfs.d/uacenuȯPK!~*(( 1extfs.d/audionuȯPK!A?0  extfs.d/patchsetfsnuȯPK!E;r@55 extfs.d/rpmnuȯPK!O extfs.d/ulhanuȯPK! ʬW++textfs.d/patchfsnuȯPK!r =1extfs.d/lslRnuȯPK!&&6extfs.d/READMEnu[PK!XX _Textfs.d/debnuȯPK!$ANiextfs.d/iso9660nuȯPK!j  ƀextfs.d/debanuȯPK!<+ extfs.d/ulibnuȯPK!8AA Iextfs.d/uzoonuȯPK!3; ƞextfs.d/rpms+nuȯPK!++ extfs.d/uarnuȯPK! Nextfs.d/ualznuȯPK!:MM extfs.d/hp48+nuȯPK!6[%% extfs.d/apt+nuȯPK!>S Nextfs.d/trpmnuȯPK!y<;; &extfs.d/uzipnuȯPK!+hww >extfs.d/uarjnuȯPK!rEextfs.d/gitfs+nuȯPK!$$ Hextfs.d/uarcnuȯPK!砜)) ^Pextfs.d/debdnuȯPK!8 yextfs.d/u7znuȯPK!w extfs.d/ucabnuȯPK!~&#&# ͏extfs.d/dpkg+nuȯPK! 0extfs.d/uhanuȯPK!iU0XX4extfs.d/mailfsnuȯPK!A˷ extfs.d/bppnuȯPK!Wp extfs.d/a+nuȯPK!,XX |fish/fexistsnu[PK!%,eefish/README.fishnu[PK!8fish/mvnu[PK!Aoo zfish/mkdirnu[PK!ȼȬ #fish/chownnu[PK!oo  fish/rmdirnu[PK!Xw fish/chmodnu[PK!kxE fish/hardlinknu[PK!Ρrfish/lsnu[PK!jOc Jfish/infonu[PK!H? \fish/sendnu[PK!*3Ofish/lnnu[PK!C Afish/appendnu[PK! rr "fish/unlinknu[PK!ee fish/utimenu[PK!eggnfish/getnu[PKHH_ &