added BackupPC::View only_first option
[BackupPC.git] / lib / BackupPC / View.pm
index 3348f6c..3f56841 100644 (file)
@@ -13,7 +13,7 @@
 #   Craig Barratt  <cbarratt@users.sourceforge.net>
 #
 # COPYRIGHT
-#   Copyright (C) 2002-2007  Craig Barratt
+#   Copyright (C) 2002-2009  Craig Barratt
 #
 #   This program is free software; you can redistribute it and/or modify
 #   it under the terms of the GNU General Public License as published by
@@ -31,7 +31,7 @@
 #
 #========================================================================
 #
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.2.0, released 31 Jul 2010.
 #
 # See http://backuppc.sourceforge.net.
 #
@@ -105,6 +105,9 @@ sub dirCache
        #
        next if ( $m->{backups}[$i]{level} >= $level );
 
+       last if exists $m->{dirOpts}->{only_first} && $i != $m->{idx};
+       # used by bin/BackupPC_updatedb to extract just first increment
+
        $level = $m->{backups}[$i]{level};
        $backupNum = $m->{backups}[$i]{num};
        push(@{$m->{mergeNums}}, $backupNum);