Subject: pkg/7076: "install" scripts are not working in pkg_install-19990119.
To: None <gnats-bugs@gnats.netbsd.org>
From: None <woods@mail.weird.com>
List: netbsd-bugs
Date: 03/02/1999 16:49:57
>Number:         7076
>Category:       pkg
>Synopsis:       "install" scripts are not working in pkg_install-19990119.
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Mar  2 14:05:00 1999
>Last-Modified:
>Originator:     Greg A. Woods
>Organization:
Planix, Inc.; Toronto, Ontario; Canada
>Release:        pkg_install-19990119, pkgsrc-current @ Tue Feb  9 08:18:01 EST 1999
>Environment:

System: NetBSD

>Description:

	It seems that "install" scripts are not working in
	pkg_install-19990119.

	I suspect someone took out the use of /bin/sh without adding a
	chmod +x.

	I just finished creating a new package (well, porting it from
	FreeBSD ;-), one which uses an "install" script, and it failed
	to install.  So I went searching for other packages that I'd
	built previously which used "install" scripts, and sure enough I
	found one, and sure enough it had installed correctly before I
	had upgraded pkg_install.

>How-To-Repeat:

	This example package was created before upgrading pkgtools, and
	was already successfully installed on this system.  First I
	upgraded pkgtools to the 19990119 version, then I did the
	following:

16:08 [704] # pkg_delete gv-3.5.8
Key not present.
Key not present.
Key not present.
Key not present.
Key not present.
Key not present.
Key not present.
Key not present.
Key not present.
Key not present.
Key not present.
Key not present.
Key not present.
Key not present.
Key not present.
Key not present.
Key not present.
Key not present.
Key not present.
Key not present.
Key not present.
Key not present.
Key not present.
Key not present.
Key not present.
Key not present.

	(note the noise from a missing pkgdb.byfile.db too!)

16:08 [705] # pkg_delete -v gv-3.5.8
pkg_delete: no such package 'gv-3.5.8' installed
pkg_delete: 1 package deletion(s) failed

16:08 [707] # pkg_add -v gv-3.5.8.tgz 
Requested space: 874012 bytes, free space: 231063552 bytes in /var/tmp/instmp.27204a
Package `gv-3.5.8' depends on `Xaw3d-1.5'.
 - Xaw3d-1.5 already installed.
Package `gv-3.5.8' depends on `ghostscript-5.50'.
 - ghostscript-5.50 already installed.
Package `gv-3.5.8' depends on `png-1.0.2'.
 - png-1.0.2 already installed.
Running install with PRE-INSTALL for gv-3.5.8.
./+INSTALL: permission denied
pkg_add: install script returned error status
pkg_add: 1 package addition(s) failed

16:08 [708] # ll gv-3.5.8.tgz 
395333 448 -rw-r--r--  1 woods  wheel  218503 Jan 19 14:47 gv-3.5.8.tgz

16:11 [709] # pax -vzf gv-3.5.8.tgz +INSTALL                                  
-rw-r--r--  1 woods    wheel        317 Sep  1  1998 +INSTALL
pax: ustar vol 1, 33 files, 495616 bytes read, 0 bytes written.

	(Note that the script in the archive is not executable.)

>Fix:

	I'd suggest forcing a "chmod +x ./+INSTALL" before trying to
	execute the script as this will have the most chance of being
	backwards compatible.

	It wouldn't hurt to do that before creating the archive too, for
	future consistency.
>Audit-Trail:
>Unformatted: