[yast-commit] r41580 - in /trunk/sound: VERSION data/Makefile.am data/alsa_packages.ycp package/yast2-sound.changes sound/src/Sound.ycp sound/src/complex.ycp sound/src/sound_write.ycp sound/src/wizards.ycp
Author: lslezak
Date: Fri Oct 26 10:36:17 2007
New Revision: 41580
URL: http://svn.opensuse.org/viewcvs/yast?rev=41580&view=rev
Log:
- added package DB, install packages required by the configured
driver (#329690)
- 2.16.0
Added:
trunk/sound/data/alsa_packages.ycp
Modified:
trunk/sound/VERSION
trunk/sound/data/Makefile.am
trunk/sound/package/yast2-sound.changes
trunk/sound/sound/src/Sound.ycp
trunk/sound/sound/src/complex.ycp
trunk/sound/sound/src/sound_write.ycp
trunk/sound/sound/src/wizards.ycp
Modified: trunk/sound/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/sound/VERSION?rev=41580&r1=41579&r2=41580&view=diff
==============================================================================
--- trunk/sound/VERSION (original)
+++ trunk/sound/VERSION Fri Oct 26 10:36:17 2007
@@ -1 +1 @@
-2.15.11
+2.16.0
Modified: trunk/sound/data/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/sound/data/Makefile.am?rev=41580&r1=41579&r2=41580&view=diff
==============================================================================
--- trunk/sound/data/Makefile.am (original)
+++ trunk/sound/data/Makefile.am Fri Oct 26 10:36:17 2007
@@ -6,6 +6,6 @@
SUBDIRS = addons doc include src
-ydata_DATA = sndcards.ycp
+ydata_DATA = sndcards.ycp alsa_packages.ycp
EXTRA_DIST = $(ydata_DATA) Makefile.generate
Added: trunk/sound/data/alsa_packages.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/sound/data/alsa_packages.ycp?rev=41580&view=auto
==============================================================================
--- trunk/sound/data/alsa_packages.ycp (added)
+++ trunk/sound/data/alsa_packages.ycp Fri Oct 26 10:36:17 2007
@@ -0,0 +1,41 @@
+
+
+// This is a mapping for required packages
+// some devices need a firmware or a special tool to work properly
+
+{
+ return
+ $[
+ // "driver name" : [ list of required packages ]
+
+ "snd-ymfpci" : [ "alsa-firmware" ],
+ "snd-maestro3" : [ "alsa-firmware" ],
+ "snd-darla20" : [ "alsa-firmware" ],
+ "snd-darla24" : [ "alsa-firmware" ],
+ "snd-echo3g" : [ "alsa-firmware" ],
+ "snd-gina20" : [ "alsa-firmware" ],
+ "snd-gina24" : [ "alsa-firmware" ],
+ "snd-indigodj" : [ "alsa-firmware" ],
+ "snd-indigoio" : [ "alsa-firmware" ],
+ "snd-indigo" : [ "alsa-firmware" ],
+ "snd-layla20" : [ "alsa-firmware" ],
+ "snd-layla24" : [ "alsa-firmware" ],
+ "snd-mia" : [ "alsa-firmware" ],
+ "snd-monoa" : [ "alsa-firmware" ],
+ "snd-mixart" : [ "alsa-firmware" ],
+ "snd-emu10k1" : [ "alsa-firmware", "awesfx" ],
+ "snd-sb16" : [ "alsa-firmware", "alsa-tools" ],
+ "snb-sbawe" : [ "alsa-firmware", "alsa-tools", "awesfx" ],
+ "snd-wavefront": [ "alsa-firmware" ],
+ "snd-pcxhr" : [ "alsa-firmware" ],
+ "snd-hdsp" : [ "alsa-firmware" ],
+ "snd-korg1212" : [ "alsa-firmware" ],
+ "snd-vx222" : [ "alsa-firmware" ],
+ "snd-sscape" : [ "alsa-tools" ],
+
+ // The below are for hotplugged devices, so usually YaST is not involed
+ "snd-vxpocket" : [ "alsa-firmware" ],
+ "snd-usb-usx2y" : [ "alsa-firmware", "alsa-tools" ],
+
+ ];
+}
Modified: trunk/sound/package/yast2-sound.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/sound/package/yast2-sound.changes?rev=41580&r1=41579&r2=41580&view=diff
==============================================================================
--- trunk/sound/package/yast2-sound.changes (original)
+++ trunk/sound/package/yast2-sound.changes Fri Oct 26 10:36:17 2007
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Fri Oct 26 10:27:16 CEST 2007 - lslezak@suse.cz
+
+- added package DB, install packages required by the configured
+ driver (#329690)
+- 2.16.0
+
+-------------------------------------------------------------------
Thu Aug 30 09:03:05 CEST 2007 - lslezak@suse.cz
- support for PS3 sound card (automatic configuration) (#305927)
Modified: trunk/sound/sound/src/Sound.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/sound/sound/src/Sound.ycp?rev=41580&r1=41579&r2=41580&view=diff
==============================================================================
--- trunk/sound/sound/src/Sound.ycp (original)
+++ trunk/sound/sound/src/Sound.ycp Fri Oct 26 10:36:17 2007
@@ -19,6 +19,7 @@
import "Progress";
import "Label";
import "String";
+ import "Package";
/**
* what sound system we're using (true=alsa, false=oss)
@@ -115,6 +116,8 @@
*/
global map db_module_index = nil;
+ global map db_packages = nil;
+
/**
* flag for showing/not showing ui stuff (eg when loading alsa database)
*/
@@ -652,6 +655,55 @@
}
/**
+ * opens alsa sound cards database
+ * @return void
+ */
+ global void LoadPackageDatabase()
+ {
+ y2milestone("Reading required packages database...");
+ db_packages = (map)eval(SCR::Read (.target.yast2, "alsa_packages.ycp"));
+ y2milestone("Loaded package list for %1 drivers", size(db_packages));
+ }
+
+ global list<string> RequiredPackages(string driver)
+ {
+ if (db_packages == nil)
+ {
+ LoadPackageDatabase();
+ }
+
+ list<string> ret = db_packages[driver]:[];
+ y2milestone("Driver %1 requires packages: %2", driver, ret);
+
+ return ret;
+ }
+
+ global list<string> RequiredPackagesToInstall(string driver)
+ {
+ list<string> req_pkgs = RequiredPackages(driver);
+ req_pkgs = filter(string pkg, req_pkgs, {return !Package::PackageInstalled(pkg);});
+
+ y2milestone("Required packages to install for driver %1: %2", driver, req_pkgs);
+ return req_pkgs;
+ }
+
+ global string RequiredPackagesToInstallSummary(string driver)
+ {
+ list<string> req_pkgs = RequiredPackagesToInstall(driver);
+ string pkg_summary = "";
+
+ if (size(req_pkgs) > 0)
+ {
+ // summary string, %1 is a list of packages
+ pkg_summary = sformat(_("Required packages to install: %1"),
+ // separator for constructing package list
+ mergestring(req_pkgs, _(", ")));
+ }
+
+ return pkg_summary;
+ }
+
+ /**
* Read all sound settings from the SCR
* @param interactive if user could be asked for actions
* (currently only for detecting with alsaconf)
@@ -902,6 +954,25 @@
return mods;
}
+
+ global boolean AllRequiredPackagesInstalled()
+ {
+ list<string> all_mods = RequiredKernelModules();
+ boolean ret = true;
+
+ foreach(string mod, all_mods,
+ {
+ if (size(RequiredPackagesToInstall(mod)) > 0)
+ {
+ ret = false;
+ }
+ }
+ );
+
+ y2milestone("All required packages are installed: %1", ret);
+ return ret;
+ }
+
/**
* Update the SCR according to sound settings
* @return boolean True on success
@@ -925,11 +996,20 @@
list keys = maplist (map card, modules_conf, ``(
card["unique_key"]:"..."));
- list<string> retlist = maplist (map card, modules_conf, ``(
- Summary::Device (card["model"]:"Sound card",
- // summary text: '(sound card is) Configured as snd-card-1'
- sformat(_("Configured as %1."), card["alias"]:"snd-card-0"))
- ));
+ list<string> retlist = maplist (map card, modules_conf,
+ {
+ string package_summary = RequiredPackagesToInstallSummary(card["module"]:"");
+
+ if (package_summary != "")
+ {
+ package_summary = "<BR>" + package_summary;
+ }
+
+ Summary::Device (card["model"]:"Sound card",
+ // summary text: '(sound card is) Configured as snd-card-1'
+ sformat(_("Configured as %1."), card["alias"]:"snd-card-0") + package_summary);
+ }
+ );
if (detected_cards != nil)
{
Modified: trunk/sound/sound/src/complex.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/sound/sound/src/complex.ycp?rev=41580&r1=41579&r2=41580&view=diff
==============================================================================
--- trunk/sound/sound/src/complex.ycp (original)
+++ trunk/sound/sound/src/complex.ycp Fri Oct 26 10:36:17 2007
@@ -64,6 +64,13 @@
descr = add(descr, sformat(_("Driver %1"), card["module"]:""));
}
+ string pkgs = Sound::RequiredPackagesToInstallSummary(card["module"]:"");
+
+ if (size(pkgs) > 0)
+ {
+ descr = add(descr, pkgs);
+ }
+
map
participants (1)
-
lslezak@svn.opensuse.org