hackage-server: index format

Duncan Coutts duncan.coutts at googlemail.com
Fri Nov 19 08:01:34 EST 2010


On Fri, 2010-11-19 at 12:27 +0000, Duncan Coutts wrote:

> Matt and I also discussed making the 00-index.tar.gz into a RESTful
> format by adding proper URLs for package tarballs.

Indeed we could go further and use a single general format for
describing or distributing bundles of packages.

Use case: local build trees
---------------------------

A bunch of related packages (e.g. gtk2hs, happstack-* etc) unpacked
locally.

/home/me/prgs/myproj/foo/            --top of source tree for foo
/home/me/prgs/myproj/foo/foo.cabal
/home/me/prgs/myproj/bar/
/home/me/prgs/myproj/bar/bar.cabal

Now we can have an index.tar containing symlinks to .cabal files!

/home/me/prgs/myproj/index.tar: containing
        foo.cabal -> foo/foo.cabal
        bar.cabal -> bar/bar.cabal

So these are not copies of the .cabal files, these really are symlinks
to the local .cabal files (but inside the tarball). I guess we need some
extra index entry to point to the location of the source tree, though
it's not a .tar.gz kind.

Now just as we can have symlinks (or really URLs) inside the tarball, we
could also have full file contents there too. Next use case...

Use case: distribution bundles
------------------------------

Shipping a bunch of source packages as a single file

some-name.tar: containing
        foo.cabal
        foo-1.0.tar.gz
        bar.cabal
        bar-1.0.tar.gz

So now instead of symlinks/URLs to separate tarballs, the whole file
contents is right there. We have a hackage-like index plus the file
tarballs.


We might have to have a different naming convention than simply blah.tar
for these indexes, otherwise cabal install might not know how to
interpret  "cabal install foo.tar" should it interpret foo.tar as an
index or as a single package?

Opinions?

Duncan



More information about the cabal-devel mailing list