Re: [pkg-discuss] code review request: pkgsend generate --target
On 06/23/10 10:05 AM, Danek Duvall wrote: And Bart wrote back with another suggestion to reduce the complexity a bit. A new webrev is available at: http://cr.opensolaris.org/~dduvall/pkg-gentargets-3/ The only difference is in DirectoryBundle.py. src/man/pkgsend.1.txt: line 156: nit: s/etc/etc./ src/tests/cli/t_pkgsend.py: line 1057: nit: extra newline? Assuming you're not assigning entries to 'targetpaths' and you don't intend to: src/modules/bundle/DirectoryBundle.py: line 49: s/=()/=pkg.misc.EmptyI/ src/modules/bundle/SolarisPackageDatastreamBundle.py: line 47: s/=()/=pkg.misc.EmptyI/ src/modules/bundle/SolarisPackageDirBundle.py line 35: s/=()/=pkg.misc.EmptyI/ src/modules/bundle/TarBundle.py: line 35: s/=()/=pkg.misc.EmptyI/ src/modules/bundle/__init__.py: line 41: s/=()/=pkg.misc.EmptyI/ Cheers, -Shawn ___ pkg-discuss mailing list pkg-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/pkg-discuss
Re: [pkg-discuss] code review request: pkgsend generate --target
On Tue, Jun 22, 2010 at 06:32:41PM -0700, Danek Duvall wrote: > http://cr.opensolaris.org/~dduvall/pkg-gentargets-2/ > > Johansen, let me know if you think your concern is sufficiently mitigated > here. Yes, this is quite clever. It took me a minute to figure out what was going on, but this certainly addresses my concern. -j ___ pkg-discuss mailing list pkg-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/pkg-discuss
Re: [pkg-discuss] code review request: pkgsend generate --target
And Bart wrote back with another suggestion to reduce the complexity a bit. A new webrev is available at: http://cr.opensolaris.org/~dduvall/pkg-gentargets-3/ The only difference is in DirectoryBundle.py. Thanks, Danek ___ pkg-discuss mailing list pkg-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/pkg-discuss
Re: [pkg-discuss] code review request: pkgsend generate --target
Danek Duvall wrote: > Bart Smaalders wrote: > > > Wouldn't this be simpler if we took the target files and looked up the > > inodes before generating any actions? You'd need to add a method to the > > DirectoryBundle to indicate this, or a optional parameter to the > > constructor > > U, yes, that would be waaay simpler. Try this on for size: http://cr.opensolaris.org/~dduvall/pkg-gentargets-2/ Johansen, let me know if you think your concern is sufficiently mitigated here. Thanks, Danek ___ pkg-discuss mailing list pkg-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/pkg-discuss
Re: [pkg-discuss] code review request: pkgsend generate --target
johan...@opensolaris.org wrote: > I wondered if it was safe to assert that the link count didn't change. I > was having a hard time telling if this was all based upon one pass, or if > it looked at the filesystem more than once. In some cases, it seems > entirely possible that a file could get unlinked. Should it really > traceback when this condition is encountered? It's just one pass, but it does depend on having the link count for any given inode stay the same from the first time it's encountered to the last. I'll see if I can make it error out in this case. Thanks, Danek ___ pkg-discuss mailing list pkg-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/pkg-discuss
Re: [pkg-discuss] code review request: pkgsend generate --target
Bart Smaalders wrote: > > http://cr.opensolaris.org/~dduvall/pkg-gentargets/ > > So, does one name the file w/ --target or the link? The man page isn't > clear (at least to me). I've rewritten the last sentence there to say To specify which pathnames should be treated as files, pass each pathname as an argument to the --target option. > Wouldn't this be simpler if we took the target files and looked up the > inodes before generating any actions? You'd need to add a method to > the DirectoryBundle to indicate this, or a optional parameter to the > constructor U, yes, that would be waaay simpler. Thanks, Danek ___ pkg-discuss mailing list pkg-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/pkg-discuss
Re: [pkg-discuss] code review request: pkgsend generate --target
On Tue, Jun 22, 2010 at 03:48:37PM -0700, Bart Smaalders wrote: > On 06/22/10 14:40, Danek Duvall wrote: > >As part of my work to get the pkg(5) gate generating IPS packages natively, > >I needed some sort of protocmp. The ON validate_pkg tool does more than we > >need, and you can't turn those bits off, so you end up with unquenchable > >warnings about paths not being right (we move some stuff around in the > >packages), modes not being just so, etc. ON's more dictatorial about how > >things get installed in the proto area, while we're following a more > >natural userland model, where we do a bunch of pkgmogrify fixups. > > > >But we package a couple of hardlinks, and the current directory bundle code > >treats hardlinks in arbitrary order. This wad allows us to specify which > >pathnames should be treated as files, leaving all the other names for the > >inode to be hardlinks, rather than simply taking as a file the first one > >the filesystem gives us. > > > > http://cr.opensolaris.org/~dduvall/pkg-gentargets/ > > So, does one name the file w/ --target or the link? The man page isn't > clear (at least to me). > > Wouldn't this be simpler if we took the target files and looked up the > inodes before generating any actions? You'd need to add a method to > the DirectoryBundle to indicate this, or a optional parameter to the > constructor I'm unusually slow today; forgive me if this is a stupid question. I wondered if it was safe to assert that the link count didn't change. I was having a hard time telling if this was all based upon one pass, or if it looked at the filesystem more than once. In some cases, it seems entirely possible that a file could get unlinked. Should it really traceback when this condition is encountered? -j ___ pkg-discuss mailing list pkg-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/pkg-discuss
Re: [pkg-discuss] code review request: pkgsend generate --target
On 06/22/10 14:40, Danek Duvall wrote: As part of my work to get the pkg(5) gate generating IPS packages natively, I needed some sort of protocmp. The ON validate_pkg tool does more than we need, and you can't turn those bits off, so you end up with unquenchable warnings about paths not being right (we move some stuff around in the packages), modes not being just so, etc. ON's more dictatorial about how things get installed in the proto area, while we're following a more natural userland model, where we do a bunch of pkgmogrify fixups. But we package a couple of hardlinks, and the current directory bundle code treats hardlinks in arbitrary order. This wad allows us to specify which pathnames should be treated as files, leaving all the other names for the inode to be hardlinks, rather than simply taking as a file the first one the filesystem gives us. http://cr.opensolaris.org/~dduvall/pkg-gentargets/ So, does one name the file w/ --target or the link? The man page isn't clear (at least to me). Wouldn't this be simpler if we took the target files and looked up the inodes before generating any actions? You'd need to add a method to the DirectoryBundle to indicate this, or a optional parameter to the constructor - Bart -- Bart Smaalders Solaris Kernel Performance bart.smaald...@oracle.com http://blogs.sun.com/barts "You will contribute more with mercurial than with thunderbird." ___ pkg-discuss mailing list pkg-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/pkg-discuss