summaryrefslogtreecommitdiffstats
path: root/perl-install/Xconfig
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-03-18 12:43:55 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-03-18 12:43:55 +0000
commit7e96658a6ee2cf87bec3b5b4abf68b229d08a735 (patch)
tree851b1302aff2cda34a501156549e55b372b71cba /perl-install/Xconfig
parentd51a127f66d66a0fe0bc4cf7c0aa1df57c0234ff (diff)
downloaddrakx-7e96658a6ee2cf87bec3b5b4abf68b229d08a735.tar
drakx-7e96658a6ee2cf87bec3b5b4abf68b229d08a735.tar.gz
drakx-7e96658a6ee2cf87bec3b5b4abf68b229d08a735.tar.bz2
drakx-7e96658a6ee2cf87bec3b5b4abf68b229d08a735.tar.xz
drakx-7e96658a6ee2cf87bec3b5b4abf68b229d08a735.zip
instead of having xorg.conf symlinked to XF86Config, do the contrary
Diffstat (limited to 'perl-install/Xconfig')
-rw-r--r--perl-install/Xconfig/xfree.pm17
1 files changed, 10 insertions, 7 deletions
diff --git a/perl-install/Xconfig/xfree.pm b/perl-install/Xconfig/xfree.pm
index b621393aa..4499dcb3e 100644
--- a/perl-install/Xconfig/xfree.pm
+++ b/perl-install/Xconfig/xfree.pm
@@ -12,13 +12,16 @@ sub new {
bless $val, $class;
}
+sub _conf_files() {
+ map { "$::prefix/etc/X11/$_" } 'xorg.conf', 'XF86Config-4', 'XF86Config';
+}
+
################################################################################
# I/O ##########################################################################
################################################################################
sub read {
my ($class) = @_;
- my @files = map { "$::prefix/etc/X11/$_" } 'xorg.conf', 'XF86Config-4', 'XF86Config';
- my $file = (find { -f $_ && ! -l $_ } @files) || (find { -f $_ } @files);
+ my $file = find { -f $_ } _conf_files();
my $raw_X = $class->new(Xconfig::parse::read_XF86Config($file));
if (my ($Keyboard) = $raw_X->get_InputDevices('Keyboard')) {
@@ -28,17 +31,17 @@ sub read {
}
sub write {
my ($raw_X, $o_file) = @_;
- my $file = $o_file || "$::prefix/etc/X11/XF86Config";
+ my $file = $o_file || first(_conf_files());
if (!$o_file) {
- my $xorg = "$::prefix/etc/X11/xorg.conf";
- foreach ($file, "$file-4", $xorg) {
+ foreach (_conf_files()) {
if (-l $_) {
unlink $_;
} else {
- rename $_, "$_.old"; #- there will not be any XF86Config-4 anymore, we want this!
+ rename $_, "$_.old"; #- there will not be any XF86Config nor XF86Config-4 anymore, we want this!
}
}
- symlinkf 'XF86Config', $xorg;
+ #- keep it for old programs still using this name
+ symlink basename($file), "$::prefix/etc/X11/XF86Config";
}
Xconfig::parse::write_XF86Config($raw_X, $file);
}