summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xvideomv.pl15
1 files changed, 8 insertions, 7 deletions
diff --git a/videomv.pl b/videomv.pl
index 45ad208..5f40811 100755
--- a/videomv.pl
+++ b/videomv.pl
@@ -23,10 +23,12 @@ use strict;
################################################################################
# Configuration
-
my $symlinks = catdir($HOME,'video','MOVIES'); # Symlinks folder
my $directors = catdir($HOME,'video','DIRECTORS'); # Directors folder
+$symlinks = catdir('','tmp','video','MOVIES'); # Symlinks folder
+$directors = catdir('','tmp','video','DIRECTORS'); # Directors folder
+
my $driver = "mysql";
my $database = "videodb";
my $hostname = "127.0.0.1";
@@ -293,7 +295,7 @@ $new_path = $symlinks unless defined $new_path;
die "Error: incompatible options.\n" if
(defined $lookupdb_flag) and (defined $ignoredb_flag);
-die "Error: `" .$old_path. "' does not exist.\n"
+die "Error: `" .$old_path. "' is neither a symlink nor a plain file.\n"
unless (-l $old_path or -f $old_path);
$new_path = catfile ($new_path, basename($old_path))
@@ -558,13 +560,12 @@ sub revert {
while ($#actions >= 0) {
my $rev;
- if ($actions[0] =~ /^Renaming target/) {
+ if ($actions[0] =~ /^(Renaming target)(\.{3}) {5}( *)/) {
+ $actions[0] = $1 .' back'. $2.$3;
$rev = rename $new_target, $old_target;
}
- elsif ($actions[0] =~ /^Moving target/) {
- $rev = move $new_target, $old_target;
- }
- elsif ($actions[0] =~ /^Moving target/) {
+ elsif ($actions[0] =~ /^(Moving target)(\.{3}) {5}( *)/) {
+ $actions[0] = $1 .' back'. $2.$3;
$rev = move $new_target, $old_target;
}
elsif ($actions[0] =~ /^Deleting( old symlink.*)/) {