[BUG] urar extfs in mc-4.6.0-pre2
Tomas Styblo
tripie at cpan.org
Mon Dec 30 00:02:58 UTC 2002
* Dmitry Semyonov <Dmitry.Semyonov at oktet.ru> [Mon, 30 Dec 2002]:
> I have only unrar installed. This shall be enough to brouse rar
> archives and to extract files from them. I'll try to upgrade to
> unrar 3.x (after Jan,9), and see how it works. But even if it
> will work, do you think it is OK to use such unrar detection
> code that can't properly detect old versions of unrar inside
> urar extfs script?
The problem is not that mc can't find the unrar executable.
There is a bug in the new urar script.
The pre1 version of the script goes like:
DRAR=/usr/bin
RAR=$DRAR/rar
UNRAR=$DRAR/unrar # Prefer unrar (freeware)
The pre2 version goes like:
RAR=rar
UNRAR=unrar # Prefer unrar (freeware)
if ! unrar >/dev/null 2>&1; then
UNRAR=$RAR
fi
Therefore it fails if the rar executable is not present in the
system, because the "if ! unrar" test always fails. It always
fails, because unrar exits with code "7" if it is called with no
arguments.
Both the rar and unrar executables are installed by default if you
use the above mentioned version 3 of the rar package. It's
probably the easiest solution for you now. But the urar script of
course should be fixed.
The bugfix patch is attached to this message.
--
Tomas Styblo <tripie at cpan.org>
PGP: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xC97EA4B6
-------------- next part --------------
diff -purN mc-4.6.0-pre2/vfs/extfs/urar.in mc-4.6.0-pre2.new/vfs/extfs/urar.in
--- mc-4.6.0-pre2/vfs/extfs/urar.in Thu Dec 12 15:08:25 2002
+++ mc-4.6.0-pre2.new/vfs/extfs/urar.in Mon Dec 30 00:57:01 2002
@@ -6,17 +6,22 @@
# Andrew V. Samoilov <sav at bcs.zp.ua> 2000
# beta version 2.0
#
-RAR=rar
-UNRAR=unrar # Prefer unrar (freeware)
+RAR=`which rar 2>/dev/null`
+UNRAR=`which unrar 2>/dev/null` # Prefer unrar (freeware)
#
# NOTE: rar ver 2.0 by Eugene Roshal
# ftp.elf.stuba.sk/pub/pc/pack
#
-if ! unrar >/dev/null 2>&1; then
+if test -z "$UNRAR"; then
UNRAR=$RAR
fi
+if test -z "$UNRAR"; then
+ echo "Cannot find unrar or rar executable in PATH" >&2
+ exit 1
+fi
+
mcrarfs_list ()
{
$UNRAR v -c- "$1" | @AWK@ -v uid=${UID-0} '
More information about the mc-devel
mailing list