diff options
author | Thierry Vignaud <tv@mandriva.org> | 2009-04-17 15:50:13 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2009-04-17 15:50:13 +0000 |
commit | 504cae029a9341bd9437153a6e7478fea4465e61 (patch) | |
tree | 1d62884c37998ef8b75a86e3bff2ac31f61a33b1 /control-center | |
parent | 21257ed80a49705cac8d64288ec641708a8e1807 (diff) | |
download | control-center-504cae029a9341bd9437153a6e7478fea4465e61.tar control-center-504cae029a9341bd9437153a6e7478fea4465e61.tar.gz control-center-504cae029a9341bd9437153a6e7478fea4465e61.tar.bz2 control-center-504cae029a9341bd9437153a6e7478fea4465e61.tar.xz control-center-504cae029a9341bd9437153a6e7478fea4465e61.zip |
(load_packages2install,clean_list,run_tool) enable to install missing
tools through /usr/share/mcc/progs.conf (eg: system-printer-config on
live CDs, #49994
Diffstat (limited to 'control-center')
-rwxr-xr-x | control-center | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/control-center b/control-center index e4c738f9..889129dd 100755 --- a/control-center +++ b/control-center @@ -776,12 +776,32 @@ foreach (cat_($conf_file)) { } } +sub load_packages2install() { + my $progs_conf_file = '/usr/share/mcc/progs.conf'; + foreach (cat_($progs_conf_file)) { + #if (my ($key, $val) = /^USE_WRAPPER_FOR_(.*)=(.*)/) { + if (my ($key, $val) = /^INSTALL_FOR_(.*)=(.*)/) { + $key =~ s/_/ /g; + # we'll use gurpmi in order to install missing packages if needed; + $programs{$key}{packages2install} = $val if $val; + } else { + warn "bogus line in $conf_file: $_\n"; + next; + } + } +} + sub clean_list { my ($subtree) = @_; grep { my $stuff = $_; my $exec = first(split /\s+/, $programs{$stuff}{binary}); my $is_present = -x $exec; + if (!$is_present && $programs{$stuff}{packages2install}) { + $is_present = 1; + # override missing icon: + $programs{$stuff}{icon} = 'installremoverpm'; + } # do not complain about missing entries in move: warn qq("$exec" is not executable [$stuff]) if $mdk_rel !~ /Move/ && !$is_present && !$programs{$stuff}{disabled}; !$programs{$stuff}{hidden} && $is_present && !$programs{$stuff}{disabled}; @@ -814,6 +834,7 @@ sub build_widget_element { } sub build_list() { + load_packages2install(); my $i; foreach (@tree) { my ($text, $icon, $help, $subtrees) = @$_; @@ -1163,8 +1184,14 @@ sub run_tool { $application_driven_menu = $tool->{application_driven_menu}; return if $tool_pids{$label}; if (! -x first(split /\s+/, $exec)) { - splash_warning(N("cannot fork and exec \"%s\" since it is not executable", $exec)); - return; + if ($tool->{packages2install}) { + # gurpmi doesn't support being embedded yet: + $gtkplug = -1; + $exec = join(' ', "$bindir/gurpmi", split(/\s/, $tool->{packages2install})); + } else { + splash_warning(N("cannot fork and exec \"%s\" since it is not executable", $exec)); + return; + } } $exec .= " --summary" if $option_values{expert_wizard} && $exec =~ /drakwizard/; my $embedded = $gtkplug != -1; # not "explicitely not embedded" |