AnonSec Team
Server IP : 198.54.120.203  /  Your IP : 216.73.216.181
Web Server : LiteSpeed
System : Linux premium58.web-hosting.com 4.18.0-553.58.1.lve.el8.x86_64 #1 SMP Fri Jul 4 12:07:06 UTC 2025 x86_64
User : greakqsw ( 1698)
PHP Version : 8.3.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home/greakqsw/theblogginglab.org/7648l2-20260309055551/../86cj7r-20260310175444/../ux785m/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/greakqsw/theblogginglab.org/7648l2-20260309055551/../86cj7r-20260310175444/../ux785m/mc.zip
PKYm\�K�f0404
cons.savernuȯ��ELF>�@p,@8
@@@@00ppp�� (( ( �� @@ @ �����  ���DDP�td���DDQ�tdR�td(( ( ��/lib64/ld-linux-x86-64.so.2GNU�GNUGNUCGyO(�y����CLL���8?� �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 � 	� 
� � � 
� � � � � � ��H��H�� H��t��H����5� �%� ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h���������%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%} D���%u D���%m D���%e D���%] D���%U D���%M D���%E D��AWAVAUATUH��S���H��dH�%(H��$1��D$A�D$B�/�����u/L�m�L���	���H��t�H�5�L��������t��������������߉��\�����x�1�L��1�����A�ƅ�x�L�d$P�ƿL������x��D$h%�= u�H�D$xH���H��u�D��A�G���>�z���9\$l�p���A�E<t�<<v�[���H��L��H�D$��1�E��L��$��L��L�\$���L�\$�L��L��������������v�������L�D$E���1�L��$���L���5����L��1�����A�Dž������L��ƿ������������D$h%�= �������������v���1�H�T$H�TD���D$H�5������R����D$Jf���D����T$H�J�f����1���f=��'����¾�DH�H��H�D$�7���H�D$H�������H�D$B��H��H�D$(�m���H������H�D$AL��$�l$ H�D$0I��H�D$8L�d$�|$B��H�t$01�����H�����D$A<3�;��<4��<5u|D�d$H�l$J�D$C�D$DD�����E��t;1��H�t$�H�H�Ȁ| u%��9�w�A����H��L��H�D$����H�t$E���D$E5���H��t#H�t$(���g���H���!�������1�H�t$C�����H��u�1�H�t$D����H��u��T$CA9�s	D�d$CA���D$DA9�s	D�d$DA��)�H�t$F����f�D$F���H���a���f�|$F�U����D$CD�|$$L��E��A����D��D$DL��LD$M�ĉ��
��I��H������9���A�|$H�r@�:H;t$8uӺL���c���H=��L���D$D뫋|$ �4�����x1�1�D���T���H��t&����������������<2������D$B����H�T$D��������x�9\$lu�H�l$H�t$D��H������H9�t��C����|$ �����x1�1�D������H��tVH�T$H�|$1������k���D��E��D�|$$L9�����L)�L���v������D��E��D�|$$���1��*���H�T$D��������x�9\$lu�H�l$H�t$D��H�����H9��p���H�T$D���������V���9\$l�L����������1�I��^H��H���PTL��H�
H�=���� �H�=1 H�* H9�tH��
 H��t	�����H�= H�5�
 H)�H��H��H��?H�H�tH��
 H��t��fD�����=�
 u+UH�=�
 H��tH�=�
 �	����d�����
 ]������w����PX��H��dH�%(H�D$1�H�t$�D$�����������AWI��AVI��AUA��ATL�%<
 UH�-<
 SL)�H������H��t1��L��L��D��A��H��H9�u�H��[]A\A]A^A_Ðf.������H��H���/dev/vcc/a%d/dev/vc/%d/dev/vcsa%d/dev/tty%d/dev/;@����t������������\�����<�������LzRx�����/D$40���0FJw�?:*3$"\8��� t@���9AAN 0�$���	F�B�B �B(�A0�D8�N�
D�0���eF�E�E �E(�H0�H8�G@n8A0A(B BBBX����@8 	
H( 0 ���o�@
0 �h��	���o���ox���o�oD���o@ P	`	p	�	�	�	�	�	�	�	�	

 
0
@
P
`

GA$3h864��
GA$3h864��GA$3a1��GA$3a1��
GA$3p864��GA$gcc 8.2.1 20180905
GA*GOW*EGA*GA+stack_clashGA*cf_protectionGA+GLIBCXX_ASSERTIONS
GA*FORTIFY�GA*GA!GA*GA!stack_realignGA$3a1��GA$3a1	.	GA$3a1HPGA$3a1��
GA$3p864��GA$gcc 8.2.1 20180905
GA*GOW*EGA*GA+stack_clashGA*cf_protectionGA+GLIBCXX_ASSERTIONS
GA*FORTIFYGA*GA!GA*GA!stack_realign
GA*FORTIFYGA+GLIBCXX_ASSERTIONS
GA$3h864��
GA$3h864��GA*��GA!stack_realignGA*GA+stack_clashGA*cf_protectionGA*
GA*GOW*EGA!
GA$3p864�EGA$gcc 8.2.1 20180905
GA*GOW*EGA*GA+stack_clashGA*cf_protection
GA*FORTIFYGA+GLIBCXX_ASSERTIONSGA*GA!GA*GA!stack_realign
GA$3h864��
GA$3h864��GA$3a1EEGA$3a1EEGA$3a1.	3	GA$3a1PUcons.saver-4.8.19-9.el8.x86_64.debug|b�7zXZ�ִF!t/���T]?�E�h=��ڊ�2N�HW�� ��Z<�X��)`��C���#�] �J�+\�**�@�9<���>@���[�:BU��!��[���H|�8�M�x8U��T��q��'NE�����g���6�V�v�p
��=]$�
G�ߠ#w{y19��`��rd<_��=E]���Ԫ?�`���|GV	��`�ޜ6��^���o4v8��Wk�5n�9��ha��N�.���
�	0��d�l�֠h�����/f�vǸ����j�;n�cGG�j��7��2��I��Hr��ފ�J���&���rTU���|9�ʴB\yz�s�<�%d}���k�&�-d��k���o��"B�eb�[ԭ��g���T�����@aJ��+k	�1�E�����,%��y�Q���?�s4���~�>pwP��0Z�hK?�����,_n�A������c�f�y��褙%�Y��X88Ud]��/�h�8&X;L}U_�>�cM�F��M�Y����x�AW+��(&Rt:�u:��x�����g���������� 2�q�x ѽ���g�F�gÆ�2�9�osF�b�]u���v������~j	�Vt
�.{�J�cӱ[Dߴ"�L_�8��Kڐ�h�G����X_e �qQ�d	"W�_4���r�U�_���,Y�'���+9���uٴ�<3Ik�a��C�=�Z&�����,�;	-��
��C�\|�&!�,����29��FuF]s���	b�Y	�+�ʰ��mD�/x�xy���Gƴ���
���M�G$qi�q8�E����lV�i�-�Z��{��s}�
�}G���j�5�_=%����Bf��g�YZ.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_debugdatapp�� &�� 4��$G���o��Q(Y@@a���oDD.n���oxx0}����Bhh��		�@	@	0�p
p
 �����HH
�XX9���D��� �( (�0 0�8 8�@ @��0 0��      
 ` l p',/�'�0+>PK[m\�붕��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\m\�8���fish/mvnu�[���#RENAME $FISH_FILEFROM $FISH_FILETO
if mv "/${FISH_FILEFROM}" "/${FISH_FILETO}" 2>/dev/null; then
   echo "### 000"
else
   echo "### 500"
fi
PK]m\��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`m\���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`m\j�Oc��	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"
PKam\%�,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/<hostname>/

Server's reply is multiline, but always ends with

### 000<optional text>

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 <feature1> <feature2> <...>
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 <feature2>
### 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 :<filename>
may be omitted):

P<unix permissions> <owner>.<group>
S<size>
d<3-letters month name> <day> <year or HH:MM>
D<year> <month> <day> <hour> <minute> <second>[.1234]
E<major-of-device>,<minor>
:<filename>
L<filename symlink points to>
<blank line to separate items>

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 <size> /file/name
> /file/name; echo '### 001'; ( dd bs=4096 count=<size/4096>; dd bs=<size%4096> 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 <offset> <size> /path/and/filename
cat /path/and/filename | ( dd bs=4096 count=<offset/4096> > /dev/null;
dd bs=<offset%4096> count=1 > /dev/null;
dd bs=4096 count=<offset/4096>;
dd bs=<offset%4096> 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 <offset> <size> /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
PKbm\�,�XXfish/fexistsnu�[���#ISEXISTS $FISH_FILENAME
ls -l "/${FISH_FILENAME}" >/dev/null 2>/dev/null
echo '### '$?
PKbm\����oo
fish/rmdirnu�[���#RMD $FISH_FILENAME
if rmdir "/${FISH_FILENAME}" 2>/dev/null; then
   echo "### 000"
else
   echo "### 500"
fi
PKcm\�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"
PKdm\���	rrfish/unlinknu�[���#DELE $FISH_FILENAME
if rm -f "/${FISH_FILENAME}" 2>/dev/null; then
    echo "### 000"
else
    echo "### 500"
fi
PKdm\�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"
PKem\�Xw��
fish/chmodnu�[���#CHMOD $FISH_FILEMODE $FISH_FILENAME
if chmod ${FISH_FILEMODE} "/${FISH_FILENAME}" 2>/dev/null; then
    echo "### 000"
else
    echo "### 500"
fi
PKfm\k�xE��
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
PKgm\�*�3��fish/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
PKgm\�A�oo
fish/mkdirnu�[���#MKD $FISH_FILENAME
if mkdir "/$FISH_FILENAME" 2>/dev/null; then
    echo "### 000"
else
    echo "### 500"
fi
PKhm\�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
PKim\�ȼȬ�
fish/chownnu�[���#CHOWN $FISH_FILEOWNER:$FISH_FILEGROUP $FISH_FILENAME
if chown ${FISH_FILEOWNER}:${FISH_FILEGROUP} "/${FISH_FILENAME}" ; then
    echo "### 000"
else
    echo "### 500"
fi
PKim\�L��11mc.cshnu�[���alias mc 'source /usr/libexec/mc/mc-wrapper.csh'
PKkm\���$$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
# <jpelletier@ieee.org>
#

# 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
PKkm\~�*�((
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
PKlm\E;r@55extfs.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 <ewt@redhat.com> 1996
#  Jakub Jelinek <jj@sunsite.mff.cuni.cz> 1996, 2004
#  Tomasz Kłoczko <kloczek@rudy.mif.pg.gda.pl> 1997
#  Wojtek Pilorz <wpilorz@bdk.lublin.pl>
#	1997: minor changes
#  Michele Marziani <marziani@fe.infn.it>
#	1997: minor changes
#  Marc Merlin <marcsoft@merlins.org> 1998
#	1998: bug files
#  Michal Svec <rebel@penguin.cz> 2000
#	2000: locale bugfix
#  Andrew V. Samoilov <sav@bcs.zp.ua>
#	2004: Whitespace(s) & single quote(s) in filename workaround
#	      https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=64007
#  Slava Zanko <slavazanko@gmail.com>
#	2009: Totally rewritten.
#  Alexander Chumachenko <ledest@gmail.com>
#	2013: add dependency version output
#  Denis Silakov <denis.silakov@rosalab.ru>
#	2013: tar payload support.
#  Arkadiusz Miśkiewicz <arekm@maven.pl>
#	2013: improve support for EPOCH
#	      add support for PREINPROG/POSTINPROG/PREUNPROG/POSTUNPROG
#	      add support for VERIFYSCRIPTPROG
#	      add support for TRIGGERSCRIPTS/TRIGGERSCRIPTPROG
#  Jiri Tyr <jiri.tyr@gmail.com>
#	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 <http://www.gnu.org/licenses/>.


# 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
PKmm\��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 <osk@hem.passagen.se>.
#

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 (<ZIP>) {
	    $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 (<PIPE>) {
			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 (<PIPE>) {
			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);
}
PKmm\�Wp��
extfs.d/a+nuȯ��#! /usr/bin/perl -w
#
# External filesystem for mc, using mtools
# Written Ludek Brukner <lubr@barco.cz>, 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 ( <FILE> ) {
    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;
PKnm\>��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 K�oczko (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
PKom\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
PKom\��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
# <jhinkle@rockisland.com>
#

# Code for mc_lha_fs_run() suggested by:
# Jan 97	Zdenek Kabelac <kabi@informatics.muni.cz>

# 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
PKpm\�8��AA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
PKqm\�: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
PKqm\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
PKrm\��extfs.d/ualznuȯ��#!/bin/sh
#
# Written by Pavel Roskin <proski@gnu.org>
# (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
PKsm\��&&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 <Enter> or <Return>.  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. 
PKtm\砜�))extfs.d/debdnuȯ��#! /usr/bin/perl
#
# 1999 (c) Piotr Roszatycki <dexter@debian.org>
# 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(<PIPEIN>) {
               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(<LIST>) {
               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=<<EOInstall;

                                WARNING
  Don\'t use this method if you are not willing to repack this package...

This is not a real file. It is a way to repack the package you are browsing.

To repack this package go back to the panel and press Enter on this file.

EOInstall

$pressreinstall=<<EOInstall;

                                WARNING
  Don\'t use this method if you are not willing to reinstall this package...

This is not a real file. It is a way to reinstall the package you are browsing.

To reinstall this package go back to the panel and press Enter on this file.

EOInstall

$pressremove=<<EOInstall;

                                WARNING
  Don\'t use this method if you are not willing to remove this package...

This is not a real file. It is a way to remove the package you are browsing.

To remove this package go back to the panel and press Enter on this file.

EOInstall

$presspurge=<<EOInstall;

                                WARNING
  Don\'t use this method if you are not willing to purge this package...

This is not a real file. It is a way to purge the package you are browsing.

To purge this package go back to the panel and press Enter on this file.

EOInstall

$pressreconfigure=<<EOInstall;

                                WARNING
  Don\'t use this method if you are not willing to reconfigure this package...

This is not a real file. It is a way to reconfigure the package you are browsing.

To reconfigure this package go back to the panel and press Enter on this file.

EOInstall

$pressreinstall=<<EOInstall;

                                WARNING
  Don\'t use this method if you are not willing to reinstall this package...

This is not a real file. It is a way to reinstall the package you are browsing.

To reinstall this package go back to the panel and press Enter on this file.

EOInstall

$pressselect=<<EOInstall;

                                WARNING
  Don\'t use this method if you are not willing to select this package...

This is not a real file. It is a way to select the package you are browsing.

To select this package go back to the panel and press Enter on this file.

EOInstall

$pressunselect=<<EOInstall;

                                WARNING
  Don\'t use this method if you are not willing to unselect this package...

This is not a real file. It is a way to unselect the package you are browsing.

To unselect this package go back to the panel and press Enter on this file.

EOInstall

umask 077;

chop($name = `if [ -f "$ARGV[1]" ]; then cat $ARGV[1]; else echo $ARGV[1]; fi`);
$name =~ s%.*/([0-9a-z.-]*)_.*%$1%;

exit 1 unless $name;

if($ARGV[0] eq "list") { &list($name); exit 0; }
elsif($ARGV[0] eq "copyout") { &copyout($name,$ARGV[2],$ARGV[3]); exit 0; }
elsif($ARGV[0] eq "run") { &run($name,$ARGV[2]); exit 0; }

exit 1;

PKtm\<+��		extfs.d/ulibnuȯ��#! /usr/bin/perl -w
#
# VFS to manage the gputils archives.
# Written by Molnár Károly (proton7@freemail.hu) 2012
#

my %month = ('jan' => '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 (<PIPE>)
    {
        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 (<PIPE>)
    {
        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);
}
PKum\�j��extfs.d/debanuȯ��#! /usr/bin/perl
#
# 1999 (c) Piotr Roszatycki <dexter@debian.org>
# 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=<<EOInstall;

                                WARNING
  Don\'t use this method if you are not willing to install this package...

This is not a real file. It is a way to install the package you are browsing.

To install this package go back to the panel and press Enter on this file.

EOInstall

$pressupgrade=<<EOInstall;

                                WARNING
  Don\'t use this method if you are not willing to upgrade this package...

This is not a real file. It is a way to upgrade the package you are browsing.

To upgrade this package go back to the panel and press Enter on this file.

EOInstall


umask 077;

chop($name = `if [ -f "$ARGV[1]" ]; then cat $ARGV[1]; else echo $ARGV[1]; fi`);
$name =~ s%.*/([0-9a-z.-]*)_.*%$1%;

exit 1 unless $name;

if($ARGV[0] eq "list") { &list($name); exit 0; }
elsif($ARGV[0] eq "copyout") { &copyout($name,$ARGV[2],$ARGV[3]); exit 0; }
elsif($ARGV[0] eq "run") { &run($name,$ARGV[2]); exit 0; }

exit 1;

PKvm\�6[��%�%extfs.d/apt+nuȯ��#! /usr/bin/perl
#
# 1999 (c) Piotr Roszatycki <dexter@debian.org>
# 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(<PIPEIN>) {
           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( <STAT> ) {
       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( <STAT> ) {
       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=<<EOInstall;

                              WARNING
  Don\'t use this method if you don't want to retrieve new lists of packages.
  ==========================================================================

This is not a real file. It is a way to retrieve new lists of packages.
To update this information go back to the panel and press Enter on this file.

EOInstall

$pressupgrade=<<EOInstall;

                              WARNING
     Don\'t use this method if you are not willing to perform an upgrade.
     ===================================================================

This is not a real file. It is a way to perform an upgrade.
To upgrade this information go back to the panel and press Enter on this file.

EOInstall


# override any locale for dates
$ENV{"LC_ALL"}="C";

if ($ARGV[0] eq "list") { list(); exit(0); }
elsif ($ARGV[0] eq "copyout") { copyout($ARGV[2], $ARGV[3]); exit(0); }
elsif ($ARGV[0] eq "copyin") { copyin($ARGV[2], $ARGV[3]); exit(0); }
elsif ($ARGV[0] eq "run") { run($ARGV[2]); exit(0); }
elsif ($ARGV[0] eq "rm") { rm($ARGV[2]); exit(0); }
exit(1);

PKvm\+��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
PKwm\ʬW�+�+extfs.d/patchfsnuȯ��#! /usr/bin/perl -w
#
# Written by Adam Byrtek <alpha@debian.org>, 2002
# Rewritten by David Sterba <dave@jikos.cz>, 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++,$_=<I>)) {
	$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
	    $_ .=<I>;	# 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;
PKxm\�Y��zz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 <sav@bcs.zp.ua> 2000
#
# Andrew Borodin <aborodin@vmail.ru>
# David Haller <dnh@opensuse.org>
#	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
PKxm\iU0�XXextfs.d/mailfsnuȯ��#! /usr/bin/perl -w

use bytes;

# MC extfs for (possibly compressed) Berkeley style mailbox files
# Peter Daum <gator@cs.tu-berlin.de> (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 (<IN>) {
	$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(<IN>) {
	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(<IN>) {
	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;
PKym\$AN���extfs.d/iso9660nuȯ��#! /bin/sh
# Midnight Commander - ISO9660 VFS for MC
# based on lslR by Tomas Novak <tnovak@ipex.cz>   April 2000
#
# Copyright (C) 2000, 2003
# The Free Software Foundation, Inc.
#
# Written by:
#  Michael Shigorin <mike@altlinux.org>,
#  Grigory Milev <week@altlinux.org>,
#  Kachalov Anton <mouse@linux.ru.net>, 2003
#  Victor Ananjevsky <ananasik@gmail.com>, 2013
#  slava zanko <slavazanko@gmail.com>, 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 <http://www.gnu.org/licenses/>.

#*** 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
PKzm\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);
PKzm\�XXextfs.d/debnuȯ��#! /usr/bin/perl
#
# Written by Fernando Alegre <alegre@debian.org> 1996
#
# Applied patch by Dimitri Maziuk <emaziuk@curtin.edu.au> 1997
#         (to handle new tar format)
#
# Modified by Fernando Alegre <alegre@debian.org> 1997
#         (to handle both new and old tar formats)
#
# Modified by Patrik Rak <prak@post.cz> 1998
#         (add by Michael Bramer Debian-mc-maintainer <grisu@debian.org>)
#         (to allow access to package control files)
#
# Modified by Martin Bialasinski <martinb@debian.org> 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(<PIPEIN>)
		{
			@_ = 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(<PIPEIN>)
               {
                       @_ = 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=<<EOInstall;

                              WARNING
     Don\'t use this method if you are not willing to reinstall everything...

This is not a real file. It is a way to install the package you are browsing.

To install this package go back to the panel and press Enter on this file.

In Debian systems, a package is automatically upgraded when you install a new
version of it. There is no special upgrade option. Install always works.

EOInstall

umask 077;

if($ARGV[0] eq "list") { shift; &mcdebfs_list(@ARGV); exit 0; }
elsif($ARGV[0] eq "copyout") { shift; &mcdebfs_copyout(@ARGV); exit 0; }
elsif($ARGV[0] eq "run") { shift; &mcdebfs_run(@ARGV); exit 0; }

exit 1;

PK{m\���++extfs.d/uarnuȯ��#!/bin/sh
#
# Written by    Alex Kuchma <ask@bcs.zp.ua>
#               Alex Tkachenko <alex@bcs.zp.ua>
# Updated by    Vitezslav Samel <xsamel00@dcse.fee.vutbr.cz>
#
# (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|m\~���&#&#
extfs.d/dpkg+nuȯ��#! /usr/bin/perl
#
# 1999 (c) Piotr Roszatycki <dexter@debian.org>
# 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( <STAT> ) {
       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=<<EOInstall;

                              WARNING
     Don\'t use this method if you are not willing to configure all
                     non configured packages.

This is not a real file. It is a way to configure all non configured packages.

To configure packages go back to the panel and press Enter on this file.

EOInstall

$pressremove=<<EOInstall;

                              WARNING
     Don\'t use this method if you are not willing to remove all 
                      unselected packages.

This is not a real file. It is a way to remove all unselected packages.

To remove packages go back to the panel and press Enter on this file.

EOInstall

$pressforgetoldunavail=<<EOInstall;

                              WARNING
     Don\'t use this method if you are not willing to forget about
                 uninstalled unavailable packages.

This is not a real file. It is a way to forget about uninstalled
unavailable packages.

To forget this information go back to the panel and press Enter on this file.

EOInstall

$pressclearavail=<<EOInstall;

                              WARNING
     Don\'t use this method if you are not willing to erase the existing
           information about what packages are available.

This is not a real file. It is a way to erase the existing information
about what packages are available.

To clear this information go back to the panel and press Enter on this file.

EOInstall



# override any locale for dates
$ENV{"LC_ALL"}="C";

if ($ARGV[0] eq "list") { list(); exit(0); }
elsif ($ARGV[0] eq "copyout") { copyout($ARGV[2], $ARGV[3]); exit(0); }
elsif ($ARGV[0] eq "copyin") { copyin($ARGV[2], $ARGV[3]); exit(0); }
elsif ($ARGV[0] eq "run") { run($ARGV[2],$ARGV[3]); exit(0); }
#elsif ($ARGV[0] eq "rm") { rm($ARGV[2]); exit(0); }
exit(1);

PK|m\�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}m\�r���extfs.d/lslRnuȯ��#! /bin/sh

# Based on previous version of lslR
# Modified by Tomas Novak <tnovak@ipex.cz>   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�m\�:��MM
extfs.d/hp48+nuȯ��#!/bin/sh
#
# Written by Christofer Edvardsen <ce@earthling.net>, 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 (<left shift> - i/o - iopar): 
#        port: wire
#        baud: 9600 
#        transfer format: binary (fast transfers) or
#                         ascii (editable on the pc)
#      - start the server on the HP48: <left shift> - i/o - srvr - serve
#        or the shortcut <right shift> - <right arrow>
#      - 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�m\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�m\�����extfs.d/uhanuȯ��#!/bin/sh
#
# It is the uhafs Valery Kornienkov vlk@st.simbirsk.su 2:5051/30@fidonet
# ver 0.1 Thu Apr  6 12:05:08 2000
#
# Tested with HA 0.999.  Source of ha can be found at
# ftp://ftp.ibiblio.org/pub/Linux/utils/compress/

HA=ha

mchafs_list ()
{
    $HA lf "$1" 2>/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�m\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
# <jpelletier@ieee.org>
#

# 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�m\��r�extfs.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�m\�8���extfs.d/u7znuȯ��#! /bin/sh
#
# extfs support for p7zip
# Written by Pavel Roskin <proski@gnu.org>
# Some Bugfixes/workarounds by Sergiy Niskorodov <sgh@mail.zp.ua>
#
# 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 <http://www.gnu.org/licenses/>.

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�m\��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�m\��||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�m\�\���
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�m\��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�m\��l�kkext.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�m\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�m\�pQ��ext.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�m\�^�
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�m\^��
��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�m\.�(��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�m\�~�~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
PKYm\�K�f0404
cons.savernuȯ��PK[m\�붕��j4mc.shnu�[���PK\m\�8���85fish/mvnu�[���PK]m\�Ρ��5fish/lsnu�[���PK`m\���egg�Hfish/getnu�[���PK`m\j�Oc��	tQfish/infonu�[���PKam\%�,ee�Ufish/README.fishnu�[���PKbm\�,�XX+ofish/fexistsnu�[���PKbm\����oo
�ofish/rmdirnu�[���PKcm\�H?���	hpfish/sendnu�[���PKdm\���	rr[rfish/unlinknu�[���PKdm\�C����sfish/appendnu�[���PKem\�Xw��
�tfish/chmodnu�[���PKfm\k�xE��
�ufish/hardlinknu�[���PKgm\�*�3���vfish/lnnu�[���PKgm\�A�oo
�wfish/mkdirnu�[���PKhm\�ee
Dxfish/utimenu�[���PKim\�ȼȬ�
�zfish/chownnu�[���PKim\�L��11�{mc.cshnu�[���PKkm\���$$0|extfs.d/uarcnuȯ��PKkm\~�*�((
��extfs.d/audionuȯ��PKlm\E;r@55��extfs.d/rpmnuȯ��PKmm\��y<�;�;1�extfs.d/uzipnuȯ��PKmm\�Wp��

�extfs.d/a+nuȯ��PKnm\>��S���extfs.d/trpmnuȯ��PKom\TGZ{

�%extfs.d/changesetfsnuȯ��PKom\��O��/extfs.d/ulhanuȯ��PKpm\�8��AAA?extfs.d/uzoonuȯ��PKqm\�:nn�Eextfs.d/README.extfsnu�[���PKqm\A��˷�pJextfs.d/bppnuȯ��PKrm\��bOextfs.d/ualznuȯ��PKsm\��&&�Textfs.d/READMEnu�[���PKtm\砜�))rextfs.d/debdnuȯ��PKtm\<+��		E�extfs.d/ulibnuȯ��PKum\�j����extfs.d/debanuȯ��PKvm\�6[��%�%Ȳextfs.d/apt+nuȯ��PKvm\+��hww�extfs.d/uarjnuȯ��PKwm\ʬW�+�+��extfs.d/patchfsnuȯ��PKxm\�Y��zz~extfs.d/urarnuȯ��PKxm\iU0�XX4extfs.d/mailfsnuȯ��PKym\$AN����3extfs.d/iso9660nuȯ��PKzm\3�;���
�Jextfs.d/rpms+nuȯ��PKzm\�XX�Pextfs.d/debnuȯ��PK{m\���++Sfextfs.d/uarnuȯ��PK|m\~���&#&#
�kextfs.d/dpkg+nuȯ��PK|m\�w����extfs.d/ucabnuȯ��PK}m\�r���6�extfs.d/lslRnuȯ��PK�m\�:��MM
�extfs.d/hp48+nuȯ��PK�m\A?0�		~�extfs.d/patchsetfsnuȯ��PK�m\�����Ưextfs.d/uhanuȯ��PK�m\a����ʳextfs.d/uacenuȯ��PK�m\��r��extfs.d/gitfs+nuȯ��PK�m\�8���6�extfs.d/u7znuȯ��PK�m\��dv\\H�ext.d/package.shnuȯ��PK�m\��||��ext.d/sound.shnuȯ��PK�m\�\���
��ext.d/text.shnuȯ��PK�m\��55��ext.d/web.shnuȯ��PK�m\��l�kk>�ext.d/image.shnuȯ��PK�m\Y�:A����ext.d/doc.shnuȯ��PK�m\�pQ���ext.d/archive.shnuȯ��PK�m\�^�
�ext.d/misc.shnuȯ��PK�m\^��
���ext.d/video.shnuȯ��PK�m\.�(���!mc-wrapper.cshnu�[���PK�m\�~�~MM
�#mc-wrapper.shnu�[���PK@@U%

AnonSec - 2021