Hi there,

I'm exploring a fix for

7140167 pkgmerge(1) only merges default publisher's packages

and have working code that's passing the current unit tests (though I need to write more tests)

I wanted to send along the current plan for comment before diving into writing those tests, in case anyone has opinions on this work.

My plan is to add new options to pkgmerge, -p and -P.


Each -p option allows the user to specify a publisher in the list of source repositories containing packages to be merge. The default is to merge packages from all publishers, but multiple -p options are supported.

The -P option allows the user to republish all packages into a single target publisher. The default is to retain the publisher prefix(es) from the source repositories. Only a single -P option is supported.

When republishing content, we publish as many packages as we can from each publisher, stopping if we hit any publication errors (eg. transaction errors, or not finding any packages that match the provided FMRI pattern) then moving onto the next publisher.


If the same package name is present in *different* source publishers, and we're using -P, we treat this as an error. That is, if we've already successfully merged a given package, and it shows up again, we don't attempt to merge it a 2nd time. Does that seem reasonable?

So for example, our sparc repository has two publishers, both of which contain 'pkg:/other'

timf@kura[807] pkgrepo -s sparc list
PUBLISHER NAME     O VERSION
carrots   other      1.0,5.11:20120917T033310Z
carrots   wabbit     1.0,5.11:20120912T053200Z
mypub     other      1.0,5.11:20120914T002918Z
mypub     test       1.0,5.11:20120912T022802Z

timf@kura[808] pkgrepo -s i386 list
PUBLISHER NAME     O VERSION
carrots   wabbit     1.0,5.11:20120912T034348Z
mypub     other      1.0,5.11:20120914T002908Z
mypub     test       1.0,5.11:20120912T022441Z

timf@kura[809] pkgmerge -s arch=sparc,sparc -s arch=i386,i386 -P combine -d merged
PROCESS     ITEMS    GET (MB)   SEND (MB)
Completed   2/2     0.0/0.0     0.0/0.0

PROCESS     ITEMS    GET (MB)   SEND (MB)
test        1/2     0.0/0.0     0.0/0.0
pkgmerge: Unable to merge pkg://mypub/other@1.0,5.11:20120914T002918Z since it has already been merged from another publisher.
timf@kura[810] echo $?
1

Does this seem reasonable? I'm trying to strike the right balance between usefully merging content, and spotting pilot-error (in case the user mistakenly provides source repositories that don't match up, as multiple publishers containing the same package names might suggest)

It's tempting to use the support for -P to let users to easily republish packages with a different publisher name.

We could do that by adding another flag to pkgmerge using a dummy variant name, dropping that variant 'set' action from the resulting package, but perhaps I'm getting carried away here. From a user's perspective, it would certainly be less complex than the current 'pkgrecv ; pkgmogrify ; pkgsend' dance, but it's not really merging content, so it's hard to argue that functionality belongs in this tool.
feetch feetch.

        cheers,
                        tim


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

Reply via email to