From 4829dacee893c245fd7e26c6c5a4a31fc6d3e5d8 Mon Sep 17 00:00:00 2001 From: "gregoire.detrez" Date: Wed, 15 Oct 2014 08:51:39 +0000 Subject: [PATCH] Make `cabal sdist` fail with an informative error message` --- Setup.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Setup.hs b/Setup.hs index a2527a843..76062bcbe 100644 --- a/Setup.hs +++ b/Setup.hs @@ -28,7 +28,7 @@ main = defaultMainWithHooks simpleUserHooks{ preBuild = gfPreBuild , postInst = gfPostInst , preCopy = const . checkRGLArgs , postCopy = gfPostCopy --- , sDistHook = sdistRGL + , sDistHook = sdistError } where gfPreBuild args = gfPre args . buildDistPref @@ -182,6 +182,12 @@ sdistRGL pkg mb_lbi hooks flags = do else return paths else getRGLFiles path paths -} + +-- | Cabal doesn't know how to correctly create the source distribution, so +-- we print an error message with the correct instructions when someone tries +-- `cabal sdist`. +sdistError _ _ _ _ = fail "Error: Use `make sdist` to create the source distribution file" + rgl_src_dir = "lib" "src" rgl_dst_dir lbi = buildDir lbi "rgl"