Re: [BUG] urar extfs in mc-4.6.0-pre2



Tomas Styblo wrote:
* Dmitry Semyonov <Dmitry Semyonov 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.



------------------------------------------------------------------------

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 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)

Unfortunatelly which is not portable. I don't know is it documented in unrar to return 7 if it was called without arguments, or this is some random value dependent on compiler, architecture and temperature.

--
Regards,
Andrew V. Samoilov






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]