diff options
author | Olivier Blin <oblin@mandriva.com> | 2007-06-05 07:17:45 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2007-06-05 07:17:45 +0000 |
commit | 428eebefa1c4dd22e1fecefb99ca7731bf57f2b7 (patch) | |
tree | c5ae6c3fe4f976b4bb95844ca99887fb1cacc610 | |
parent | 59d009db21b6cf1199edc476c1c0658f64378714 (diff) | |
download | drakiso-428eebefa1c4dd22e1fecefb99ca7731bf57f2b7.tar drakiso-428eebefa1c4dd22e1fecefb99ca7731bf57f2b7.tar.gz drakiso-428eebefa1c4dd22e1fecefb99ca7731bf57f2b7.tar.bz2 drakiso-428eebefa1c4dd22e1fecefb99ca7731bf57f2b7.tar.xz drakiso-428eebefa1c4dd22e1fecefb99ca7731bf57f2b7.zip |
add a glob wrapper that dotglob behavior and expand only if needed
-rwxr-xr-x | draklive | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -301,6 +301,13 @@ sub moddeps_closure { sub directory_usage { first(split /\s/, `du -sb $_[0]`) } +#- expand only if the pattern contains '*' +#- and matches dot characters (like shell dotglob) +sub glob__ { + my ($pattern) = @_; + $pattern =~ /\*/ ? glob_($pattern) : $pattern; +} + sub run_ { my $options = ref $_[0] eq 'HASH' ? shift @_ : {}; my @cmd = @_; @@ -674,7 +681,7 @@ sub copy_files_to { my ($source, $dest, $o_perm) = @$_; $dest = $root . '/' . $dest; mkdir_p($dest =~ m|/$| ? $dest : dirname($dest)); - my @sources = glob_($live->{settings}{config_root} . '/' . $source); + my @sources = glob__($live->{settings}{config_root} . '/' . $source); print STDERR "copying @sources to $dest\n"; cp_f(@sources, $dest); chmod $o_perm, $dest if $o_perm; |