[BUG] urar extfs in mc-4.6.0-pre2

Tomas Styblo tripie at cpan.org
Fri Jan 3 06:03:48 UTC 2003


* Tomas Styblo <tripie at cpan.org> [Thu, 02 Jan 2003]:
> New version of the bugfix is attached.

I have to reply to my own post.

This is an update to the patch.

I looked up the "test" command in the standard and noticed that the
"-o" option is an XSI extension.

The lines

    if test $? -eq $RET_CMD_NOT_FOUND -o $? -eq $RET_CMD_NOT_EXEC; then

were changed to

    if test $? -eq $RET_CMD_NOT_FOUND || test $? -eq $RET_CMD_NOT_EXEC; then

-- 
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	Fri Jan  3 06:58:54 2003
@@ -7,16 +7,25 @@
 # beta version 2.0
 #
 RAR=rar
-UNRAR=unrar # Prefer unrar (freeware)
+UNRAR=unrarx # Prefer unrar (freeware)
+RET_CMD_NOT_EXEC=126
+RET_CMD_NOT_FOUND=127
 #
 # NOTE: rar ver 2.0 by Eugene Roshal
 # ftp.elf.stuba.sk/pub/pc/pack
 #
 
-if ! unrar >/dev/null 2>&1; then
+$UNRAR >/dev/null 2>&1
+if test $? -eq $RET_CMD_NOT_FOUND || test $? -eq $RET_CMD_NOT_EXEC; then
     UNRAR=$RAR
+    $UNRAR >/dev/null 2>&1
+    if test $? -eq $RET_CMD_NOT_FOUND || test $? -eq $RET_CMD_NOT_EXEC; then
+        echo "Cannot find rar or unrar in system PATH" >&2
+        exit 1
+    fi
 fi
 
+
 mcrarfs_list ()
 {
      $UNRAR v -c- "$1" | @AWK@ -v uid=${UID-0} '


More information about the mc-devel mailing list