[darcs-users] darcs patch: Cabal: Do not make absence of a diff tool fatal.

Trent W. Buck trentbuck at gmail.com
Wed Feb 4 01:24:53 UTC 2009


Petr Rockai <me at mornfall.net> writes:

> Tue Feb  3 16:56:56 CET 2009  Petr Rockai <me at mornfall.net>
>   * Cabal: Do not make absence of a diff tool fatal.
>
>
> New patches:
>
> [Cabal: Do not make absence of a diff tool fatal.
> Petr Rockai <me at mornfall.net>**20090203155656
>  Ignore-this: 89c3337030556b9ca4a945d82283d356
> ] hunk ./Setup.lhs 163
>                  [ "sendmail" ]
>  
>    when (null diff) $
> -       fail "Could not find diff executable! Need one of gdiff, gnudiff or diff."
> +       putStrLn "WARNING: Could not find diff executable! Need one of gdiff, gnudiff or diff."
>  
>    let features = [ ("HAVE_HTTP", "x-have-http" `elem` customFields)
>                   , ("USE_COLOR", "x-use-color" `elem` customFields)
> hunk ./Setup.lhs 172
>                   , ("BIGENDIAN", bigendian) ]
>  
>        defs = [ ("SENDMAIL", quote $ head (sendmail ++ ["false"]))
> -             , ("DIFF", quote $ head diff) ]
> +             , ("DIFF", quote $ head (diff ++ ["false"])) ]

I'm not too happy with this as a permanent fix, as diff(1) is *expected*
to exit with a nonzero status when there are changes; thus I expect
using false(1) as diff will result in confusing empty diffs.

I would prefer if DIFF were not set if not found, and in
Darcs.Commands.Diff had something like

    no_diff_cmd = [exit unsuccessfully with an explanatory message.]

    diff_command = DarcsCommand {command_name = "diff",
                                 command_help = diff_help,
                                 command_description = diff_description,
                                 command_extra_args = -1,
                                 command_extra_arg_help
                                     = ["[FILE or DIRECTORY]..."],
    #ifdef DIFF
                                 command_command = diff_cmd,
    #else
                                 command_command = no_diff_cmd,
    #endif



More information about the darcs-users mailing list