summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-10-01 13:57:30 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-10-01 13:57:30 +0000
commitbd481389539995593b50c849de43ad3a71fac915 (patch)
tree5271e28dc49ab1cd470bcbbd274f587e92ae564e
parentfe68e8f9e418e3bc61d578744525fa7f719e1bf2 (diff)
downloaddrakx-kbd-mouse-x11-bd481389539995593b50c849de43ad3a71fac915.tar
drakx-kbd-mouse-x11-bd481389539995593b50c849de43ad3a71fac915.tar.gz
drakx-kbd-mouse-x11-bd481389539995593b50c849de43ad3a71fac915.tar.bz2
drakx-kbd-mouse-x11-bd481389539995593b50c849de43ad3a71fac915.tar.xz
drakx-kbd-mouse-x11-bd481389539995593b50c849de43ad3a71fac915.zip
- XFdrake:
o explicitly Load or Disable module "dri" (to be independent of Xorg's default choice)
-rw-r--r--NEWS4
-rw-r--r--lib/Xconfig/parse.pm2
-rw-r--r--lib/Xconfig/xfree.pm31
3 files changed, 34 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 2be4c15..0753d66 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+- XFdrake:
+ o explicitly Load or Disable module "dri"
+ (to be independent of Xorg's default choice)
+
Version 0.63 - 30 September 2008
- translations updates
diff --git a/lib/Xconfig/parse.pm b/lib/Xconfig/parse.pm
index 1454b56..9a5ff1c 100644
--- a/lib/Xconfig/parse.pm
+++ b/lib/Xconfig/parse.pm
@@ -153,7 +153,7 @@ my %kind_names = (
WacomEraser => [ qw(Port) ], #-/
ServerLayout => [ qw(Identifier) ],
);
-my @want_string = qw(Identifier DeviceName VendorName ModelName BoardName Driver Device Chipset Monitor Protocol XkbModel XkbLayout XkbOptions XkbCompat Load ModulePath BusID PreferredMode);
+my @want_string = qw(Identifier DeviceName VendorName ModelName BoardName Driver Device Chipset Monitor Protocol XkbModel XkbLayout XkbOptions XkbCompat Load Disable ModulePath BusID PreferredMode);
%kind_names = map_each { lc $::a => [ map { lc } @$::b ] } %kind_names;
@want_string = map { lc } @want_string;
diff --git a/lib/Xconfig/xfree.pm b/lib/Xconfig/xfree.pm
index 6b52ff5..b70948b 100644
--- a/lib/Xconfig/xfree.pm
+++ b/lib/Xconfig/xfree.pm
@@ -493,6 +493,12 @@ sub get_modules {
my $Module = raw_export_section($raw_Module, ['Load']);
@{$Module->{Load} || []};
}
+sub get_disabled_modules {
+ my ($raw_X) = @_;
+ my $raw_Module = $raw_X->get_Section('Module') or return;
+ my $Module = raw_export_section($raw_Module, ['Disable']);
+ @{$Module->{Disable} || []};
+}
sub add_load_module {
my ($raw_X, $module) = @_;
my $raw_Module = $raw_X->get_Section('Module') || $raw_X->add_Section('Module', {});
@@ -509,18 +515,39 @@ sub add_load_module {
comment_on_line => $comment && " # $comment",
} if !member($module, $raw_X->get_modules);
}
+sub add_disable_module {
+ my ($raw_X, $module) = @_;
+ my $raw_Module = $raw_X->get_Section('Module') || $raw_X->add_Section('Module', {});
+
+ push @{$raw_Module->{Disable}}, { val => $module } if !member($module, $raw_X->get_disabled_modules);
+}
sub remove_load_module {
my ($raw_X, $module) = @_;
my $raw_Module = $raw_X->get_Section('Module') or return;
if (my @l = grep { $_->{val} ne $module } @{$raw_Module->{Load}}) {
$raw_Module->{Load} = \@l;
} else {
- $raw_X->remove_Section('Module');
+ delete $raw_Module->{Load};
+ }
+}
+sub remove_disable_module {
+ my ($raw_X, $module) = @_;
+ my $raw_Module = $raw_X->get_Section('Module') or return;
+ if (my @l = grep { $_->{val} ne $module } @{$raw_Module->{Disable}}) {
+ $raw_Module->{Disable} = \@l;
+ } else {
+ delete $raw_Module->{Disable};
}
}
sub set_load_module {
my ($raw_X, $module, $bool) = @_;
- $bool ? add_load_module($raw_X, $module) : remove_load_module($raw_X, $module);
+ if ($bool) {
+ remove_disable_module($raw_X, $module);
+ add_load_module($raw_X, $module);
+ } else {
+ remove_load_module($raw_X, $module);
+ add_disable_module($raw_X, $module);
+ }
}