summaryrefslogtreecommitdiffstats
path: root/draksnapshot-config
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 /draksnapshot-config
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
Diffstat (limited to 'draksnapshot-config')
-rwxr-xr-xdraksnapshot-config12
1 files changed, 9 insertions, 3 deletions
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