]> rtime.felk.cvut.cz Git - novaboot.git/commitdiff
Do not invoke rsync if there is nothing to copy
authorMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 27 Jan 2015 12:24:41 +0000 (13:24 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 27 Jan 2015 12:24:41 +0000 (13:24 +0100)
novaboot

index afb5e32388d7796b78efd7f1232d6bd18e95643e..c8e5f63e9d5ed9ee19c5fc86478f7228662955ae 100755 (executable)
--- a/novaboot
+++ b/novaboot
@@ -870,10 +870,12 @@ foreach my $script (@scripts) {
        map({ my $file = (split)[0]; die "$file: $!" if ! -f $file; } @$modules);
        my $istty = -t STDOUT && ($ENV{'TERM'} || 'dumb') ne 'dumb';
        my $progress = $istty ? "--progress" : "";
-       system_verbose("rsync $progress -RLp $rsync_flags $files $real_server");
-       if ($server =~ m|/\$NAME$| && $concat) {
-           my $cmd = join("; ", map { "( cd $path/.. && cat */$_ > $_ )" } @bootloader_configs);
-           system_verbose($hostname ? "ssh $hostname '$cmd'" : $cmd);
+       if ($files) {
+           system_verbose("rsync $progress -RLp $rsync_flags $files $real_server");
+           if ($server =~ m|/\$NAME$| && $concat) {
+               my $cmd = join("; ", map { "( cd $path/.. && cat */$_ > $_ )" } @bootloader_configs);
+               system_verbose($hostname ? "ssh $hostname '$cmd'" : $cmd);
+           }
        }
     }