automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: update_file: support --force


From: Alexandre Duret-Lutz
Subject: Re: update_file: support --force
Date: Mon, 24 Jan 2005 17:50:41 +0100

On Mon, Jan 24, 2005 at 11:56:24AM +0100, Akim Demaille wrote:
> OK?  (Tests suite is running, but Automake doesn't use it :)  aclocal
> could, though).

Sure

> -=item C<update_file ($from, $to)>
> +=item C<update_file ($from, $to; $force)>

IIRC the other module use

  =item C<update_file ($from, $to, [$force = 0])>

to describe conditional arguments.

>
>  Rename C<$from> as C<$to>, preserving C<$to> timestamp if it has not
> -changed.  Recognize C<$to> = C<-> standing for C<STDIN>.  C<$from> is
> -always removed/renamed.
> +changed, unless C<$force> is true (defaults to false).  Recognize
> +C<$to> = C<-> standing for C<STDIN>.  C<$from> is always
> +removed/renamed.
>
>  =cut
>

> +  $force = 0
> +    unless defined $force;

This should not be needed: !$force is true when $force is undefined.

> -  if (-f "$to" && compare ("$from", "$to") == 0)
> +  if (!$force && -f "$to" && compare ("$from", "$to") == 0)

> @@ -290,13 +293,13 @@
>  }
>
>
> -=item C<contents ($filename)>
> +=item C<contents ($file_name)>
>
> -Return the contents of c<$filename>.
> +Return the contents of c<$file_name>.

While you are at it:  C<




reply via email to

[Prev in Thread] Current Thread [Next in Thread]