Subject: bin/10925: pkg_add isn't very good at error checking sometimes.....
To: None <gnats-bugs@gnats.netbsd.org>
From: None <woods@weird.com>
List: netbsd-bugs
Date: 08/31/2000 11:00:35
>Number:         10925
>Category:       bin
>Synopsis:       pkg_add isn't very good at error checking.....
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 31 11:01:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Greg A. Woods
>Release:        20000618
>Organization:
Planix, Inc.; Toronto, Ontario; Canada
>Environment:

System: 		NetBSD q 1.5B i386
pkgtools_version:	20000618

>Description:

	It would seem that some parts of the pkg tools are less robust
	than others.  Failure to fully fetch a remote package in
	"pkg_add" will cause the partial copy to be partly installed
	despite the fact that error messages clearly indicated that
	the code detected the problem.

>How-To-Repeat:

	try adding a package from a remote server that'll time out
	after sending a bit of the file (or force the ftp to fail):

# pkg_add ftp://q/pub/NetBSD/packages/1.5B/i386/All/emacs-20.7.tgz    
setenv PKG_PATH='ftp://q/pub/NetBSD/packages/1.5B/i386/All'
pkg_add: expect: select() timeout                   
pkg_add: Cannot fetch file (-1!=226)!
Error on unpackURL('ftp://q/pub/NetBSD/packages/1.5B/i386/All/emacs-20.7.tgz', '/var/tmp/instmp.27373a')
pkg_add: unable to fetch `ftp://q/pub/NetBSD/packages/1.5B/i386/All/emacs-20.7.tgz' by URL
tar: cannot chown file share/emacs/20.7/etc/FAQ to uid 0 gid 0 : No such file or directory
tar: couldn't change access and modification times of share/emacs/20.7/etc/FAQ : No such file or directory
tar: cannot change mode of file share/emacs/20.7/etc/FAQ to 0444 : No such file or directory
tar: Could not create file share/emacs/20.7/etc/FTP : No such file or directory
tar: Could not create file share/emacs/20.7/etc/GNU : No such file or directory
^?Signal 2 received, cleaning up.
pkg_add: can't chdir back to '/var/tmp/instmp.27373a'
ksh: exit code: 2
# ftp: No control connection for command.

	note that the server does show the file was not fully
	transfered:

Aug 31 13:35:34 q ftpd[10936]: get /pub/NetBSD/packages/1.5B/i386/All/emacs-20.7.tgz = 3457024 bytes in 749.366 seconds

$ ls -l emacs*
-rw-r--r--  1 root  wheel  11736724 Aug 29 16:53 emacs-20.7.tgz


>Fix:

	none supplied
>Release-Note:
>Audit-Trail:
>Unformatted: