summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-08-16 10:11:05 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-08-16 10:11:05 +0000
commit36d53f0ec174726d3699a8ab823b138781e77b91 (patch)
tree1d8fcdbc376b9877621eecf8f4132c30d4c99c63
parentf9c4850d8cd2da303f1cdb826b35fb69a7e5e590 (diff)
downloaddrakx-36d53f0ec174726d3699a8ab823b138781e77b91.tar
drakx-36d53f0ec174726d3699a8ab823b138781e77b91.tar.gz
drakx-36d53f0ec174726d3699a8ab823b138781e77b91.tar.bz2
drakx-36d53f0ec174726d3699a8ab823b138781e77b91.tar.xz
drakx-36d53f0ec174726d3699a8ab823b138781e77b91.zip
handle /etc/X11/xorg.conf
-rw-r--r--perl-install/Xconfig/xfree.pm15
1 files changed, 11 insertions, 4 deletions
diff --git a/perl-install/Xconfig/xfree.pm b/perl-install/Xconfig/xfree.pm
index 18fc31e15..976ee48d2 100644
--- a/perl-install/Xconfig/xfree.pm
+++ b/perl-install/Xconfig/xfree.pm
@@ -17,16 +17,23 @@ sub new {
################################################################################
sub read {
my ($class) = @_;
- my $file = "$::prefix/etc/X11/XF86Config";
- $file = "$file-4" if -e "$file-4"; #- prefer XF86Config-4 when there is one. Writing will take care of keeping only the new name
+ my @files = map { "$::prefix/etc/X11/$_" } 'xorg.conf', 'XF86Config-4', 'XF86Config';
+ my $file = (find { -f $_ && ! -l $_ } @files) || (find { -f $_ } @files);
$class->new(Xconfig::parse::read_XF86Config($file));
}
sub write {
my ($raw_X, $o_file) = @_;
my $file = $o_file || "$::prefix/etc/X11/XF86Config";
if (!$o_file) {
- rename $file, "$file.old";
- rename "$file-4", "$file-4.old"; #- there won't be any XF86Config-4 anymore, we want this!
+ my $xorg = "$::prefix/etc/X11/xorg.conf";
+ foreach ($file, "$file-4", $xorg) {
+ if (-l $_) {
+ unlink $_;
+ } else {
+ rename $_, "$_.old"; #- there won't be any XF86Config-4 anymore, we want this!
+ }
+ }
+ symlinkf 'XF86Config', $xorg;
}
Xconfig::parse::write_XF86Config($raw_X, $file);
}