Skip to main content

[pkg-discuss] Re: Review request -> 17699233 pkg install could have an option to ignore any installed packages

  • From: Edward Pilatowicz < >
  • To: Xiaobo Shen < >
  • Cc:
  • Subject: [pkg-discuss] Re: Review request -> 17699233 pkg install could have an option to ignore any installed packages
  • Date: Fri, 13 Dec 2013 17:21:24 -0800

On Fri, Dec 13, 2013 at 04:56:08PM -0800, Edward Pilatowicz wrote:
> On Fri, Dec 13, 2013 at 04:10:05PM -0800, Xiaobo Shen wrote:
> > On 12/13/13 03:37 PM, Edward Pilatowicz wrote:
> > >On Fri, Dec 13, 2013 at 02:39:03PM -0800, Xiaobo Shen wrote:
> > >>In this webrev, a new option --exact is added into pkg install
> > >>command. This option is used if user want to install exactly the
> > >>packages specified in this install operation and their dependent
> > >>packages if any. All other packages installed will be removed. It
> > >>generally should support basic operations as pkg install. I did
> > >>basic implementation and basic tests for this option. Let me know
> > >>what did I miss. Thanks.
> > >>
> > >>link:
> > >>https://ips.java.net/webrev/xiaoshen/pkginstall_17699233_1/
> > >>
> > >i think your implementation will have some unexpected side effects.  for
> > >example, if i installed a system with solaris-large-server, and then i
> > >decided that i wanted to change that to be solaris-small-server, if i
> > >did:
> > >
> > >   pkg install --exact solaris-small-server
> > >
> > >then that would not only install solaris-small-server, but it would also
> > >always upgrade my system to the latest version of solaris-small-server
> > >at the same time.  furthermore, if was running s11.2, but i had only
> > >configured a repo with s11.1, the command would happily downgrade my
> > >system, which probably wouldn't end well.
> > Thanks for your comments. Actually I have already take this into
> > consideration. The first try
> > of default match_type is MATCH_INST_VERSIONS. Only if user specifies
> > @latest the match is
> > switched into MATCH_ALL. Also If we specify two packages where one
>
> my concern was the MATCH_ALL being done in the exception handler.  there
> you have the comment:
>
>       # Usually we are here because
>       # we are trying to match an
>       # uninstalled package. So we
>       # need to match all fmris.
>
> > is installed and the other
> > is not. The installed one is keep the same and the uninstalled one
> > is being installed with a MATCH_ALL
> > look up. This is why the for loop shows up here. The reason of using
> > MATCH_INST_VERSIONS in the first try is to solve the unexpected
> > upgrading problem.
> >
>
> but what happens if the user *only* specifies uninstalled package?  (in
> which case it seems to me there will be no other packages in inst_pkgs
> to pin down version numbers to compatible existing versions.)
>
> > I do not think downgrade is a problem here and I have a test case to
> > test this. I did not find problems
> > so far.
>
> you only have one test case for downgrade.  looking at it:
>
> - you attempt to install an already installed package.  (so it doesn't
>   cover the case i'm talking about.)
>
> - most the packages your testing with (exact[123]) only have one
>   version, so you can't really detect/test upgrades/downgrades.
>
> - none of the packages you are testing with have incorporation
>   dependencies on other packages.  so in your tests, installed packages
>   don't really restrict what other packages can be installed.  this
>   doesn't reflect how solaris images actually work.
>
> so i don't think you're test case is sufficient to model the behavior
> i'm talking about.  to do that you'll want a test case that tries to do
> an exact install or an uninstalled package that is incorporated (either
> directly or indirectly) by other packages which are installed within the
> target image.  for example, create the following packages:
>
>       pkgA@1 incorporates pkgB@1
>       pkgA@2 incorporates pkgB@2
>       pkgA@3 incorporates pkgB@3
>       pkgB@1 depends on pkgA@1
>       pkgB@2 depends on pkgA@2
>       pkgB@3 depends on pkgA@3
>
> create an image with pkgA@2 installed.  then try:
>
>       pkg install --exact pkgB@1
>
> i'm guessing this will install pkgA@1 and pkgB@1 when it should have
> failed.  also, create an image with pkgA@2 installed.  then try:
>
>       pkg install --exact pkgB
>
> i'm guessing this will install pkgA@3 and pkgB@3 when it should have
> just installed pkgB@2.
>

i just realized, in the second test case i mentioned above it's
perfectly valid for that command to upgrade pkgA and pkgB to version 3.
it won't be invalid until you add install holds to pkgA (the install
holds should prevent pkgA from being upgraded, but i'm betting they
won't).

here's how the packages should probably look:

        pkgA@1 incorporates pkgB@1 and has an install hold
        pkgA@2 incorporates pkgB@2 and has an install hold
        pkgA@3 incorporates pkgB@3 and has an install hold
        pkgB@1 depends on pkgA
        pkgB@2 depends on pkgA
        pkgB@3 depends on pkgA

so in this case pkgA is sticky (it can only be upgraded if specified on
the command line) and it restricts the version of pkgB that can be
installed.  it's also required by pkgB.

this models how the solaris consolidation incorporation packages
actually work.

ed


[pkg-discuss] Review request -> 17699233 pkg install could have an option to ignore any installed packages

Xiaobo Shen 12/13/2013

[pkg-discuss] Re: Review request -> 17699233 pkg install could have an option to ignore any installed packages

Edward Pilatowicz 12/13/2013

[pkg-discuss] Re: Review request -> 17699233 pkg install could have an option to ignore any installed packages

Xiaobo Shen 12/14/2013

[pkg-discuss] Re: Review request -> 17699233 pkg install could have an option to ignore any installed packages

Edward Pilatowicz 12/14/2013

[pkg-discuss] Re: Review request -> 17699233 pkg install could have an option to ignore any installed packages

Edward Pilatowicz 12/14/2013

[pkg-discuss] Re: Review request -> 17699233 pkg install could have an option to ignore any installed packages

Xiaobo Shen 12/14/2013

[pkg-discuss] Re: Review request -> 17699233 pkg install could have an option to ignore any installed packages

Shawn Walker 12/14/2013

[pkg-discuss] Re: Review request -> 17699233 pkg install could have an option to ignore any installed packages

Edward Pilatowicz 12/14/2013

[pkg-discuss] Re: Review request -> 17699233 pkg install could have an option to ignore any installed packages

Bart Smaalders 12/14/2013

[pkg-discuss] Re: Review request -> 17699233 pkg install could have an option to ignore any installed packages

Edward Pilatowicz 12/14/2013

[pkg-discuss] Re: Review request -> 17699233 pkg install could have an option to ignore any installed packages

Bart Smaalders 12/16/2013

[pkg-discuss] Re: Review request -> 17699233 pkg install could have an option to ignore any installed packages

Edward Pilatowicz 12/16/2013

[pkg-discuss] Re: Review request -> 17699233 pkg install could have an option to ignore any installed packages

Xiaobo Shen 12/18/2013

[pkg-discuss] Re: Review request -> 17699233 pkg install could have an option to ignore any installed packages

Edward Pilatowicz 12/18/2013
 
 
Close
loading
Please Confirm
Close