From 428eebefa1c4dd22e1fecefb99ca7731bf57f2b7 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Tue, 5 Jun 2007 07:17:45 +0000 Subject: add a glob wrapper that dotglob behavior and expand only if needed --- draklive | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/draklive b/draklive index e27b10a..9d704f0 100755 --- a/draklive +++ b/draklive @@ -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; -- cgit v1.2.1