Hi, Simon -
Another problem with "Setup makefile" is that it will overwrite an
existing Makefile, even if that file perhaps ought to be present. For
example, using "Setup makefile" in a Cabal repo clobbers Cabal's own
Makefile.
The attached patch causes "Setup makefile" to refuse to overwrite an
existing file. I'm a bit ambivalent about it, but I don't see another
simple, predictable way to avoid the possibility for foot-shooting.
<b
diff -rN -u old-cabal/Distribution/Simple/GHC.hs new-cabal/Distribution/Simple/GHC.hs
--- old-cabal/Distribution/Simple/GHC.hs 2007-04-24 10:22:06.000000000 -0700
+++ new-cabal/Distribution/Simple/GHC.hs 2007-04-24 10:22:06.000000000 -0700
@@ -381,6 +381,9 @@
let file = case makefileFile flags of
Just f -> f
_otherwise -> "Makefile"
+ targetExists <- doesFileExist file
+ when targetExists $
+ die ("Won't overwrite existing copy of " ++ file)
h <- openFile file WriteMode
let Just lib = library pkg_descr
_______________________________________________
cabal-devel mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cabal-devel