Bruce Korb <[EMAIL PROTECTED]> writes on 2005-10-30:

> The other variation on "mktemp" uses "illegal option"
> (you get arrested if you use one).  BTW, if the "mktemp -d -q"
> is successful in creating a file, shouldn't you remove the
> file before trying another method?

Sorry, I don't follow the reasoning behind this proposed patch, or the
BTW comment either.  I don't see why Autoconf should care what
diagnostic mktemp outputs: if mktemp fails, that's good enough reason
to try a traditional mkdir.


> $ cvs diff -u ./lib/Autom4te/General.pm
> Index: ./lib/Autom4te/General.pm
> ===================================================================
> RCS file: /cvsroot/autoconf/autoconf/lib/Autom4te/General.pm,v
> retrieving revision 1.34
> diff -u -r1.34 General.pm
> --- ./lib/Autom4te/General.pm   14 May 2005 07:00:39 -0000      1.34
> +++ ./lib/Autom4te/General.pm   30 Oct 2005 17:46:34 -0000
> @@ -310,10 +310,16 @@
>    my ($signature) = @_;
>    my $TMPDIR = $ENV{'TMPDIR'} || '/tmp';
>
> -  # If mktemp supports dirs, use it.
> -  $tmp = `(umask 077 &&
> -          mktemp -d -q "$TMPDIR/${signature}XXXXXX") 2>/dev/null`;
> +  $tmp = `(mktemp -@ 2>&1) | grep 'invalid option'`;
>    chomp $tmp;
> +
> +  if ($tmp)
> +    {
> +      # If mktemp supports dirs, use it.
> +      $tmp = `(umask 077 &&
> +          mktemp -d -q "$TMPDIR/${signature}XXXXXX") 2>/dev/null`;
> +      chomp $tmp;
> +    }
>
>    if (!$tmp || ! -d $tmp)
>      {


Reply via email to