From: Richard D. <ric...@us...> - 2009-03-07 10:24:33
|
Update of /cvsroot/file-extattr/File-ExtAttr In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv3863 Modified Files: Changes Makefile.PL Log Message: Fix #34394: "Test suite should skip on filesystems with no xattr support when run non-interactively" on Linux. Index: Changes =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/Changes,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** Changes 5 Mar 2009 06:42:20 -0000 1.47 --- Changes 7 Mar 2009 10:24:25 -0000 1.48 *************** *** 1,5 **** Revision history for Perl extension File::ExtAttr. ! 1.09 2009-03-?? - (richdawe) Add note to README about needing to install --- 1,5 ---- Revision history for Perl extension File::ExtAttr. ! 1.09 2009-03-07 - (richdawe) Add note to README about needing to install *************** *** 14,17 **** --- 14,24 ---- Document issue. + - (richdawe) Fix #34394: "Test suite should skip on filesystems + with no xattr support when run non-interactively" + on Linux. + + When run interactively, it will suggest what you need + to do, to get the test suite to pass. + - (richdawe) Fix RT #37889: "Crash when operating on a closed file handle on Solaris". This was due to using an uninitialised Index: Makefile.PL =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/Makefile.PL,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Makefile.PL 24 Feb 2008 10:17:48 -0000 1.10 --- Makefile.PL 7 Mar 2009 10:24:25 -0000 1.11 *************** *** 2,5 **** --- 2,8 ---- use ExtUtils::MakeMaker; use Devel::CheckLib; + use Cwd; + use File::Temp qw/tempdir/; + use IO::File; use strict; *************** *** 48,51 **** --- 51,79 ---- } + # Check whether extended attributes are supported on this filesystem. + # If we're running non-interactive there is no point failing all the tests, + # because the machine is not set up correctly. + if ($^O eq 'linux') { + my $basedir = $ENV{ATTR_TEST_DIR} || getcwd(); + my $template .= "$basedir/XXXXXXXX"; + my $dir = tempdir($template, CLEANUP => 1); + my $file = "$dir/testfile"; + my $fh = new IO::File(">$file") or die "Unable to open $file: $!"; + undef $fh; + + my $output = `setfattr -n user.foo -v foo $file 2>&1`; + if ($output =~ /command not found/i) { + warn "Please install the attr package (containing the setfattr program)"; + exit(0) if ($ENV{AUTOMATED_TESTING}); + } + if ($output =~ /Operation not supported/i) { + warn "To run the tests, you need mount the filesystem containing $basedir with the user_xattr option"; + warn "Alternatively set the environment variable ATTR_TEST_DIR to point at a filesystem where user_xattr is enabled"; + exit(0) if ($ENV{AUTOMATED_TESTING}); + } + } + + # TODO: Check filesystem on other operating systems + # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. |