hackage-server: index format

Matthew Gruen wikigracenotes at gmail.com
Fri Nov 19 12:02:05 EST 2010


--- don't think the message made it to cabal-devel, forwarding, sorry
if you get it twice ---

On Fri, Nov 19, 2010 at 8:44 AM, Tillmann Rendel
<rendel at informatik.uni-marburg.de> wrote:
> Duncan Coutts wrote:
>>
>> [...] symlinks [...]
>>
>> Opinions?
>
> How would this interact with the absence of symlinks on Windows?
>
>  Tillmann
>

Symlinks are supported in the tar format with some special markers.
Since the index tarball is never unpacked on the client's filesystem,
only cabal needs to know about it, and it is backwards/forwards
compatible. It would be just another Tar.Entry (though LinkTarget
doesn't provide any straightforward extraction functions..).
<http://hackage.haskell.org/packages/archive/tar/latest/doc/html/Codec-Archive-Tar.html>

But if it does get unpacked by, say, 7zip on Windows -- not an
unreasonable thing to do -- we should at least check the behaviors
aren't too pathological. -.-

Antoine, as far as I can tell, the only reason the leading ./ is there
in the first place is because the tarball is created by piping find
into tar.

( echo preferred-versions; find . -maxdepth 3 -name '*.cabal' ) \
       | tar -c -T - -f - | gzip -9 >$tmp
mv $tmp 00-index.tar.gz

To answer your question: running tar -tf on hackage-server's
index.tar.gz, it doesn't include the ./, and cabal seems to have no
problems with it. I think Duncan mentioned that any other files that
are worth adding to the index tarball can be simply added for future
versions of cabal, since it ignores unknown files... any kind of
metadata you want.

Matt



More information about the cabal-devel mailing list