summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-08-22 13:41:35 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-08-22 13:41:35 +0000
commit897838e2929c236f7ea7522b00d9bb96841f1b23 (patch)
tree9506a5047acdf8f7965f7f846ded8ea5fb1f6e86
parentee7d2bb5fecbc6d8874809cbcb6d5f6da8e02f60 (diff)
downloaddrakx-897838e2929c236f7ea7522b00d9bb96841f1b23.tar
drakx-897838e2929c236f7ea7522b00d9bb96841f1b23.tar.gz
drakx-897838e2929c236f7ea7522b00d9bb96841f1b23.tar.bz2
drakx-897838e2929c236f7ea7522b00d9bb96841f1b23.tar.xz
drakx-897838e2929c236f7ea7522b00d9bb96841f1b23.zip
try harder to have things working when not both xfree3 and xfree4 config are there
-rw-r--r--perl-install/Xconfig/xfree.pm20
1 files changed, 13 insertions, 7 deletions
diff --git a/perl-install/Xconfig/xfree.pm b/perl-install/Xconfig/xfree.pm
index 69c1b307e..583229f4b 100644
--- a/perl-install/Xconfig/xfree.pm
+++ b/perl-install/Xconfig/xfree.pm
@@ -19,8 +19,8 @@ sub read {
#- files are optional
sub write {
my ($both, $xfree3_file, $xfree4_file) = @_;
- $both->{xfree3}->write($xfree3_file);
- $both->{xfree4}->write($xfree4_file);
+ $both->{xfree3} ? $both->{xfree3}->write($xfree3_file) : unlink($xfree3_file);
+ $both->{xfree4} ? $both->{xfree4}->write($xfree4_file) : unlink($xfree4_file);
}
sub empty_config {
@@ -53,15 +53,21 @@ sub set_monitors { set_both('set_monitors', @_) }
sub get_both {
my ($getter, $both) = @_;
- my @l3 = $both->{xfree3}->$getter;
- my @l4 = $both->{xfree4}->$getter;
- merge_values(\@l3, \@l4);
+ if ($both->{xfree3}) {
+ $both->{xfree4}->$getter;
+ } elsif ($both->{xfree4}) {
+ $both->{xfree3}->$getter;
+ } else {
+ my @l3 = $both->{xfree3}->$getter;
+ my @l4 = $both->{xfree4}->$getter;
+ merge_values(\@l3, \@l4);
+ }
}
sub set_both {
my ($setter, $both, @l) = @_;
- $both->{xfree3}->$setter(@l);
- $both->{xfree4}->$setter(@l);
+ $both->{xfree3}->$setter(@l) if $both->{xfree3};
+ $both->{xfree4}->$setter(@l) if $both->{xfree4};
}
sub merge_values {