From a5ec25062164faf8ccc6b98469cd2731cbf365f0 Mon Sep 17 00:00:00 2001
From: Denis Kostousov <denis.kostousov@gmail.com>
Date: Fri, 31 Jul 2009 13:49:28 +0600
Subject: [PATCH] Work with lzma-based archives was added.
Signed-off-by: Denis Kostousov <denis.kostousov@gmail.com>
---
misc/mc.menu | 71 +++++++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 61 insertions(+), 10 deletions(-)
diff --git a/misc/mc.menu b/misc/mc.menu
index 81df70f..553a255 100644
a
|
b
|
shell_patterns=0 |
45 | 45 | tar cf - "$Pwd" | bzip2 -f > "$tar.tar.bz2" && \ |
46 | 46 | echo "../$tar.tar.bz2 created." |
47 | 47 | |
| 48 | 5 Compress the current subdirectory (tar.p7) |
| 49 | Pwd=`basename %d /` |
| 50 | echo -n "Name of the compressed file (without extension) [$Pwd]: " |
| 51 | read tar |
| 52 | if [ "$tar"x = x ]; then tar="$Pwd"; fi |
| 53 | cd .. && \ |
| 54 | tar cf - "$Pwd" | 7za a -si "$tar.tar.7z" && \ |
| 55 | echo "../$tar.tar.7z created." |
| 56 | |
| 57 | 6 Compress the current subdirectory (tar.lzma) |
| 58 | Pwd=`basename %d /` |
| 59 | echo -n "Name of the compressed file (without extension) [$Pwd]: " |
| 60 | read tar |
| 61 | if [ "$tar"x = x ]; then tar="$Pwd"; fi |
| 62 | cd .. && \ |
| 63 | tar cf - "$Pwd" | lzma -f > "$tar.tar.lzma" && \ |
| 64 | echo "../$tar.tar.lzma created." |
| 65 | |
| 66 | 7 Compress the current subdirectory (tar.lz) |
| 67 | Pwd=`basename %d /` |
| 68 | echo -n "Name of the compressed file (without extension) [$Pwd]: " |
| 69 | read tar |
| 70 | if [ "$tar"x = x ]; then tar="$Pwd"; fi |
| 71 | cd .. && \ |
| 72 | tar cf - "$Pwd" | lzip -f > "$tar.tar.lz" && \ |
| 73 | echo "../$tar.tar.lz created." |
| 74 | |
| 75 | 8 Compress the current subdirectory (tar.xz) |
| 76 | Pwd=`basename %d /` |
| 77 | echo -n "Name of the compressed file (without extension) [$Pwd]: " |
| 78 | read tar |
| 79 | if [ "$tar"x = x ]; then tar="$Pwd"; fi |
| 80 | cd .. && \ |
| 81 | tar cf - "$Pwd" | xz -f > "$tar.tar.xz" && \ |
| 82 | echo "../$tar.tar.xz created." |
48 | 83 | = f \.c$ & t r |
49 | 84 | + f \.c$ & t r & ! t t |
50 | | 5 Compile and link current .c file |
| 85 | Compile and link current .c file |
51 | 86 | make `basename %f .c` 2>/dev/null || cc -O -o `basename %f .c` %f |
52 | 87 | |
53 | 88 | + t r & ! t t |
… |
… |
U Uudecode marked news articles (needs work) |
186 | 221 | fi |
187 | 222 | echo "Please test the output file before deleting anything" |
188 | 223 | |
189 | | =+ f \.tar\.gz$ | f \.tar\.z$ | f \.tgz$ | f \.tpz$ | f \.tar\.Z$| f \.tar\.bz2$ & t r |
| 224 | =+ f \.tar\.gz$ | f \.tar\.z$ | f \.tgz$ | f \.tpz$ | f \.tar\.lz$ | f \.tar\.lzma$ | f \.tar\.lz$ | f \.tar\.7z$ | f \.tar\.xz$ | f \.tar\.Z$| f \.tar\.bz2$ & t r |
190 | 225 | x Extract the contents of a compressed tar file |
191 | | unset EXT |
192 | | case %f in |
193 | | *.tar.bz2) EXT=tar_bz2;; |
| 226 | unset PRG |
| 227 | case %f in |
| 228 | *.tar.bz2) |
| 229 | PRG="bunzip2 -c %f" |
| 230 | ;; |
| 231 | *.tar.gz|*.tar.z|*.tgz|*.tpz|*.tar.Z) |
| 232 | PRG="gzup -dc %f" |
| 233 | ;; |
| 234 | *.tar.lzma) |
| 235 | PRG="lzma -dc %f" |
| 236 | ;; |
| 237 | *.tar.lz) |
| 238 | PRG="lzip -dc %f" |
| 239 | ;; |
| 240 | *.tar.xz) |
| 241 | PRG="xz -dc %f" |
| 242 | ;; |
| 243 | *.tar.7z) |
| 244 | PRG="7za e -so %f" |
| 245 | ;; |
| 246 | *) |
| 247 | exit 1 |
| 248 | ;; |
194 | 249 | esac |
195 | | if [ "$EXT" = "tar_bz2" ]; then |
196 | | bunzip2 -c %f | tar xvf - |
197 | | else |
198 | | gzip -dc %f | tar xvf - |
199 | | fi |
| 250 | $PRG | tar xvf - |
200 | 251 | |
201 | 252 | = t r |
202 | 253 | + ! t t |