Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Aug 1997 00:05:09 +0900
From:      itojun@itojun.org
To:        hackers@freebsd.org
Subject:   GNUshar 4.2 and BSDshar
Message-ID:  <21193.872521509@itojun.csl.sony.co.jp>

next in thread | raw e-mail | index | archive | help
--boundary_872521509_21188_itojun.csl.sony.co.jp_/
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7bit
Content-ID: <part.00.872521509.21188@itojun.csl.sony.co.jp>

	When I try to extract some shar file generated by GNUshar 4.2
	on FreeBSD system, it will produce a garbage line like this:

>% sh gnushar-generated-file.shar
>sed: --print-text-domain-dir: No such file or directory	<---
>x - creating lock directory
>x - SKIPPING portlint.1 (file already exists)
>x - SKIPPING portlint.pl (file already exists)
>x - SKIPPING CHANGELOG (file already exists)

	This is because GNUshar generated shar file assumes that
	the shar command on system (/usr/bin/shar on FreeBSD box, which is
	BSDshar) exits with non-zero given an invalid option.
	(GNUshar uses this to check if GNUshar is installed or not.
	It is necessery for localized message display)
	BSDshar always exit with 0, so it will not work well with GNUshar
	generated shar files.

	I contacted the author of GNUshar, and he said that BSDshar must
	be fixed.

	Suggested patch to FreeBSD shar is attached.

	Questions:
	- does my patch break anything?  do any of you rely upon the
	  current BSDshar behavior(i.e. always exit with 0)?
	- I believe BSDshar is quite commonly used in practice,
	  so GNUshar should make some effort to support BSDshar's behavior.
	  could any of you try persuade the author of GNUshar? :-)

itojun
--boundary_872521509_21188_itojun.csl.sony.co.jp_/
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7bit
Content-ID: <part.1.872521509.21188@itojun.csl.sony.co.jp>

Index: shar.sh
===================================================================
RCS file: /home/ncvs/src/usr.bin/shar/shar.sh,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 shar.sh
--- shar.sh	1994/05/27 12:32:40	1.1.1.1
+++ shar.sh	1997/08/25 14:56:19
@@ -35,9 +35,17 @@
 #
 
 if [ $# -eq 0 ]; then
-	echo 'usage: shar file ...'
+	echo 'usage: shar file ...' 1>&2
 	exit 1
 fi
+
+for i
+do
+	if [ ! -e $i ]; then
+		echo "$i does not exist" 1>&2
+		exit 1
+	fi
+done
 
 cat << EOF
 # This is a shell archive.  Save it in a file, remove anything before
--boundary_872521509_21188_itojun.csl.sony.co.jp_/--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?21193.872521509>