Re: Cannot open rar archives



Andrew Borodin wrote:
  Hi!

  When I try enter into rar archives, the error message "/usr/share/mc/extfs/urar: rar: command not found"
is shown. It's true - I don't have rar program in my Linux. But I have
unrar. I don't need to create or modify rar archives, just unpack only.

  IMHO, it is not very well when the free program (mc) requires
proprietary program (rar) by default. The simple workaround to allow mc
enter into rar archives is install unrar and do

  $ cd /usr/bin && ln -s unrar rar

Can you test attached patch?
You will have same problem if unrar is function or alias, but in your case it must help.

--
Regards,
Andrew V. Samoilov
--- vfs/extfs/urar.in~  Fri Jan 17 13:30:13 2003
+++ vfs/extfs/urar.in   Fri Jan 17 14:03:38 2003
@@ -7,15 +7,25 @@
 # beta version 2.0
 #
 RAR=rar
-UNRAR=unrar # Prefer unrar (freeware)
-#
+UNRAR=$RAR
 # NOTE: rar ver 2.0 by Eugene Roshal
 # ftp.elf.stuba.sk/pub/pc/pack
 #
 
-if ! unrar >/dev/null 2>&1; then
-    UNRAR=$RAR
-fi
+# Prefer unrar (freeware)
+# unrar without parameters returns undocumented value
+as_save_IFS="$IFS"; IFS=:
+for i in $PATH; do
+    IFS="$as_save_IFS"
+    : ${i:-.}
+    if test -x $i/unrar -a -f $i/unrar; then
+       UNRAR=$i/unrar
+       break
+    fi
+done
+
+unset as_save_IFS
+unset i
 
 mcrarfs_list ()
 {


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