Adding a world file to cabal-install

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Sun Feb 8 08:45:25 EST 2009


On Sun, 2009-02-08 at 14:29 +0100, Peter Robinson wrote:
> >> 2. How should that command look like? Something like:
> >> # cabal install --world
> >
> > Yes, if anyone else has a suggestion on this pitch in. In gentoo we say:
> >
> > $ emerge --upgrade world
> >
> > ie world acts rather like a meta-package of all the things the user
> > deliberately installed.
> 
> Mhm, I agree with that but I'm unsure how to relate meta-packages to
> normal packages: In my understanding a meta-package doesn't have a version,
> so it doesn't have a 'PackageIdentifier' (and can't be an instance of class
> Package).
> 
> 
> > Thanks very much Peter for having a go at this one. I promise I'll
> > properly review your patch soon.
> 
> You might as well wait until I've figured out the meta-package stuff as
> that might require some changes.

Right, we just have to make up a version number, but if it's the only
version available and there is no installed version then that's not a
problem.

See for example planLocalPackage in Distribution/Client/Install.hs. It
makes up an AvailablePackage based on the local package and adds it to
the index of available packages.

Another alternative is to not treat it like a meta-package and instead
of adding the world meta-package to the list of packages to resolve for,
we add all the world entries to the list instead. So it would be
equivalent to:

$ cabal install $(cat ./world.list)

Duncan



More information about the cabal-devel mailing list