[Haskell-cafe] cabal upgrade

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Wed Oct 1 13:54:15 EDT 2008

On Wed, 2008-10-01 at 08:58 +0100, Malcolm Wallace wrote:
> >> When I wanted to upgrade to yi, I needed to download the new
> >> package list
> >>
> >> cabal update           #download list of new packages
> >> cabal upgrade         #make any upgrades
> I never knew there was a 'cabal update' command, and it worries me.   
> In my unhappy experience of packaging systems (apt/Aptitude, fink/ 
> FinkCommander, and DarwinPorts/MacPorts) it was never obvious when it  
> should be necessary to run the update.  Indeed, the advice given by  
> each of these tools IIRC was to update every time you used it, before  
> doing anything else.  (So why was it a manual task then?)

Because we actually consult the index of available packages more often
than you think. Every time you cabal install in a local directory we
make sure all the required packages are available and consistent. If we
had to go to the network every time you would not be happy.

There should be a solution here that lets us update more automatically
while still allowing people to do offline operations. I'm not sure what
that solution is yet though.

> On the other hand, every one of those tools eventually failed for me on the  
> update step, leaving me with an inconsistent and non-working  
> configuration.

You will be glad to know that cabal's update is atomic (as of
cabal-install-0.5.2). It downloads the new index and atomically replaces
the old. So if the download is corrupted it should fail to gunzip and we
would not overwrite the old index.


More information about the Haskell-Cafe mailing list