cleaner. better error msg
This commit is contained in:
parent
8b06d627bf
commit
3d6e9ffea7
1 changed files with 9 additions and 7 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
#!/usr/bin/perl -w
|
#!/usr/bin/perl -w
|
||||||
|
|
||||||
# $Id$
|
# $Dwarf$
|
||||||
|
# $Source$
|
||||||
|
|
||||||
#
|
#
|
||||||
# Script to let an editor loose on a directory listing
|
# Script to let an editor loose on a directory listing
|
||||||
|
|
@ -178,6 +179,7 @@ sub check_unique(@) {
|
||||||
return (scalar(@uniqu) != scalar(@target))
|
return (scalar(@uniqu) != scalar(@target))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# show what the non-unique moves are
|
||||||
sub which_doubles {
|
sub which_doubles {
|
||||||
my %selector = ();
|
my %selector = ();
|
||||||
foreach $i (0 .. $#target) {
|
foreach $i (0 .. $#target) {
|
||||||
|
|
@ -268,10 +270,13 @@ sub paranoia($$) {
|
||||||
foreach $ctarget (@$target) {
|
foreach $ctarget (@$target) {
|
||||||
$safe = 0;
|
$safe = 0;
|
||||||
foreach $csource (@$source) {
|
foreach $csource (@$source) {
|
||||||
if ($ctarget eq $csource) { $safe = 1; }
|
if ($ctarget eq $csource) {
|
||||||
|
$safe = 1;
|
||||||
|
last;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (! $safe && -e $ctarget) {
|
if (! $safe && -e $ctarget) {
|
||||||
print "ERROR: That would overwrite files\n";
|
print "ERROR: That would overwrite file: $ctarget\n";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -288,7 +293,7 @@ sub lock {
|
||||||
die "Another mvwrap process is active in this direcory\n"
|
die "Another mvwrap process is active in this direcory\n"
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
open LOCK, "> .mvwrap" or die "Couldn't open .mvwrap for writing: $!\n";
|
open LOCK, ">.mvwrap" or die "Couldn't open .mvwrap for writing: $!\n";
|
||||||
print LOCK $$;
|
print LOCK $$;
|
||||||
close LOCK;
|
close LOCK;
|
||||||
}
|
}
|
||||||
|
|
@ -303,9 +308,6 @@ sub unlock {
|
||||||
|
|
||||||
# clean up lock & die
|
# clean up lock & die
|
||||||
sub cdie {
|
sub cdie {
|
||||||
#if (@pattern) {
|
|
||||||
#
|
|
||||||
#}
|
|
||||||
$message = shift;
|
$message = shift;
|
||||||
&unlock;
|
&unlock;
|
||||||
die "$message";
|
die "$message";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue