From: Richard D. <ric...@us...> - 2008-07-19 09:55:09
|
Update of /cvsroot/file-extattr/File-ExtAttr/t/lib/t In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv22738/t/lib/t Modified Files: Support.pm Log Message: Update Solaris layer to use new error reporting convention. Ignore SUNWattr_r[ow] system extensible attributes on (Open)Solaris. Added doc ref to Solaris system extensible attributes. Test listfattr() on a closed file. Index: Support.pm =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/t/lib/t/Support.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Support.pm 6 Apr 2008 09:21:27 -0000 1.2 --- Support.pm 19 Jul 2008 09:55:15 -0000 1.3 *************** *** 3,6 **** --- 3,7 ---- use strict; use Config; + use File::ExtAttr qw/listfattr/; sub should_skip { *************** *** 15,21 **** } ! # XXX: Write a function to return expected failure case for missing ! # attribute/etc. depending on platform. ! #/(Operation not supported|No such file or directory|Attribute not found)/ 1; --- 16,48 ---- } ! sub filter_system_attrs ! { ! my @attrs = @_; ! ! if ($^O eq 'solaris') ! { ! # Filter out container for extensible system attributes on Solaris. ! @attrs = grep { ! /^SUNWattr_r[ow]$/ } @attrs; ! } ! return @attrs; ! } ! ! # Check to see whether the file has unremovable system attributes. ! sub has_system_attrs ! { ! my ($h) = @_; ! my $ret = 0; ! ! if ($^O eq 'solaris') ! { ! my @attrs = listfattr($h); ! if (scalar(grep { /^SUNWattr_r[ow]$/ } @attrs) > 0) ! { ! $ret = 1; ! } ! } ! ! return $ret; ! } 1; |