From owner-freebsd-hackers Mon Aug 25 08:06:15 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id IAA17188 for hackers-outgoing; Mon, 25 Aug 1997 08:06:15 -0700 (PDT) Received: from itojun.csl.sony.co.jp (root@itojun.csl.sony.co.jp [133.138.1.134]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id IAA17182 for ; Mon, 25 Aug 1997 08:06:07 -0700 (PDT) From: itojun@itojun.org Received: from localhost (itojun@localhost [127.0.0.1]) by itojun.csl.sony.co.jp (8.8.5/3.3W3) with ESMTP id AAA21196 for ; Tue, 26 Aug 1997 00:05:09 +0900 (JST) To: hackers@freebsd.org Subject: GNUshar 4.2 and BSDshar X-Template-Reply-To: itojun@itojun.org X-Template-Return-Receipt-To: itojun@itojun.org X-PGP-Fingerprint: F8 24 B4 2C 8C 98 57 FD 90 5F B4 60 79 54 16 E2 X-Mailer: comp (MHng project) version 1997/08/04 03:38:46, by Jun-ichiro Itoh MIME-Version: 1.0 Content-type: multipart/mixed; boundary="boundary_872521509_21188_itojun.csl.sony.co.jp_/" Content-ID: Date: Tue, 26 Aug 1997 00:05:09 +0900 Message-ID: <21193.872521509@itojun.csl.sony.co.jp> Sender: owner-freebsd-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk --boundary_872521509_21188_itojun.csl.sony.co.jp_/ Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit Content-ID: 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: 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_/--