diff options
-rw-r--r-- | MDK/Common.pm.pl | 2 | ||||
-rw-r--r-- | MDK/Common/File.pm | 12 | ||||
-rw-r--r-- | perl-MDK-Common.spec | 5 |
3 files changed, 16 insertions, 3 deletions
diff --git a/MDK/Common.pm.pl b/MDK/Common.pm.pl index ed919a7..e818535 100644 --- a/MDK/Common.pm.pl +++ b/MDK/Common.pm.pl @@ -74,7 +74,7 @@ use vars qw(@ISA @EXPORT $VERSION); #); # perl_checker: RE-EXPORT-ALL @EXPORT = map { @$_ } map { values %{'MDK::Common::' . $_ . 'EXPORT_TAGS'} } grep { /::$/ } keys %MDK::Common::; -$VERSION = "1.1.19"; +$VERSION = "1.1.20"; 1; EOF diff --git a/MDK/Common/File.pm b/MDK/Common/File.pm index 26923a4..86fb98b 100644 --- a/MDK/Common/File.pm +++ b/MDK/Common/File.pm @@ -82,6 +82,10 @@ ensure the file exists, set the modification time to current time returns all the file in directory (except "." and "..") +=item all_files_rec(DIRNAME) + +returns all the files in directory and the sub-directories (except "." and "..") + =item glob_(STRING) simple version of C<glob>: doesn't handle wildcards in directory (eg: @@ -117,7 +121,7 @@ L<MDK::Common> use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK); @ISA = qw(Exporter); -@EXPORT_OK = qw(dirname basename cat_ cat_or_die cat__ output output_p output_with_perm append_to_file linkf symlinkf renamef mkdir_p rm_rf cp_f cp_af touch all glob_ substInFile expand_symlinks openFileMaybeCompressed catMaybeCompressed); +@EXPORT_OK = qw(dirname basename cat_ cat_or_die cat__ output output_p output_with_perm append_to_file linkf symlinkf renamef mkdir_p rm_rf cp_f cp_af touch all all_files_rec glob_ substInFile expand_symlinks openFileMaybeCompressed catMaybeCompressed); %EXPORT_TAGS = (all => [ @EXPORT_OK ]); sub dirname { local $_ = shift; s|[^/]*/*\s*$||; s|(.)/*$|$1|; $_ || '.' } @@ -220,6 +224,12 @@ sub all { @l; } +sub all_files_rec { + my ($d) = @_; + + map { $_, -d $_ ? all_files_rec($_) : () } map { "$d/$_" } all($d); +} + sub glob_ { my ($d, $f) = $_[0] =~ /\*/ ? (dirname($_[0]), basename($_[0])) : ($_[0], '*'); diff --git a/perl-MDK-Common.spec b/perl-MDK-Common.spec index cb2deea..4038ee0 100644 --- a/perl-MDK-Common.spec +++ b/perl-MDK-Common.spec @@ -2,7 +2,7 @@ # do not change the version here, change in MDK/Common.pm.pl %define version THEVERSION -%define release 2mdk +%define release 1mdk %ifarch x86_64 %define build_option PERL_CHECKER_TARGET='debug-code BCSUFFIX=""' @@ -64,6 +64,9 @@ rm -rf $RPM_BUILD_ROOT # MODIFY IN THE CVS: cvs.mandrakesoft.com:/cooker soft/perl-MDK-Common %changelog +* Tue Nov 16 2004 Pixel <pixel@mandrakesoft.com> 1.1.20-1mdk +- MDK::Common::File : add all_files_rec() + * Mon Nov 15 2004 Rafael Garcia-Suarez <rgarciasuarez@mandrakesoft.com> 1.1.19-2mdk - rebuild for new perl |