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

Reply via email to