diff options
-rw-r--r-- | NEWS | 3 | ||||
-rwxr-xr-x | draksnapshot-config | 12 |
2 files changed, 11 insertions, 4 deletions
@@ -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 |