summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2009-04-17 15:50:13 +0000
committerThierry Vignaud <tv@mandriva.org>2009-04-17 15:50:13 +0000
commit504cae029a9341bd9437153a6e7478fea4465e61 (patch)
tree1d62884c37998ef8b75a86e3bff2ac31f61a33b1
parent21257ed80a49705cac8d64288ec641708a8e1807 (diff)
downloadcontrol-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
-rw-r--r--Makefile1
-rw-r--r--NEWS2
-rwxr-xr-xcontrol-center31
-rw-r--r--progs.conf62
4 files changed, 94 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 4d2262ce..8914fd4d 100644
--- a/Makefile
+++ b/Makefile
@@ -41,6 +41,7 @@ install: all
./generate-conf-file.pl
mkdir -p $(SYSCONFDIR)
install -m 644 mcc.conf $(SYSCONFDIR)
+ install -m 644 progs.conf $(mcc_dir)/
dis: clean
rm -rf $(NAME)-$(VERSION) ../$(NAME)-$(VERSION).tar*
diff --git a/NEWS b/NEWS
index 9e9b83fc..dc811ded 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,6 @@
- fix swedish translation (#49990)
+- enable to install missing tools through /usr/share/mcc/progs.conf
+ (eg: system-printer-config on live CDs, #49994)
Version 12.9 - 15 April 2009, Thierry Vignaud
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"
diff --git a/progs.conf b/progs.conf
new file mode 100644
index 00000000..30a1bf36
--- /dev/null
+++ b/progs.conf
@@ -0,0 +1,62 @@
+INSTALL_FOR_3D=
+INSTALL_FOR_Access_Windows_shares=
+INSTALL_FOR_Add_Connection=
+INSTALL_FOR_Authentication=
+INSTALL_FOR_Auto_Install=
+INSTALL_FOR_Auto_login_Config=
+INSTALL_FOR_Backups=
+INSTALL_FOR_Boot_Config=
+INSTALL_FOR_Boot_Disk=
+INSTALL_FOR_Boot_Theme=
+INSTALL_FOR_Configure_Internet=
+INSTALL_FOR_Connection_Sharing=
+INSTALL_FOR_Console=
+INSTALL_FOR_Date_&_Time=
+INSTALL_FOR_Display_Manager_chooser=
+INSTALL_FOR_Fax=
+INSTALL_FOR_Firewall=
+INSTALL_FOR_Fonts=
+INSTALL_FOR_Graphical_server_configuration=
+INSTALL_FOR_Hard_Drives=
+INSTALL_FOR_Hardware_List=
+INSTALL_FOR_Hosts=
+INSTALL_FOR_Install_Software=rpmdrake
+INSTALL_FOR_Invictus_Firewall=
+INSTALL_FOR_Keyboard=
+INSTALL_FOR_Kolab=
+INSTALL_FOR_Localization=
+INSTALL_FOR_Logs=
+INSTALL_FOR_Manage_Connection=
+INSTALL_FOR_Manage_park=
+INSTALL_FOR_Mandriva_Online=
+INSTALL_FOR_Mandriva_Update=
+INSTALL_FOR_Menus=
+INSTALL_FOR_Migration=
+INSTALL_FOR_Monitor_Connection=
+INSTALL_FOR_Mouse=
+INSTALL_FOR_NFS_exports=
+INSTALL_FOR_NFS_mount_points=
+INSTALL_FOR_Network_Center=
+INSTALL_FOR_Network_Profiles=
+INSTALL_FOR_Package_stats=
+INSTALL_FOR_Parental_Controls=
+INSTALL_FOR_Partition_Sharing=
+INSTALL_FOR_Printer=system-config-printer
+INSTALL_FOR_Programs_scheduling=
+INSTALL_FOR_Proxy_Configuration=
+INSTALL_FOR_Remote_Control=
+INSTALL_FOR_Remove_Interface=
+INSTALL_FOR_Roaming=
+INSTALL_FOR_Samba_configuration=
+INSTALL_FOR_Scanner=
+INSTALL_FOR_Security_Level=
+INSTALL_FOR_Security_Permissions=
+INSTALL_FOR_Services=
+INSTALL_FOR_Snapshots=draksnapshot
+INSTALL_FOR_Software_Media_Manager=rpmdrake
+INSTALL_FOR_Sound=
+INSTALL_FOR_UPS=
+INSTALL_FOR_Users=
+INSTALL_FOR_VPN=
+INSTALL_FOR_Virtualization=
+INSTALL_FOR_WebDAV_mount_points=