summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpterjan <pterjan@99302b65-d5f7-0310-b3dd-f8cd6f4e3d94>2010-08-17 08:46:19 +0000
committerpterjan <pterjan@99302b65-d5f7-0310-b3dd-f8cd6f4e3d94>2010-08-17 08:46:19 +0000
commitc5bf71a8a4908f70e1ca3419b5e9f9ae067fbc1b (patch)
tree72261db92d4adf16ad8cbb14515cfc2ab0a27f53
parent33c69877b88a788287f5544ef9ba49856a23da8c (diff)
downloaddraksnapshot-c5bf71a8a4908f70e1ca3419b5e9f9ae067fbc1b.tar
draksnapshot-c5bf71a8a4908f70e1ca3419b5e9f9ae067fbc1b.tar.gz
draksnapshot-c5bf71a8a4908f70e1ca3419b5e9f9ae067fbc1b.tar.bz2
draksnapshot-c5bf71a8a4908f70e1ca3419b5e9f9ae067fbc1b.tar.xz
draksnapshot-c5bf71a8a4908f70e1ca3419b5e9f9ae067fbc1b.zip
Only restore defaults when all intervals are missing
git-svn-id: http://svn.mandriva.com/svn/soft/draksnapshot/trunk@270580 99302b65-d5f7-0310-b3dd-f8cd6f4e3d94
-rw-r--r--NEWS3
-rwxr-xr-xdraksnapshot-config12
2 files changed, 11 insertions, 4 deletions
diff --git a/NEWS b/NEWS
index 0353834..bc25883 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,5 @@
-- do not delete interval lines since they can no longer be set (#58534)
+- do not delete interval lines since they can no longer be set, and
+ restore defaults when they are all missing (#58534)
Version 0.20.3 - 26 May 2010
diff --git a/draksnapshot-config b/draksnapshot-config
index 6faf99a..00da4c2 100755
--- a/draksnapshot-config
+++ b/draksnapshot-config
@@ -63,17 +63,23 @@ my ($backup_list, $exclude_list) = map {
} qw(backup exclude);
+my $interval_exists;
my %default_intervals = (
map {
if (my ($type, $interval) = /^interval\s*(\S*)\s*(\S*)/) {
+ $interval_exists = 1;
$type => $interval;
}
} grep { /^interval\s/ } cat_($config_file)
);
-# initialize commented out fields:
-$default_intervals{$_} ||= $default_values{$_} foreach @ordered_intervals;
-
+if ($interval_exists) {
+ # If there is some interval in the config file, keep them as is
+ $default_intervals{$_} ||= 0 foreach @ordered_intervals;
+} else {
+ # Else we had broken it (#58534) so restore defaults
+ $default_intervals{$_} ||= $default_values{$_} foreach @ordered_intervals;
+}
######### GUI