Mailinglist Archive: yast-commit (535 mails)

< Previous Next >
[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
  • From: lslezak@xxxxxxxxxxxxxxxx
  • Date: Fri, 26 Oct 2007 08:36:17 -0000
  • Message-id: <20071026083617.9383E17319@xxxxxxxxxxxxxxxx>
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@xxxxxxx
+
+- added package DB, install packages required by the configured
+ driver (#329690)
+- 2.16.0
+
+-------------------------------------------------------------------
Thu Aug 30 09:03:05 CEST 2007 - lslezak@xxxxxxx

- 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<string,any> r = $[
"id" : card["unique_key"]:"",
"table_descr" : [ card["options","index"]:"",
card["model"]:"" ],

Modified: trunk/sound/sound/src/sound_write.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/sound/sound/src/sound_write.ycp?rev=41580&r1=41579&r2=41580&view=diff
==============================================================================
--- trunk/sound/sound/src/sound_write.ycp (original)
+++ trunk/sound/sound/src/sound_write.ycp Fri Oct 26 10:36:17 2007
@@ -72,6 +72,7 @@
import "Service";
import "Package";
import "Mode";
+ import "Report";

import "Sound";
import "Joystick";
@@ -83,6 +84,49 @@
y2milestone("asound size: %1", SCR::Read(.target.size,
"/etc/asound.state"));
}

+ define boolean install_packages(list<string> modules)
+ {
+ list<string> packages_to_install = [];
+
+ foreach(string driver, modules,
+ {
+ list<string> req_packages =
Sound::RequiredPackagesToInstall(driver);
+ packages_to_install = (list<string>)union(packages_to_install,
req_packages);
+ }
+ );
+
+ y2milestone("Collected packages to install: %1", packages_to_install);
+
+ if (size(packages_to_install) > 0)
+ {
+ list<string> not_available = [];
+
+ foreach(string pkg, packages_to_install,
+ {
+ boolean avail = Package::Available(pkg);
+
+ if (!avail)
+ {
+ not_available = add(not_available, pkg);
+ }
+ }
+ );
+
+ if (size(not_available) > 0)
+ {
+ Report::Error(sformat(_("These required packages are not
available: %1
+Some sound device may not work or some features may not be supported.
+
+Enable or add an additional software repository containing the packages."),
mergestring(not_available, ", ")));
+ return false;
+ }
+
+ return Package::InstallAll(packages_to_install);
+ }
+
+ return true;
+ }
+
// ==== MAIN ====

map settings = (map) WFM::Args(0);
@@ -98,6 +142,8 @@
return true;
}

+ boolean install = !Sound::AllRequiredPackagesInstalled();
+
list<string> stones = [
// progress bar item
_("Save module configuration"),
@@ -110,7 +156,8 @@
// progress bar item
_("Store volume"),
// progress bar item
- _("Store joystick settings")];
+ _("Store joystick settings")
+ ];

list<string> stones2 = [
// progress bar item
@@ -124,7 +171,17 @@
// progress bar item
_("Storing volume settings..."),
// progress bar item
- _("Storing joystick settings...")];
+ _("Storing joystick settings..."),
+ ];
+
+ if (install)
+ {
+ // progress bar item
+ stones = add(stones, _("Install required packages"));
+
+ // progress bar item
+ stones2 = add(stones2, _("Installing required packages..."));
+ }


// not really necessary for Progress stuf (it is set off in _auto client)
@@ -235,6 +292,12 @@
// write joystick configuration
Joystick::Write (abort_block);

+ if (install)
+ {
+ Progress::NextStage();
+ install_packages(reqmodules);
+ }
+
if (size(configuredcards) > 0)
{
// enable alsasound service in runlevels 2,3,5

Modified: trunk/sound/sound/src/wizards.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/sound/sound/src/wizards.ycp?rev=41580&r1=41579&r2=41580&view=diff
==============================================================================
--- trunk/sound/sound/src/wizards.ycp (original)
+++ trunk/sound/sound/src/wizards.ycp Fri Oct 26 10:36:17 2007
@@ -327,10 +327,15 @@

if (ui == `finish && !Mode::config())
{
- if (!Sound::installation && ( Sound::Changed() || Sound::GetModified()
|| Joystick::Changed()))
+ if ((!Sound::installation) && ( Sound::Changed() ||
Sound::GetModified() || Joystick::Changed()
+ || (!Sound::AllRequiredPackagesInstalled())))
{
Sound::Write ();
}
+ else
+ {
+ y2milestone("Not writing the configuration");
+ }
}

UI::CloseDialog ();

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages