Codebase list mussort / d448bc4
implement a DryRun, so nothing really happens Achim Schaefer 10 years ago
1 changed file(s) with 9 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
9595 my $readFromCache = true;
9696 # Bool, true if we should add all directories to the clean process
9797 my $addAllCleanTree = false;
98 # Bool, true if we just output what will be done, don't actually do anything
99 my $DryRun;
98100
99101 # This makes sure the children are slayed properly
100102 $SIG{CHLD} = sub {
15351537 }
15361538 # Output info and do the actual renaming
15371539 printv(M_STANDARD,"Rename: $OutputOldName -> $OutputNewName\n");
1538 move($OrigFile,$NewFile) or FatalError("Unable to move $OrigFile to $NewFile: $!");
1539 cacheRename($OrigFile,$NewFile);
1540 $cleanTree{dirname($OrigFile)} = true;
1540 unless(defined $DryRun)
1541 {
1542 move($OrigFile,$NewFile) or FatalError("Unable to move $OrigFile to $NewFile: $!");
1543 cacheRename($OrigFile,$NewFile);
1544 $cleanTree{dirname($OrigFile)} = true;
1545 }
15411546 }
15421547
15431548 # Purpose: Queue a file for renaming
22092214 'nocache|no-cache' => sub { $cacheFile = false },
22102215 'refresh-cache' => sub { $readFromCache = false },
22112216 'v|verbose+' => \$verbosity,
2217 'dryrun' => \$DryRun,
22122218 'q|quiet' => sub { $verbosity = 0 },
22132219 'cleantree' => $addAllCleanTree,
22142220 'cleancache' => \&cleanCache,