Bug 1952 - optional dependency fails to cause package upgrade when needed
: optional dependency fails to cause package upgrade when needed
Status: CLOSED WORKSFORME
Product: pkg
api-python
: unspecified
: ANY/Generic All
: P3 normal (vote)
: ---
Assigned To: pkg/api-python watcher
: pkg/api-python watcher
:
:
:
:
:
  Show dependency treegraph
 
Reported: 2008-05-15 14:18 UTC by Tom Mueller
Modified: 2009-04-24 13:39 UTC (History)
1 user (show)

See Also:


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description Tom Mueller 2008-05-15 14:18:07 UTC
Consider the following packages:

a@1:
set name=pkg.name value="package a@1"

a@2:
set name=pkg.name value="package a@2"
depend fmri=pkg:/b@2 type=optional

b@1:
set name=pkg.name value="package b@1"
depend fmri=pkg:/a@1 type=require

b@2:
set name=pkg.name value="package b@2"
depend fmri=pkg:/a@1 type=require

Create a repository:

$ pkg image-create -U -a test=http://localhost:10000 myimage
$ cd myimage

Then install a@1 and b@1

$ pkg install a@1 b@1
$ pkg list
NAME (AUTHORITY)                              VERSION         STATE      UFIX
a                                             1               installed  u---
b                                             1               installed  u---

Now install a@2.  This should cause an update of b to version 2. 

$ pkg install a@2
PHASE                                        ACTIONS
Update Phase                                     2/2
Install Phase                                    1/1
$ pkg list
NAME (AUTHORITY)                              VERSION         STATE      UFIX
a                                             2               installed  u---
b                                             1               installed  u---

Note that package b was not upgraded to version 2.
Comment 1 Joe Di Pol 2008-09-08 14:47:24 UTC
Here is another example that looks related. In this case I have two
packages "base" and "p". "base" has an optional dependency on the 2.0
version of "p":

add depend fmri=pkg:/p@2 type=optional

But I'm allowed to install "base" even if I only have the 1.0 version of "p"
already installed:

$ pkg list -a
NAME (AUTHORITY)                              VERSION         STATE      UFIX
base                                          1-0             known      ----
p                                             1.0-0           installed  ----

$ pkg install base
PHASE                                        ACTIONS
Install Phase                                    5/5 

$ pkg list -a
NAME (AUTHORITY)                              VERSION         STATE      UFIX
base                                          1-0             installed  ----
p                                             1.0-0           installed  ----
Comment 2 Danek Duvall 2008-09-08 14:59:39 UTC
More an API issue than a CLI issue.
Comment 3 Danek Duvall 2009-01-06 09:52:07 UTC
*** Bug 6018 has been marked as a duplicate of this bug. ***
Comment 4 Danek Duvall 2009-04-23 14:32:20 UTC
Looks like this got fixed somewhere along the way.
Comment 5 Tom Mueller 2009-04-24 13:39:15 UTC
I confirmed that I'm seeing this work too in the version of pkg(5) in build
111.