X-Git-Url: https://git.madduck.net/code/myrepos.git/blobdiff_plain/c9232098307b1ba10076781bfc7794d133c2236e..da4251ccfad6a4ea83fcc21a70f7f7dd26e5fa55:/mr?ds=inline diff --git a/mr b/mr index b2cb388..95a7fe8 100755 --- a/mr +++ b/mr @@ -316,7 +316,7 @@ elsif ($action eq 'config') { } my $section=shift; if ($section=~/^\//) { - # try to convert to a path relative to $config's dir + # try to convert to a path relative to the config file my ($dir)=$ENV{MR_CONFIG}=~/^(.*\/)[^\/]+$/; if ($section=~/^\Q$dir\E(.*)/) { $section=$1; @@ -428,9 +428,10 @@ sub action { #{{{ } $dir=~s/^(.*)\/[^\/]+\/?$/$1/; + if (! -d $dir) { print "mr $action: creating parent directory $dir\n" if $verbose; - mkdir $dir; + my $ret=system("mkdir", "-p", $dir); } } elsif ($action eq 'update') { @@ -536,7 +537,7 @@ if ($stats) { print "mr $action: (skipped: ".join(" ", @skipped).")\n"; } if (@failed) { - print "mr $action: (failed: ".join(" ", @failed).")\n"; + print STDERR "mr $action: (failed: ".join(" ", @failed).")\n"; } } if (@failed) {