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
|
||||
|
||||
# $Id$
|
||||
# $Dwarf$
|
||||
# $Source$
|
||||
|
||||
#
|
||||
# Script to let an editor loose on a directory listing
|
||||
|
|
@ -178,6 +179,7 @@ sub check_unique(@) {
|
|||
return (scalar(@uniqu) != scalar(@target))
|
||||
}
|
||||
|
||||
# show what the non-unique moves are
|
||||
sub which_doubles {
|
||||
my %selector = ();
|
||||
foreach $i (0 .. $#target) {
|
||||
|
|
@ -268,10 +270,13 @@ sub paranoia($$) {
|
|||
foreach $ctarget (@$target) {
|
||||
$safe = 0;
|
||||
foreach $csource (@$source) {
|
||||
if ($ctarget eq $csource) { $safe = 1; }
|
||||
if ($ctarget eq $csource) {
|
||||
$safe = 1;
|
||||
last;
|
||||
}
|
||||
}
|
||||
if (! $safe && -e $ctarget) {
|
||||
print "ERROR: That would overwrite files\n";
|
||||
print "ERROR: That would overwrite file: $ctarget\n";
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -288,7 +293,7 @@ sub lock {
|
|||
die "Another mvwrap process is active in this direcory\n"
|
||||
}
|
||||
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 $$;
|
||||
close LOCK;
|
||||
}
|
||||
|
|
@ -303,9 +308,6 @@ sub unlock {
|
|||
|
||||
# clean up lock & die
|
||||
sub cdie {
|
||||
#if (@pattern) {
|
||||
#
|
||||
#}
|
||||
$message = shift;
|
||||
&unlock;
|
||||
die "$message";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue