Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 35032 | Differences between
and this patch

Collapse All | Expand All

(-)../work/mc-4.1.40-pre9/lib/mc.ext.in (+7 lines)
Lines 152-157 Link Here
152
	Compile=c++ -O -c %f
152
	Compile=c++ -O -c %f
153
	Link=c++ -O -o %d/`basename %f .c` %f
153
	Link=c++ -O -o %d/`basename %f .c` %f
154
154
155
# 7zip file archive
156
# This must be added before Manual pages Lines to prevent handle 7z archive
157
# like man page
158
regex/\.(7z|7Z)$
159
	View=%view{ascii} 7za l %f 2>/dev/null
160
	Open=%cd %p#u7z
161
155
### Documentation ###
162
### Documentation ###
156
163
157
# Texinfo
164
# Texinfo
(-)../work/mc-4.1.40-pre9/vfs/extfs/extfs.ini (+2 lines)
Lines 27-29 Link Here
27
apt=
27
apt=
28
# ISO9660 image Virtual FileSystem
28
# ISO9660 image Virtual FileSystem
29
iso= .iso .ISO
29
iso= .iso .ISO
30
# 7zip file archive
31
u7z=.7z .7Z
(-)../work/mc-4.1.40-pre9/vfs/extfs/u7z (+156 lines)
Line 0 Link Here
1
#! /bin/sh
2
#
3
# u7z - 7zip file archive Virtual File System for Midnight Commander ( ftp://ftp.ibiblio.org/pub/Linux/utils/file/managers/mc/ )
4
# 
5
# Copyright (C) 2004 Sergiy Niskorodov (sgh at ukrpost dot net)
6
7
# Written by Sergiy Niskorodov aka SGh
8
#
9
# beta version 4.14.2 (04 Mar 2005)
10
#
11
# 7z for linux can be found on http://sourceforge.net/projects/p7zip/
12
13
14
# Thanks to urar VFS authors andrey joukov 2:5020/337.13@fidonet.org, 
15
# christian.gennerat@alcatel.fr, Andrew V. Samoilov <sav@bcs.zp.ua>
16
# I use this script like example
17
18
19
# This program is free software; you can redistribute it and/or modify
20
# it under the terms of the GNU General Public License as published by
21
# the Free Software Foundation; either version 2 of the License, or
22
# (at your option) any later version.
23
# 
24
# This program is distributed in the hope that it will be useful,
25
# but WITHOUT ANY WARRANTY; without even the implied warranty of
26
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
27
# GNU General Public License for more details.
28
# 
29
# You should have received a copy of the GNU General Public License
30
# along with this program; if not, write to the Free Software
31
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
32
33
34
SEVENZ=`which 7za`
35
36
37
mc7zfs_list ()
38
{
39
    $SEVENZ l "$1" 2> /dev/null | gawk -v uid=${UID-0} '
40
BEGIN { flag=0 }
41
 /^-------/ { flag++; if (flag > 1) exit 0; next }
42
{
43
if (flag == 0) next
44
45
year=substr($1, 1, 4)
46
month=substr($1, 6, 2)
47
day=substr($1, 9, 2)
48
date=month "-" day "-" year
49
50
time=substr($2, 1, 5)
51
52
if (index($3, "D") != 0)
53
    attr="drwxr-xr-x"
54
else
55
if (index($3, ".") != 0)
56
    attr="-rw-r--r--"
57
58
size=$4
59
60
$0=substr($0, 54)
61
if (NF > 1)
62
    name=$0
63
else
64
    name=$1
65
66
gsub(/\\/, "/", name)
67
68
printf "%s   1 %-8d %-8d %8d %s %s %s\n", attr, uid, 0, size, date, time, name
69
}'
70
}
71
72
mc7zfs_copyin ()
73
{
74
# preserve pwd.
75
    pwd=`pwd`
76
# Create a directory and copy in it the tmp file with the random name
77
    dir="$3".dir
78
    mkdir "$dir"
79
    cd "$dir"
80
    mv "$1" .
81
    arname=`basename "$1"`
82
    di="${2%/*}"
83
# if file is to be written upper in the archive tree, make fake dir
84
    if test "$di" != "${2##*/}" ; then
85
#	echo asdsad 1>&2
86
        mkdir -p "$di" 
87
    fi
88
#    pwd > /tmp/cdir
89
#    echo "$arname $2" > /tmp/ters
90
    cp -fp "$3" "$dir/$2"
91
#    cp -f "$1" "$3.dir"
92
    $SEVENZ a "$arname" "$2" -w >/dev/null 2> /dev/null
93
    mv "$arname" "$1"
94
    cd $pwd
95
    rm -rf "$3.dir"
96
}
97
98
mc7zfs_copyout ()
99
{
100
    dir=tmpdir.${RANDOM}
101
    mkdir /tmp/"$dir"
102
#    echo "$1 $2 $3" > hers
103
#	p7zip 0.91 don't understand filename in subdir without "./"
104
#	but in top dir it understand only without "./"
105
    FLIST=`$SEVENZ l "$1" 2> /dev/null`
106
    echo "$FLIST" | grep "[.][/]" > /dev/null 2>&1 && echo "$2" | grep "\/" > /dev/null 2>&1 && EXFNAME=*./"$2" || EXFNAME="$2"
107
    EXFN=`basename "$2"`
108
    $SEVENZ e -r- "$1" "$EXFNAME" -o/tmp/"$dir" > /dev/null 2> /dev/null
109
110
    cat /tmp/"$dir"/"$EXFN" > "$3"
111
    rm -rf /tmp/"$dir"
112
}
113
114
mc7zfs_mkdir ()
115
{
116
# Function not fully implemented, because 7z cannot keep empty directories
117
# preserve pwd.
118
    pwd=`pwd`
119
# Create a directory and create in it a tmp directory with the good name     
120
    dir=tmpdir.${RANDOM}
121
    mkdir $dir
122
    cd $dir
123
    mv "$1" .
124
    arname=`basename "$1"`
125
    mkdir -p "$2"
126
# 7z cannot create an empty directory    
127
#    touch "$2"/.emptydir
128
    $SEVENZ a -r "$arname" "$2" >/dev/null 2>/dev/null
129
#    echo "$1" "$2" >error34
130
#    $SEVENZ d ../"$1" "$2/.7zfs" >/dev/null
131
    mv "$arname" "$1"
132
    cd $pwd
133
    rm -rf $dir
134
}
135
136
mc7zfs_rm ()
137
{
138
    $SEVENZ l "$1" 2> /dev/null | grep "[.][\\]" > /dev/null 2>&1 && echo "$2" | grep "\/" > /dev/null 2>&1 && EXFNAME=*./"$2" || EXFNAME="$2"
139
    $SEVENZ d "$1" "$EXFNAME" >/dev/null 2> /dev/null
140
}
141
142
umask 077
143
144
cmd="$1"
145
shift
146
147
case "$cmd" in
148
  list)    mc7zfs_list    "$@" ;;
