Blag

He's not dead, he's resting

From-Repository Dependencies

Paludis trunk has a new feature that has a few interesting abuses: from-repository dependencies.

Normal repository dependencies, which are written cat/pkg::repo, find packages that are now in repository repo. These can be used to install or query versions from a particular repository, mask or keyword based upon repository and so on. But what you can’t do is, say, paludis --uninstall cat/pkg::gentoo, since when a package is installed it is a member of the installed repository and is no longer in the repository from which it was installed.

From-repository dependencies solve this. A from-repository dependency looks like cat/pkg::repo->, which means cat/pkg that was originally from repo. So now you can do crazy things like paludis --uninstall '*/*::sunrise->' (the quoting is important with any sane shell).

In- and from- repository dependencies can be combined, so cat/pkg::from->in is legal. cat/pkg::->in is also accepted, meaning the same as cat/pkg::in.

The definition of ‘from’ is worth discussing. A package is from ‘repo’ if any of:

  • It was installed from the source repository ‘repo’.
  • It was installed from the binary repo ‘repo’.
  • It was installed from a binary that was generated from the source repository ‘repo’.
  • It is in an unavailable repository and represents a package that would be from ‘repo’ if that repo were configured.

That last one is dleverton’s idea, and can be used to do some rather neat tricks:

$ paludis -q 'gcc::dirtyepic->'
* sys-devel/gcc::dirtyepic->
    layman:                  (4.3.2_pre9999 (in ::dirtyepic))X {:4.3-svn} (4.4.0_pre9999 (in ::dirtyepic))X* {:4.4-svn} 
    Description:             The GNU Compiler Collection.
    Owning repository:       dirtyepic
    Repository homepage:     http://overlays.gentoo.org/dev/dirtyepic
    Repository description:  Various work-in-progress stuff including GCC-svn and wxGTK.
    Masked by unavailable:   In a repository which is unavailable

One thing you still can’t do with this syntax is something like paludis --install '*/*::kde4-experimental->' to reinstall everything that was originally installed from the kde4-experimental repository. The wildcard expansion works as expected, but then the from-repository restriction limits the install candidates to already-installed packages. Perhaps something like --drop-repository-restrictions-after-wildcard-expansion or --late-rewrite-targets '%q%v%s' is in order… Or perhaps we could add cat/pkg::(repo)->, where (things) are only used for wildcard expansion purposes…

One response to “From-Repository Dependencies

  1. Pingback: Path and installable-to dependencies « Ciaran McCreesh’s Blag

Leave a comment