]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: avoid failure with older version of Perl's File::Temp
authorJim Meyering <meyering@redhat.com>
Fri, 30 May 2008 07:45:53 +0000 (09:45 +0200)
committerJim Meyering <meyering@redhat.com>
Fri, 30 May 2008 07:45:53 +0000 (09:45 +0200)
* tests/CuTmpdir.pm (import): Use &File::Temp::cleanup only
if it is defined.  Reported by Bruno Haible in
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13652

tests/CuTmpdir.pm

index e21306a57c770f301f37561ac1b7d27ee799ba90..a7dd8b6a80ffe8db7caf3242555a807fc4e4429f 100644 (file)
@@ -82,7 +82,9 @@ sub import {
     if ($$ == $original_pid and defined $dir)
       {
        chmod_tree;
-       File::Temp::cleanup;
+       # Older versions of File::Temp lack this method.
+       exists &File::Temp::cleanup
+         and &File::Temp::cleanup;
       }
     $SIG{$sig} = 'DEFAULT';
     kill $sig, $$;