X-From-Line: otakar.smrz@mff.cuni.cz  Tue Oct 17 08:56:41 2006
Return-Path: <otakar.smrz@mff.cuni.cz>
X-Original-To: ijones2@localhost
Delivered-To: ijones2@localhost
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by bishop.syntaxpolice.org (Postfix) with ESMTP id CBDA043C313
	for <ijones2@localhost>; Tue, 17 Oct 2006 08:56:41 -0700 (PDT)
X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on
	bishop.syntaxpolice.org
X-Spam-Level: 
X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=failed
	version=3.1.1
Received: from localhost.localdomain [127.0.0.1]
	by localhost.localdomain with POP3 (fetchmail-6.3.4)
	for <ijones2@localhost> (single-drop);
	Tue, 17 Oct 2006 08:56:41 -0700 (PDT)
Received: from smtp1.ms.mff.cuni.cz (ns.ms.mff.cuni.cz [195.113.20.71])
	by syntaxpolice.org (8.13.8/8.13.6/Debian-1) with ESMTP id
	k9HFBGUe005244
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <ijones@syntaxpolice.org>; Tue, 17 Oct 2006 11:11:18 -0400
Received: from ufal.ms.mff.cuni.cz (ufal.ms.mff.cuni.cz [195.113.20.52])
	by smtp1.ms.mff.cuni.cz (8.13.1/8.13.1) with ESMTP id k9HFBEIb094298
	for <ijones@syntaxpolice.org>; Tue, 17 Oct 2006 17:11:15 +0200 (CEST)
	(envelope-from otakar.smrz@mff.cuni.cz)
Received: from ufal.mff.cuni.cz (localhost.localdomain [127.0.0.1])
	by ufal.ms.mff.cuni.cz (8.13.1/8.13.1) with SMTP id k9HFBEFp002436
	for <ijones@syntaxpolice.org>; Tue, 17 Oct 2006 17:11:14 +0200
Date: Tue, 17 Oct 2006 17:11:14 +0200 (CEST)
From: Otakar Smrz <otakar.smrz@mff.cuni.cz>
X-X-Sender: smrz@ufal.ms.mff.cuni.cz
To: ijones@syntaxpolice.org
Subject: Cabal's `sdist` on Win32
Message-ID: <Pine.LNX.4.61.0610171656070.16078@ufal.ms.mff.cuni.cz>
Lines: 40
Xref: localhost.localdomain misc:28620
MIME-Version: 1.0

Dear Isaac,

I have not been able to successfully run the `sdist` command with 
Cabal on my WinXP system, neither with GHC 6.6, nor with WinHugs (Sep 
2006).

The reason seams to be that when calling the system to tar and gzip 
the source directory, you are using too sophisticated command-line 
syntax. Thus, windows (nor cygwin) cannot get the final tar.gz right.

I therefore propose that you make some kind of change at the module 
Distribution.Simple.SrcDist:

   let tarBallFilePath = targetPref `joinFileName` tarBallName 
pkg_descr

-- line 133 replaced with these two system calls

   system $ unwords ["tar -C", tmpDir, "-cf",
                                tarBallFilePath, nameVersion pkg_descr]
   system $ unwords ["gzip -9", tarBallFilePath]

-- end of changes

   removeDirectoryRecursive tmpDir
   putStrLn $ "Source tarball created: " ++ tarBallFilePath


And of course, it is needed to name the tarBall without the .gz 
ending, otherwise gzip protests:

tarBallName p = (nameVersion p) ++ ".tar"


Thank you for considering this.

Best regards,

Otakar Smrz

