Original image by Richard 'Tenspeed' Heaven http://www.flickr.com/photos/tenspeedphotography/3998633721/

One of the design-goals for IPS was that scripting should be moved out of the packaging system, preferring scripting to only ever occur on the environment the software was intended to run in (eg. after boot, rather than at install time) – Stephen talks more about that here.

Related to that, I’ve had a chance to do a bit more work on pkgsend(1) recently to help developers through this transition. With the putback of:

changeset:   2276:d774031d55bd
user:        Tim Foster 
date:        Thu Mar 24 09:56:10 2011 +1300
	17826 pkgsend should warn for potentially problematic SVR4 packages
	17891 pkgsend could convert more parameters from a SVR4 pkginfo file
	17905 pkgsend should return a better warning for multi-package datastreams

pkgsend is now more helpful in how it deals with SVR4 packages.

Up till now, when converting packages from SVR4 to IPS, pkgsend has ignored any preinstall, postinstall, preremove, postremove and class-action scripts that may have been present in the SVR4 package. So while this would give users an installable IPS version of their packages, there’s a good chance that the packages wouldn’t have functioned properly, as the scripts would not have run.

With this small change, we now report errors when encountering scripting, giving the package developer a heads-up that a little more work is needed in order to properly convert their package and will tell them exactly what things need attention. For example:

timf@linn[29] $(pkgsend open test/example@1.0)
timf@linn[30] pkgsend import ./SUNWsshdr
pkgsend: Abandoning transaction due to errors.

pkgsend: import: ERROR: script present in SUNWsshdr: postinstall
pkgsend: import: ERROR: class action script used in SUNWsshdr: etc/ssh/sshd_config belongs to "sshdconfig" class

Investigating this particular sample package (an old S10 version of ssh) the postinstall script makes sysidconfig do ssh host-key-generation, (something that’s now done automatically by the SMF method script for ssh) and the sshdconfig script removes any “CheckMail” entries from any preserved sshd_config files previously installed.

Along with these changes, we’re also converting more information from the SVR4 pkginfo file – populating the package description and summary fields automatically, and creating pkg.send.convert.* attributes for other pkginfo parameters that may have been defined.

The expectation is that package developers will change those attribute names to a name that better suits their needs, either by editing the manifest that pkgsend generate produces for you from the SVR4 package, or by using pkgmogrify(1).

Hopefully these changes make pkgsend a little more helpful to developers when converting their SVR4 packages over to IPS.

About these ads