From fb4ac28b367142cf6338da1718c766f198cc3458 Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Mon, 29 Aug 2011 23:13:30 -0400 Subject: [PATCH] Better message when trying to add a customname that already exists. --- bucardo | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/bucardo b/bucardo index c3f16eb71..4b4b37801 100755 --- a/bucardo +++ b/bucardo @@ -2667,14 +2667,23 @@ sub add_customname { my $x = 0; my @msg; { - ## Skip if this exact entry already exists - next if customname_exists($goatid,$newname,$db[$x],$sync[$x]); - $sth->execute($newname, $db[$x], $sync[$x]); - my $msg = "Transformed $sname.$tname to $newname"; + ## Setup common message post scripts + my $msg = ''; defined $db[$x] and $msg .= " (for database $db[$x])"; defined $sync[$x] and $msg .= " (for sync $sync[$x])"; - push @msg => $msg; + + ## Skip if this exact entry already exists + if (customname_exists($goatid,$newname,$db[$x],$sync[$x])) { + if (!$QUIET) { + printf "Already have an entry for %s to %s%s\n", + $item_name, $newname, $msg; + } + next; + } + + $sth->execute($newname, $db[$x], $sync[$x]); + push @msg => "Transformed $sname.$tname to $newname$msg"; ## Always go at least one round ## We go a second time if there is another sync or db waiting -- 2.39.5