Subject: Cabal's `sdist` on Win32
From: Otakar Smrz <[email-masked]>
To: [email-masked]
Date: Tue, 17 Oct 2006 17:11:14 +0200 (CEST)

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