return correct number of new files in each increment (just display error)
authordpavlin <dpavlin@8392b6e1-25fa-0310-8288-cc32f8e212ea>
Wed, 24 Aug 2005 17:12:22 +0000 (17:12 +0000)
committerdpavlin <dpavlin@8392b6e1-25fa-0310-8288-cc32f8e212ea>
Wed, 24 Aug 2005 17:12:22 +0000 (17:12 +0000)
git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/BackupPC/trunk@70 8392b6e1-25fa-0310-8288-cc32f8e212ea

bin/BackupPC_updatedb

index bab727a..6a5479f 100755 (executable)
@@ -392,15 +392,15 @@ sub recurseDir($$$$$$$$) {
                                $filesInBackup->{$path_key}->{'size'}
                        ));
 
-
-                       if (! defined($beenThere->{$key}) && ! found_in_db($key, @data)) {
+                       my $found;
+                       if (! defined($beenThere->{$key}) && ! ($found = found_in_db($key, @data)) ) {
                                print STDERR "# key: $key [", $beenThere->{$key},"]" if ($debug >= 2);
 
                                if ($filesInBackup->{$path_key}->{'type'} == BPC_FTYPE_DIR) {
-                                       $new_dirs++;
+                                       $new_dirs++ unless ($found);
                                        print STDERR " dir\n" if ($debug >= 2);
                                } else {
-                                       $new_files++;
+                                       $new_files++ unless ($found);
                                        print STDERR " file\n" if ($debug >= 2);
                                }
                                $size += $filesInBackup->{$path_key}->{'size'} || 0;