summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2007-06-05 07:17:45 +0000
committerOlivier Blin <oblin@mandriva.com>2007-06-05 07:17:45 +0000
commit428eebefa1c4dd22e1fecefb99ca7731bf57f2b7 (patch)
treec5ae6c3fe4f976b4bb95844ca99887fb1cacc610
parent59d009db21b6cf1199edc476c1c0658f64378714 (diff)
downloaddrakiso-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-xdraklive9
1 files changed, 8 insertions, 1 deletions
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;