[pkg-discuss] Re: Review request -> 17699233 pkg install could have an option to ignore any installed packages
- From: Edward Pilatowicz <
- Subject: [pkg-discuss] Re: Review request -> 17699233 pkg install could have an option to ignore any installed packages
- Date: Fri, 13 Dec 2013 17:15:03 -0800
On Fri, Dec 13, 2013 at 04:47:49PM -0800, Shawn Walker wrote:
> On 12/13/13 15:37, 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.
> >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
> > 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.
> Actually, Xiaobo and I talked about the upgrade case specifically to
> prevent that.
but i still don't see how the proposed changes actually prevent it.
> I would note that Bart seems to have a different view here; Bart's
> view seems to be that consistency in interface is the right answer.
> In other words, today, if you type 'pkg install entire', we're going
> to try to upgrade your system. So we should do the same here.
i agree with bart.
but going back to my the example of switching from one group package to
another. a normal a pkg install of a new group package won't upgrade
your system, but with the current --exact approach it seems to me like
it will. i would find that difference in behavior surprising. (ie, i
wouldn't expect "install --exact <group-pkg>" to upgrade my system when
a normal "install <group-pkg>" would not.)
so i'm agreeing with bart, but i'm just not convinced the current
implementation provides the expected consistency. (and if it does then
i'm just confused and i apologize for the noise.)
> I'm hesitant to do that for the '--exact' case as I don't think our
> users are expecting an upgrade at the same time -- just installs and
i'm kinda siding with bart on the whole consistency and least surprise
in practice, the only cases where users can get unexpected upgrades is
if they specify "entire" on the command line (so all install holds get
relaxed). if they want to avoid this case the workarounds are easy:
- use pkg list to get your currently installed version of entire and
pass that to pkg install --exact.
- use pkg freezes
> The downgrade case is tricky though, that wouldn't be accounted for
> in what I originally suggested to Xiaobo.
the only way i can think of to avoid this is to run the solver first.
that's the only way you can compute a solution that accounts for the
existing image constraints. only after you've done that can you start
to trim unnecessary packages from the solution space.