diff options
author | Guilhem Moulin <guilhem.moulin@ens-lyon.org> | 2011-08-10 16:20:53 +0200 |
---|---|---|
committer | Guilhem Moulin <guilhem.moulin@ens-lyon.org> | 2011-08-10 16:20:53 +0200 |
commit | f7b925955aab3802ee3918a7cc592cdd1e0c6682 (patch) | |
tree | 4d77dd1be5c50e19ec1a2a235caf06c1e07ea82a | |
parent | 0b6c492c04694247edc09e7838247d05d730fe5e (diff) |
crap
-rwxr-xr-x | videomv.pl | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -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.*)/) { |