[yast-commit] r56607 - in /trunk/tv: package/yast2-tv.changes src/Tv.ycp
Author: lslezak Date: Fri Apr 3 11:54:46 2009 New Revision: 56607 URL: http://svn.opensuse.org/viewcvs/yast?rev=56607&view=rev Log: - Do not try installing unavailable packages (TV applications) (bnc #480179) Modified: trunk/tv/package/yast2-tv.changes trunk/tv/src/Tv.ycp Modified: trunk/tv/package/yast2-tv.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/tv/package/yast2-tv.changes?rev=56607&r1=56606&r2=56607&view=diff ============================================================================== --- trunk/tv/package/yast2-tv.changes (original) +++ trunk/tv/package/yast2-tv.changes Fri Apr 3 11:54:46 2009 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Fri Apr 3 10:02:21 CEST 2009 - lslezak@suse.cz + +- Do not try installing unavailable packages (TV applications) + (bnc #480179) + +------------------------------------------------------------------- Thu Mar 26 08:20:36 CET 2009 - lslezak@suse.cz - Use /etc/modprobe.d/50-tv.conf config file instead of Modified: trunk/tv/src/Tv.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/tv/src/Tv.ycp?rev=56607&r1=56606&r2=56607&view=diff ============================================================================== --- trunk/tv/src/Tv.ycp (original) +++ trunk/tv/src/Tv.ycp Fri Apr 3 11:54:46 2009 @@ -317,7 +317,7 @@ * @param apps list of applications to install * @param text text to show in dialog */ - define void InstallApplication (list apps, string text) ``{ + define void InstallApplication (list<string> apps, string text) ``{ any ret = `ok; @@ -346,22 +346,15 @@ if (ret == `ok) { - list<string> to_install = []; - // check if packages are avialable... - foreach (string app, (list<string>) apps, ``{ - if (Package::Available (app)) - to_install = add (to_install, app); - }); - if (ConfirmPackages()) { // display a confirmation dialog - Package::InstallAll(to_install); + Package::InstallAll(apps); } else { // do not ask the user, install the packages immediately - Package::DoInstall(to_install); + Package::DoInstall(apps); } } } @@ -3590,35 +3583,48 @@ y2milestone("Detected TV card: %1, Radio card: %2", tv, radio); - if (Package::Installed ("gnome-panel")) - tv_app = "motv"; - else if (Package::Installed("kdelibs3") || Package::Installed("kdelibs4")) - tv_app = "kdetv"; + list<string> apps = [ ]; + boolean kde = Package::Installed("kdelibs3") || Package::Installed("kdelibs4"); - boolean tv_app_installed = Package::Installed (tv_app); - boolean radio_app_installed = Package::Installed ("kradio"); - list<string> apps = [ tv_app ]; - - if (!Package::Installed("alevt")) + if (tv) { - apps = add(apps, "alevt"); + if (Package::Installed ("gnome-panel")) + tv_app = "motv"; + else if (kde) + { + tv_app = "kdetv"; + } + + if (!Package::Installed(tv_app) && Package::Available(tv_app) == true) + { + apps = add(apps, tv_app); + } + + if (!Package::Installed("alevt") && Package::Available("alevt") == true) + { + apps = add(apps, "alevt"); + } + + if (!Package::Installed("nxtvepg") && Package::Available("nxtvepg") == true) + { + apps = add(apps, "nxtvepg"); + } + + y2milestone("TV packages to install: %1", apps); } - if (!Package::Installed("nxtvepg")) + if (radio && kde && !Package::Installed("kradio") && Package::Available("kradio") == true) { - apps = add(apps, "nxtvepg"); + y2milestone("Adding kradio to the package list"); + apps = add(apps, "kradio"); } - y2milestone("TV application: %1, installed: %2", tv_app, tv_app_installed); - y2milestone("Radio applications installed: %1", radio_app_installed); - y2milestone("Applications to install: %1", apps); + y2milestone("Packages to install: %1", apps); - // do not propose kradio application if we have not KDE - if (radio && tv && !tv_app_installed && !radio_app_installed && - tv_app == "kdetv") + // installing radio and TV applications + if (contains(apps, "kradio") && size(apps) > 1) { // Popup text (required application are %1): - apps = add (apps, "kradio"); InstallApplication (apps, sformat(_("<p>To enable you to watch TV and listen to radio on your computer,<br> these packages should be installed:<br> <b>%1</b><br> @@ -3626,7 +3632,8 @@ </p> "), mergestring (apps, ", "))); } - else if (tv && !tv_app_installed) + // installing only TV applications + else if (!contains(apps, "kradio") && size(apps) > 0) { // Popup text (required application are %1): InstallApplication (apps, sformat(_("<p>To enable you to watch TV on your computer,<br> @@ -3636,7 +3643,8 @@ </p> "), mergestring (apps, ", "))); } - else if (radio && !radio_app_installed && tv_app == "kdetv") + // installing only radio application + else if (apps == ["kradio"]) { // Popup text (required application is %1): InstallApplication (["kradio"], sformat (_("<p>To listen to radio on your computer, you can use the <b>%1</b> application. -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
lslezak@svn.opensuse.org