Hi all,

I've got a working prototype for the svr4convert tool I'd been thinking
about.

At the moment, it crudely stitches together 'pkgsend generate' and
'pkgmogrify' functionality, and runs a default set of transforms.
It also looks for, and warns about scripting operations present in the
SVR4 package.

t...@linn[1181] svr4convert --help
Usage:
        svr4convert [-n] [-v <version>] <package>

Without -n, it writes a manifest and saves action data to 
"<package>.dir".  Like merge.py output, this manifest and directory can
then be passed to pkgsend.

There's a webrev (~500 lines of code) at:
http://cr.opensolaris.org/~timf/svr4-convert-prototype/

I've included some usage examples below.

At this stage, I'm interested in hearing whether we should continue to
pursue this venture, no need for a codereview just yet.

I do think this has the potential to lower the barrier for new users of
pkg(5) though am conscious of the fact that as soon as the tool reports
an error, the user will have to invest in learning the rest of the
pkg(5) publishing toolchain regardless.

Perhaps folding some of the warnings about SVR4 scripting would be
possible to do in pkgsend import/generate/publish' even if we don't
decide to go with this tool itself?

If there's a general consensus that svr4convert would be useful, I'll
work more on:

    * generally polishing up the code & writing tests
    * doing the right thing for pkg.variant.zone
    * investigate including pkgdepend functionality
      (I'd like to ignore svr4 depend files please!)
    * look for more class action scripts we could deal with
    * heuristics, eg. hinting at user actions in warnings when
      useradd(1M) is grepped for in a script

        cheers,
                        tim

Basic usage:

t...@linn[1105] svr4convert -v 1,0 SUNWsshdu                           
set name=pkg.arch value=i386
set name=variant.opensolaris.zone value=global value=nonglobal
set name=pkg.fmri value=pkg:/sunwss...@1,0
legacy arch=i386 category=system desc="Secure Shell protocol Server" 
hotline="Please contact your local service provider" name="SSH Server, (Usr)" 
pkg=SUNWsshdu vendor="Sun Microsystems, Inc." 
version=11.10.0,REV=2005.01.21.16.34
set name=pkg.description value="Secure Shell protocol Server"
set name=pkg.summary value="SSH Server, (Usr)"
license copyright license=SUNWsshdu.copyright pkg.size=746
dir group=sys mode=0755 owner=root path=usr
dir group=bin mode=0755 owner=root path=usr/lib
dir group=bin mode=0755 owner=root path=usr/lib/ssh
file usr/lib/ssh/sftp-server group=bin mode=0555 owner=root 
path=usr/lib/ssh/sftp-server pkg.size=35400
file usr/lib/ssh/sshd group=bin mode=0555 owner=root path=usr/lib/ssh/sshd 
pkg.size=319572
t...@linn[1106] pkgsend publish --fmri-in-manifest -d SUNWsshdu.dir 
SUNWsshdu.dir/manifest
PUBLISHED
pkg://opensolaris.org/sunwss...@1,5.11:20101126T032226Z
t...@linn[1107] 


Detecting a class action script, dealing with SMF manifests:
(of course, we should really combine the package below with the one above)

t...@linn[1147] svr4convert ./SUNWsshdr
set name=pkg.arch value=i386
set name=variant.opensolaris.zone value=global value=nonglobal
set name=pkg.fmri value=pkg:/sunwss...@1,0
legacy arch=i386 category=system desc="Secure Shell protocol Server" 
hotline="Please contact your local service provider" name="SSH Server, (Root)" 
pkg=SUNWsshdr vendor="Sun Microsystems, Inc." 
version=11.10.0,REV=2005.01.21.16.34
set name=pkg.description value="Secure Shell protocol Server"
set name=pkg.summary value="SSH Server, (Root)"
license copyright license=SUNWsshdr.copyright pkg.size=746
dir group=sys mode=0755 owner=root path=etc
dir group=sys mode=0755 owner=root path=etc/ssh
file etc/ssh/sshd_config group=sys mode=0644 owner=root 
path=etc/ssh/sshd_config pkg.size=5202 preserve=true
dir group=bin mode=0755 owner=root path=lib
dir group=bin mode=0755 owner=root path=lib/svc
dir group=bin mode=0755 owner=root path=lib/svc/method
file lib/svc/method/sshd group=bin mode=0555 owner=root 
path=lib/svc/method/sshd pkg.size=1387
dir group=sys mode=0755 owner=root path=var
dir group=sys mode=0755 owner=root path=var/svc
dir group=sys mode=0755 owner=root path=var/svc/manifest
dir group=sys mode=0755 owner=root path=var/svc/manifest/network
file var/svc/manifest/network/ssh.xml group=sys mode=0444 owner=root 
path=var/svc/manifest/network/ssh.xml pkg.size=2982 
restart_fmri=svc:/system/manifest-import:default

WARNING: class action script used in SUNWsshdr: etc/ssh/sshd_config belongs to 
"sshdconfig" class
WARNING: script present in SUNWsshdr: postinstall
t...@linn[1148] echo $?
1

The first 3rd party package that came to hand:

t...@linn[1149] svr4convert NVIDIA\-Solaris\-x86\-260.19.12/NVDAgraphicsr 
set name=pkg.arch value=i386
set name=variant.opensolaris.zone value=global value=nonglobal
set name=pkg.fmri value=pkg:/nvdagraphi...@1,0
legacy arch=i386 category=system,graphics desc="Kernel Drivers for NVIDIA 
Quadro graphics" hotline="Please contact your local service provider" 
name="NVIDIA Graphics System Device Driver" pkg=NVDAgraphicsr vendor="NVIDIA 
Corporation" version=260.19.12,REV=2010.10.08.16.05
set name=pkg.description value="Kernel Drivers for NVIDIA Quadro graphics"
set name=pkg.summary value="NVIDIA Graphics System Device Driver"
license copyright license=NVDAgraphicsr.copyright pkg.size=98
dir group=sys mode=0755 owner=root path=kernel
dir group=sys mode=0755 owner=root path=kernel/drv
dir group=sys mode=0755 owner=root path=kernel/drv/amd64
file kernel/drv/amd64/nvidia group=sys mode=0644 owner=root 
path=kernel/drv/amd64/nvidia pkg.size=12819783 reboot-needed=true
driver alias=Unknown class=Unknown clone_perms=Unknown devlink=Unknown 
name=nvidia perms="* 0600 root sys" policy=Unknown privs=Unknown
file kernel/drv/nvidia group=sys mode=0644 owner=root path=kernel/drv/nvidia 
pkg.size=10193689 reboot-needed=true
file kernel/drv/nvidia.conf group=sys mode=0644 owner=root 
path=kernel/drv/nvidia.conf pkg.size=146

WARNING: A partial driver action was created for the nvidia driver with
incomplete attributes.  See the pkg(5) and add_drv(1M) man pages for
information on how to complete these.
WARNING: script present in NVDAgraphicsr: postinstall
WARNING: script present in NVDAgraphicsr: postremove
t...@linn[1150] echo $?
1



_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to