tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: multiple version of packages with the same PKGBASE



> In pkgsrc there are a number of packages that have the same PKGBASE
> but different PKGPATH and versions.  Is it normal?

Yes, it is normal.  A typical example is graphics/gqview and
graphics/gqview-devel.  They install the same files, with the same
names, but from different branches of upstream.

We could have schemes to install multiple versions at once, but a) it's
a lot more work and b) the user doesn't perceive it normally, since
there naming changes (python) or path changes (guile).  See lang/guile16
and lang/guile for an example of the path change method.

> If yes how these packages should be upgraded?  Again, I'd prefer to
> know an algorithm, not a tool.

I suggest that you read the code of pkg_rolling-replace and pkg_chk
which struggle with many of the same issues.  In pkg_rolling-replace's
case, the algorithm is:

start:

  make list of packages that are out of date or unsafe_depends
    [an installed package is out of date if the version that woudl be
    installed by PKGPATH differs from the installed version.]

  take this list, and tsort by dependency

  take first package on list (ending if emtpy)

    go to PKGPATH and do 'make replace package clean'

  goto start



So, this means that if gqview-2.0.4 is installed, with PKGPATH
graphics/gqview, it's up to date.  Yes, gqview-devel would install
2.1.5, but the user hasn't chosen to be on the non-stable branch.

Now, if gqview 2.2.0 is released, and graphics/gqview is updated to it,
and gqview-devel update to 2.3.1, then the check will show that gqview
is out of date.

This basically comes down to preserving the PKGPATH of installed
packages, and when that package is updated, that means that any pacakge
installed *from that PKGPATH* should be updated automatically.

This may be underdocumented, but I think it's pretty sane.

Attachment: pgpntXrk6uuiA.pgp
Description: PGP signature



Home | Main Index | Thread Index | Old Index