summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xvideomv.pl19
1 files changed, 10 insertions, 9 deletions
diff --git a/videomv.pl b/videomv.pl
index a96e62d..f45d463 100755
--- a/videomv.pl
+++ b/videomv.pl
@@ -539,21 +539,24 @@ else {
my $old_tar;
if (defined $old_symlink) {
$old_tar = readlink $old_symlink;
- &perform ("Deleting old symlink... ", unlink $old_symlink);
+ &perform ("Deleting old symlink... ", unlink $old_symlink) unless $r;
}
-opendir my $DIR, catdir($directors, $old_director) or die "Can't open: $!";
-if (scalar(grep(!/^\.\.?$/, readdir $DIR) == 0)) {
- &perform ("Removing empty dir... ", rmdir catdir($directors, $old_director));
+unless ($r) {
+ opendir my $DIR, catdir($directors, $old_director) or die "Can't open: $!";
+ if (scalar(grep(!/^\.\.?$/, readdir $DIR) == 0)) {
+ &perform ("Removing empty dir... ", rmdir catdir($directors, $old_director));
+ }
+ closedir $DIR or die "Can't close: $!";
}
-closedir $DIR or die "Can't close: $!";
&perform ("Creating new symlink... ",
symlink catfile(updir(),'DIRECTORS',$new_director,$new_filename),
- $new_symlink);
+ $new_symlink)
+ unless $r;
-unless (defined $ignoredb_flag || $old_filename eq $new_filename) {
+unless ($r || defined ($ignoredb_flag) || $old_filename eq $new_filename) {
print LOG "Updating database... ";
if ($nRES == 0) {
$r = 2;
@@ -600,8 +603,6 @@ sub ack {
# Perform the given action; revert successful changes in case of failing
sub perform {
- return if $r;
-
my ($action,$test) = @_;
print LOG $action;