149
  rm)      mc7zfs_rm      "$@" ;;
150
  rmdir)   mc7zfs_rm      "$@" ;;
151
  mkdir)   mc7zfs_mkdir   "$@" ;;
152
  copyin)  mc7zfs_copyin  "$@" ;;
153
  copyout) mc7zfs_copyout "$@" ;;
154
  *) exit 1 ;;
155
esac
156
exit 0
(-)../work/mc-4.1.40-pre9/vfs/Makefile.in (-1 / +3 lines)
Lines 33-39 Link Here
33
VFSOBJS = $(NONETFILES) @NETFILES@
33
VFSOBJS = $(NONETFILES) @NETFILES@
34
34
35
EXTFSSTUFF = README extfs.ini a cpio deb ftplist lha lslR \
35
EXTFSSTUFF = README extfs.ini a cpio deb ftplist lha lslR \
36
	rar rpm zip zoo arfs patchfs mailfs hp48 iso
36
	rar rpm zip zoo arfs patchfs mailfs hp48 iso u7z
37
37
38
#
38
#
39
# Distribution variables
39
# Distribution variables
Lines 123-128 Link Here
123
	$(INSTALL_PROGRAM) extfs/mailfs $(DESTDIR)$(libdir)/extfs/mailfs                        
123
	$(INSTALL_PROGRAM) extfs/mailfs $(DESTDIR)$(libdir)/extfs/mailfs                        
124
	$(INSTALL_PROGRAM) extfs/audio $(DESTDIR)$(libdir)/extfs/audio
124
	$(INSTALL_PROGRAM) extfs/audio $(DESTDIR)$(libdir)/extfs/audio
125
	$(INSTALL_PROGRAM) extfs/patchfs $(DESTDIR)$(libdir)/extfs/patchfs
125
	$(INSTALL_PROGRAM) extfs/patchfs $(DESTDIR)$(libdir)/extfs/patchfs
126
	$(INSTALL_PROGRAM) extfs/u7z $(DESTDIR)$(libdir)/extfs/u7z
126
127
127
uninstall:
128
uninstall:
128
	-$(RMF) $(DESTDIR)$(libdir)/extfs/rpm
129
	-$(RMF) $(DESTDIR)$(libdir)/extfs/rpm
Lines 136-141 Link Here
136
	-$(RMF) $(DESTDIR)$(libdir)/extfs/iso
137
	-$(RMF) $(DESTDIR)$(libdir)/extfs/iso
137
	-$(RMF) $(DESTDIR)$(libdir)/extfs/lslR
138
	-$(RMF) $(DESTDIR)$(libdir)/extfs/lslR
138
	-$(RMF) $(DESTDIR)$(libdir)/extfs/ftplist
139
	-$(RMF) $(DESTDIR)$(libdir)/extfs/ftplist
140
	-$(RMF) $(DESTDIR)$(libdir)/extfs/u7z
139
	-$(RMF) $(DESTDIR)$(libdir)/extfs/extfs.ini
141
	-$(RMF) $(DESTDIR)$(libdir)/extfs/extfs.ini
140
	-$(RMF) $(DESTDIR)$(libdir)/extfs/README
142
	-$(RMF) $(DESTDIR)$(libdir)/extfs/README
141
	-rmdir $(DESTDIR)$(libdir)/extfs
143
	-rmdir $(DESTDIR)$(libdir)/extfs

Return to bug 35032