Hey folks,

Just wondering could I get a code-review on this? Bart had sent me mail to say that he thought the approach looked ok, but I wasn't sure if he's had a chance to do a full review of it (so it might be a good idea to check with him before you dive in)

Either way, April's looking to use this functionality in Userland, and is holding back on a Ruby putback for this wad to land, so I'd like to land this this week if possible.

        cheers,
                        tim

-------- Original Message --------
Subject: [pkg-discuss] Code review: salvage-from and existing dirs
Date: Tue, 18 Sep 2012 14:25:23 -0700 (PDT)
From: Tim Foster <tim.s.fos...@oracle.com>
To: pkg discuss <pkg-discuss@opensolaris.org>

hi there,

I've finished off the unit tests for this wad, and have the following
webrev for review:

https://cr.opensolaris.org/action/browse/pkg/timf/salvage-to-existing-dir/salvage-to-existing-dir-webrev/


The fix makes salvaging happen when a 'dir' action with the
'salvage-from' attribute changes *at all* (any attribute changing on the
new directory action is sufficient, provided they doesn't clash with
attributes that must be common amongst existing instances of that
reference-counted action)


This means, for example, given the following set of packages installed
in an image:

set name=pkg.fmri value=pkg:/foo@1.0
dir path=/etc owner=root group=sys mode=755
dir path=salvage-target owner=root group=sys mode=755

set name=pkg.fmri value=pkg:/bar@1.0
dir path=salvage-target owner=root group=sys mode=755 salvage-from=/etc

set name=pkg.fmri value=pkg:/kept@1.0
dir path=salvage-target owner=root group=sys mode=755


When we 'pkg update' to the packages below, /etc stops being delivered,
then because pkg:/bar@2.0 causes a small change to the action, the
unpackaged contents from /etc get salvaged into /salvage-target.


set name=pkg.fmri value=pkg:/kept@1.0
dir path=salvage-target owner=root group=sys mode=755

set name=pkg.fmri value=pkg:/foo@2.0
dir path=salvage-target owner=root group=sys mode=755

set name=pkg.fmri value=pkg:/bar@2.0
dir path=salvage-target owner=root group=sys mode=755 salvage-from=/etc
timf=noodles

As is the case today, if a user simply uninstalls pkg:/foo@1.0 (without
also updating pkg:/bar) the content still gets salvaged to lost+found.

Comments would be most welcome,

        cheers,
                        tim
_______________________________________________
pkg-discuss mailing list
pkg-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss
_______________________________________________
pkg-discuss mailing list
pkg-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to