Discussion:
[paludis-user] question about dependencies
OndraK
2013-11-11 08:40:27 UTC
Permalink
Hi,

yesterday on IRC I asked a question about resolving dependencies. My situation is the following: during several months there were several "best" stable versions of gentoo-sources, paludis, as expected, installed them during that time. Running "cave purge" didn't marked any (now) older gentoo-sources versions to uninstall, however, "cave uninstall sys-kernel/gentoo-sources:<old_version>" found the package to be uninstalled without any possible breakage.


I installed gentoo-sources manually (virtual/linux-kernel is not involved), there is no package depending on gentoo-sources (according to "cave print-dependent-ids"). This paludis' behaviour is kind of "strange" to me: "sys-kernel/gentoo-sources" record in world file does not let paludis to uninstall the older version. I am curious, and would like to know something "from behind the scene", if you could find some time to answer my question which may be a silly one.

Can a package manager (speaking about flawless one) use only the latest (best, or whatever we call it) version of package when a "category/package" is the only dependency on that package? And if so, should it be able to purge all older versions of the package? If not, what is the reason for it? I know that the dependencies (of the whole system) can be expressed as an oriented graph, I suppose that the decision is done by adding edges between packages (nodes) from dependent to depending (assuming world as a "meta-package"), taking limitations (flags, version restrictions, many others) into account. Nodes with no edges coming from it are unused, right? If there are several versions of a single pacakge, every version will have its own node, the dependency (edge) can thus lead from one version of the package, leaving the other versions unused. Or not (and why)?

Thank you for your time, mostly for the time spent on developing paludis (good manager).

Ond?ej Kaj?nek
Ciaran McCreesh
2013-11-11 20:13:11 UTC
Permalink
On Mon, 11 Nov 2013 09:40:27 +0100
Post by OndraK
I installed gentoo-sources manually (virtual/linux-kernel is not
involved), there is no package depending on gentoo-sources (according
to "cave print-dependent-ids"). This paludis' behaviour is kind of
"strange" to me: "sys-kernel/gentoo-sources" record in world file
does not let paludis to uninstall the older version. I am curious,
and would like to know something "from behind the scene", if you
could find some time to answer my question which may be a silly one.
A dependency with no explicit slot or slot operator specified is
treated as meaning "and we don't know which slot", so for safety we
assume "potentially any slot".
Post by OndraK
Can a package manager (speaking about flawless one) use only the
latest (best, or whatever we call it) version of package when a
"category/package" is the only dependency on that package?
It could, but doing so would be unsafe for dependencies that don't have
a :* operator.
--
Ciaran McCreesh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.exherbo.org/pipermail/paludis-user/attachments/20131111/509a040f/attachment.asc>
OndraK
2013-11-11 21:19:28 UTC
Permalink
Hi Ciaran,

thank you for your answer. Of course, safety reason is a strong one. I understand that using slots in all packages is not possible (i.e. kernel with a slot per version), unless an operator for "the slot with the best version" is introduced -- question would be about pros vs cons of such change.

Yes, those risks are better to be left for the user to decide about, I agree, my curiosity is now fed :)

Ond?ej Kaj?nek

Loading...