[RFC] Don't overwrite an existing Makefile

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.

On Tue, 2007-04-24 at 10:24 -0700, Bryan O'Sullivan wrote:
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.
That sounds reasonable to me. Any objections? If not I'll apply it. Duncan

Duncan Coutts wrote:
On Tue, 2007-04-24 at 10:24 -0700, Bryan O'Sullivan wrote:
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.
That sounds reasonable to me. Any objections? If not I'll apply it.
Sure, go ahead. I was meaning to get around to that sometime. Cheers, Simon

On Tue, 2007-04-24 at 10:24 -0700, Bryan O'Sullivan wrote:
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.
Applied. Btw, it's a little easier if you send darcs patches rather than diff-style patches. Plus you get your name properly recorded in the darcs changelog! :-) (rather than just in the commit message) Duncan
participants (3)
-
Bryan O'Sullivan
-
Duncan Coutts
-
Simon Marlow