server directory layout for cabal-install?

Hello. I wonder what is the required layout of directories and files on a server that supplies packages for cabal-install. I figure 00-index.tar.gz contains the *.cabal files. (The cabal files have to be on the server as well, unpacked?) Each $dir/$foo.cabal (in the archive) contains a "Version:$ver" line, and then $dir/$foo-$ver.tar.gz must be on the server? Are there additional constraints on the $dir part? What is the syntax of the .cabal/config file? The standard entry is repos: hackage.haskell.org:http://hackage.haskell.org/packages/archive , where the thing between "repos:" and ":http" is just a symbolic name, and I can add more lines like that? Thanks, J.W.

On Wed, 2009-03-18 at 22:24 +0100, Johannes Waldmann wrote:
Hello.
I wonder what is the required layout of directories and files on a server that supplies packages for cabal-install.
I figure 00-index.tar.gz contains the *.cabal files.
Right. The directory layout within the index is important too at the moment.
(The cabal files have to be on the server as well, unpacked?)
They do not have to be, it just makes it easy to construct the index using: find . -maxdepth 3 -name '*.cabal' | tar -c -T - -f - | gzip -9 >$tmp
Each $dir/$foo.cabal (in the archive) contains a "Version:$ver" line, and then $dir/$foo-$ver.tar.gz must be on the server? Are there additional constraints on the $dir part?
In the 00-index.tar file the layout is $pkg/$ver/$pkg.cabal and on the server it must be $pkg/$ver/$pkg-$ver.tar.gz I think in future we'll want to relax this layout slightly. I think what we want is to have the location in the index file match the location on the server (ie relative to the base url) but we do not need a rigid directory layout. That can be chosen as it suits. See, currently cabal-install relies on the name of the .cabal file in the index being the name and version of the package. It does not actually parse the .cabal file unless it has to (it's a bit slow). That's not really ideal of course. The solution is to parse just enough to extract the name and version and then the file name doesn't matter so much (except for the .cabal file extension).
What is the syntax of the .cabal/config file? The standard entry is repos: hackage.haskell.org:http://hackage.haskell.org/packages/archive , where the thing between "repos:" and ":http" is just a symbolic name, and I can add more lines like that?
Yes. The order in which they're listed determines the merge order of the repo indexes. I think repos listed later override earlier repos (if they happen to contain the same package name and version). Duncan

Thanks. Now the 00-index.tar.gz works. When studying the access log of my web server, I found that the cabal client (cabal-install/0.6.0) does not want $pkg/$ver/$pkg-$ver.tar.gz but uses packages/$pkg-$ver/tarball instead (yes, "packages" and "tarball" are constant strings). That's strange, since I don't even see these files on hackage. I presume they're generated on the fly, then. Anyway, this seems to work for me: http://dfa.imn.htwk-leipzig.de/packages/lib/archive/ J.W.

On Thu, 2009-03-19 at 11:50 +0100, Johannes Waldmann wrote:
Thanks. Now the 00-index.tar.gz works.
When studying the access log of my web server, I found that the cabal client (cabal-install/0.6.0) does not want $pkg/$ver/$pkg-$ver.tar.gz but uses packages/$pkg-$ver/tarball instead (yes, "packages" and "tarball" are constant strings).
Oh, doh! Sorry about that. It was code to work with the new hackage server that should not have made it into a release. We were playing around with new url schemes for the new server. In future we want to use simply: $base/package/$pkg-$ver.tar.gz so eg: http://hackage.local/package/foo-1.0.tar.gz which we'd get via: repos: local: http://hackage.local/ I admit it's less convenient for a passive package repo to have to use a package/ subdir like that but for the case of a full hackage server with all the other services it means we can find the right url for uploads etc. We really need to write down a proper specification of the hackage interface. Duncan
participants (2)
-
Duncan Coutts
-
Johannes Waldmann