Commit 5138ff53 authored by ijones's avatar ijones
Browse files

fixed up sdist a bit

** fixed bug in SDist where it wasn't looking in the hsSourceDir
** cleaned up a little
parent 249451c9
......@@ -102,7 +102,7 @@ installHugs pref buildPref pkg_descr
mkImportDir :: PackageDescription -> LocalBuildInfo -> FilePath
mkImportDir pkg_descr lbi =
#ifdef mingw32_TARGET_OS
pathJoin [prefix lbi, pkg_name
pathJoin [prefix lbi, pkg_name]
#else
pathJoin [prefix lbi, "lib", pkg_name]
#endif
......
......@@ -61,19 +61,26 @@ import HUnit (Test)
-- |Create a source distribution. FIX: Calls tar directly (won't work
-- on windows).
sdist :: FilePath -- ^build prefix
sdist :: FilePath -- ^build prefix (temp dir)
-> FilePath -- ^TargetPrefix
-> PackageDescription -> LocalBuildInfo -> IO ()
sdist srcPref targetPref pkg_descr _ = do
sdist tmpDir targetPref
pkg_descr@PackageDescription{allModules=mods,
mainModules=mainMods,
hsSourceDir=srcDir
} _
= do
setupMessage "Building source dist for" pkg_descr
ex <- doesDirectoryExist srcPref
when ex (die $ "Source distribution already in place. please move: " ++ srcPref)
moveSources "" (pathJoin [srcPref, nameVersion pkg_descr])
(allModules pkg_descr) (mainModules pkg_descr) ["lhs", "hs"]
system $ "tar --directory=" ++ srcPref ++ " -zcf " ++
ex <- doesDirectoryExist tmpDir
let tmpLoc1 = pathJoin [tmpDir, nameVersion pkg_descr, srcDir]
let tmpLoc2 = pathJoin [tmpDir, nameVersion pkg_descr]
when ex (die $ "Source distribution already in place. please move: " ++ tmpDir)
moveSources srcDir tmpLoc1 mods mainMods ["lhs", "hs"]
moveSources "" tmpLoc2 ["Setup"] [] ["lhs", "hs"]
system $ "tar --directory=" ++ tmpDir ++ " -zcf " ++
(pathJoin [targetPref, tarBallName pkg_descr])
++ " " ++ (nameVersion pkg_descr)
system $ "rm -rf " ++ srcPref
system $ "rm -rf " ++ tmpDir
putStrLn "Source tarball created."
------------------------------------------------------------
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment