On 09/11/12 10:15 AM, April Chin wrote:
I tried putting the following in the ruby-18.p5m pkg manifest:

dir path=usr/ruby/$(RUBY_VER)/lib/ruby/gems/$(RUBY_VER)/bin \
          salvage-from=var/ruby/$(RUBY_VER)/gem_home/bin
dir path=usr/ruby/$(RUBY_VER)/lib/ruby/gems/$(RUBY_VER)/cache \
          salvage-from=var/ruby/$(RUBY_VER)/gem_home/cache
dir path=usr/ruby/$(RUBY_VER)/lib/ruby/gems/$(RUBY_VER)/doc \
          salvage-from=var/ruby/$(RUBY_VER)/gem_home/doc
dir path=usr/ruby/$(RUBY_VER)/lib/ruby/gems/$(RUBY_VER)/gems \
          salvage-from=var/ruby/$(RUBY_VER)/gem_home/gems
dir path=usr/ruby/$(RUBY_VER)/lib/ruby/gems/$(RUBY_VER)/specifications \
          salvage-from=var/ruby/$(RUBY_VER)/gem_home/specifications

That looks ok.

Only the usr/ruby/$(RUBY_VER)/lib/ruby/gems/$(RUBY_VER)/bin
and var/ruby/$(RUBY_VER)/gem_home/bin directories did not exist in the
previous version
of the package.

That salvage operation wouldn't work if var/ruby/$(RUBY_VER)/gem_home/bin wasn't a packaged directory in an older version of the package. salvage-from only moves files from previously-packaged directories.

In the past, when we've decided we really need to move content that resides in a previously unpackaged directory, we've back-published an old version of the package, adding a dir action that causes that directory to be packaged, allowing the salvage operation to work when we publish and install the new package.

One wrinkle is that there *could* be duplicate ruby
gems already
installed by the user in the target
/usr/ruby/1.8/lib/ruby/gems/1.8/{bin,cache,doc, gems,specifications}
directories, in which case I would say that we should *not* move them.

Duplicate filenames from the salvage-from directory that already exist in the target dir we'd like to move them to are moved to /var/pkg/lost+found with a timestamp (and an error is emitted during the install operation)

I wasn't able to get the above entries to move any files, installing the
new ruby-18 pkg
onto a S11 Update 1 build 23 system.  I even tried it with no
conflicting duplicate
files/dirs between the salvage-from dir and the target dir.  Do you have
any ideas on
what I might be missing?

It's difficult to know what's going on.

I've experimented with all of the above conditions, publishing sample package manifests and updating between pkg:/[email protected] and pkg:/[email protected] and salvaging works as expected.

Perhaps it might be worth trying these to see if you can get the simple case to work first? One thing to reiterate, is that salvage-from only does work when:

* the directory we're salvaging from is removed during this package operation
* (and that means no other packages installed on the system reference it)

        cheers,
                        tim


Thanks,
April

On 09/10/12 02:44 PM, Tim Foster wrote:
On 09/11/12 07:29 AM, April Chin wrote:
If not, what other method should I be using?

Note that I also played with using the "salvage-from" action on the
directories into which
I want to move the in files; salvage-from can be used to move unpackaged
contents from
a directory it names.  I haven't been successful in getting this action
to work either.

Yep, 'salvage-from' is exactly what you should be using - it's
designed for exactly this reason: to move unpackaged files from a
directory that's disappearing as part of this package operation
(either the old package becomes uninstalled, or the package previously
delivering that dir action stops delivering it)


So, this might look like:

set name=pkg.fmri value=pkg:/runtime/[email protected]
dir path=usr/ruby/1.8/lib/ruby/gems/1.8
salvage-from=var/ruby/1.8/gem_home

Note that salvage-from isn't recursive, so if you have multiple
*packaged* directories beneath /var/ruby that each contain unpackaged
content, then you'll need multiple dir actions, each with their own
'salvage-from' attribute, for each directory that's being migrated.

If any unpackaged content in a given packaged directory has unpackaged
subdirectories and files, that content is moved recursively though.

     cheers,
             tim

set name=pkg.fmri [email protected]
dir path=bar mode=0756 owner=root group=sys
dir path=foo mode=0755 owner=root group=sys
set name=pkg.fmri [email protected]
dir path=bar mode=0755 owner=root group=sys salvage-from=foo
_______________________________________________
userland-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/userland-discuss

Reply via email to