Re: [BUG] urar extfs in mc-4.6.0-pre2
- From: Tomas Styblo <tripie cpan org>
- To: mc-devel gnome org
- Subject: Re: [BUG] urar extfs in mc-4.6.0-pre2
- Date: Thu, 2 Jan 2003 23:52:39 +0100
* Pavel Roskin <proski gnu org> [Thu, 02 Jan 2003]:
> > 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.
>
> However, if unrar is missing, the error code is always the same
> (130 if I remember correctly) under every shell, so you can test
> it.
This is what SUSv3 says:
~~~ SNIP ~~~
If a command is not found, the exit status shall be 127. If the
command name is found, but it is not an executable utility, the
exit status shall be 126.
~~~ SNIP ~~~
Return value 130 would mean the process was killed by SIGINT.
> You can also find a simplified PATH search in shell in the
> "bootstrap" script in CVS automake.
It's less complicated to just test the return value.
New version of the bugfix is attached.
--
Tomas Styblo <tripie cpan org>
PGP: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xC97EA4B6
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 Thu Jan 2 23:45:15 2003
@@ -8,15 +8,24 @@
#
RAR=rar
UNRAR=unrar # 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 -o $? -eq $RET_CMD_NOT_EXEC; then
UNRAR=$RAR
+ $UNRAR >/dev/null 2>&1
+ if test $? -eq $RET_CMD_NOT_FOUND -o $? -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} '
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]