[yast-commit] r40693 - in /trunk/yast2: ./ data/ library/gpg/ library/gpg/doc/ library/gpg/doc/autodocs/ library/gpg/src/ library/gpg/testsuite/ library/packages/src/ library/system/src/ package/
Author: lslezak Date: Mon Sep 3 13:24:29 2007 New Revision: 40693 URL: http://svn.opensuse.org/viewcvs/yast?rev=40693&view=rev Log: - added fallback for "kernel-iseries64" - use "kernel-ppc64", when it's not available (#302246) - properly check whether a kernel package is available (use package name instead of 'provides' capability), fixed check in 'repair' mode (#302246, #299683) - added Package::PackageAvailable() and Package::PackageInstaled() functions to check whether a package is available or installed (they check package name in contrast to Package::IsAvailable() and Package::IsInstalled() which check 'provides' capability) - 2.15.53 Modified: trunk/yast2/VERSION trunk/yast2/data/ (props changed) trunk/yast2/library/gpg/ (props changed) trunk/yast2/library/gpg/doc/ (props changed) trunk/yast2/library/gpg/doc/autodocs/ (props changed) trunk/yast2/library/gpg/src/ (props changed) trunk/yast2/library/gpg/testsuite/ (props changed) trunk/yast2/library/packages/src/Package.ycp trunk/yast2/library/packages/src/PackageAI.ycp trunk/yast2/library/packages/src/PackageSystem.ycp trunk/yast2/library/system/src/Kernel.ycp trunk/yast2/package/yast2.changes trunk/yast2/yast2.spec.in Modified: trunk/yast2/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/VERSION?rev=40693&r1=40692&r2=40693&view=diff ============================================================================== --- trunk/yast2/VERSION (original) +++ trunk/yast2/VERSION Mon Sep 3 13:24:29 2007 @@ -1 +1 @@ -2.15.52 +2.15.53 Modified: trunk/yast2/library/packages/src/Package.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/library/packages/src/Package.ycp?rev=40693&r1=40692&r2=40693&view=diff ============================================================================== --- trunk/yast2/library/packages/src/Package.ycp (original) +++ trunk/yast2/library/packages/src/Package.ycp Mon Sep 3 13:24:29 2007 @@ -32,6 +32,8 @@ "Available" : PackageSystem::Available, "Installed" : PackageSystem::Installed, "InstallKernel" : PackageSystem::InstallKernel, + "PackageInstalled" : PackageSystem::PackageInstalled, + "PackageAvailable" : PackageSystem::PackageAvailable, ]; map FunctionsAI = $[ @@ -41,6 +43,8 @@ "Available" : PackageAI::Available, "Installed" : PackageAI::Installed, "InstallKernel" : PackageAI::InstallKernel, + "PackageInstalled" : PackageAI::PackageInstalled, + "PackageAvailable" : PackageAI::PackageAvailable, ]; map Functions = Mode::config () ? FunctionsAI : FunctionsSystem; @@ -90,6 +94,16 @@ return function(package); } +global boolean PackageAvailable(string package) { + boolean (string) function = (boolean (string)) (Functions["PackageAvailable"]:nil); + return function(package); +} + +global boolean PackageInstalled(string package) { + boolean (string) function = (boolean (string)) (Functions["PackageInstalled"]:nil); + return function(package); +} + global boolean InstallKernel (list<string> kernel_modules) { boolean (list<string>) function = (boolean (list<string>)) (Functions["InstallKernel"]:nil); return function(kernel_modules); Modified: trunk/yast2/library/packages/src/PackageAI.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/library/packages/src/PackageAI.ycp?rev=40693&r1=40692&r2=40693&view=diff ============================================================================== --- trunk/yast2/library/packages/src/PackageAI.ycp (original) +++ trunk/yast2/library/packages/src/PackageAI.ycp Mon Sep 3 13:24:29 2007 @@ -73,6 +73,24 @@ return contains(toinstall, package); } +/** + * Is a package installed? Checks only the package name in contrast to Installed() function. + * @return true if yes + */ +global boolean PackageInstalled(string package) { + return Installed(package); +} + +/** + * Is a package available? Checks only package name, not list of provides. + * @return true if yes + */ +global boolean PackageAvailable(string package) +{ + return Available(package); +} + + global boolean InstallKernel (list<string> kernel_modules) { // TODO: for 9.2, we always install all packages, but // we could only install those really needed (#44394) Modified: trunk/yast2/library/packages/src/PackageSystem.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/library/packages/src/PackageSystem.ycp?rev=40693&r1=40692&r2=40693&view=diff ============================================================================== --- trunk/yast2/library/packages/src/PackageSystem.ycp (original) +++ trunk/yast2/library/packages/src/PackageSystem.ycp Mon Sep 3 13:24:29 2007 @@ -257,7 +257,7 @@ } /** - * Is a package installed? + * Is a package provided in the system? Is there any installed package providing 'package'? * @return true if yes */ global boolean Installed(string package) { @@ -272,6 +272,35 @@ } /** + * Is a package installed? Checks only the package name in contrast to Installed() function. + * @return true if yes + */ +global boolean PackageInstalled(string package) { + // This is commonly called function and so it's + // important that it's fast, especially in the common + // case, where all dependencies are satisfied. + // Unfortunately, initializing Pkg reads the RPM database... + // so we must avoid it. + return 0 == (integer) SCR::Execute(.target.bash, "rpm -q " + package); +} + +/** + * Is a package available? Checks only package name, not list of provides. + * @return true if yes (nil = no package source available) + */ +global boolean PackageAvailable(string package) { + EnsureSourceInit(); + + if (!source_initialized) + { + // error no source initialized + return nil; + } + + return Pkg::PkgAvailable(package); +} + +/** * @short Check if packages are installed * @descr Install them if they are not and user approves installation * Modified: trunk/yast2/library/system/src/Kernel.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/library/system/src/Kernel.ycp?rev=40693&r1=40692&r2=40693&view=diff ============================================================================== --- trunk/yast2/library/system/src/Kernel.ycp (original) +++ trunk/yast2/library/system/src/Kernel.ycp Mon Sep 3 13:24:29 2007 @@ -90,7 +90,9 @@ * fallback map for kernel */ map<string, string> fallbacks = $[ - "kernel-bigsmp" : "kernel-default" + "kernel-bigsmp" : "kernel-default", + // fallback for PPC (#302246) + "kernel-iseries64" : "kernel-ppc64" ]; void ParseInstallationKernelCmdline (); @@ -394,7 +396,7 @@ // install bigsmp kernel regardless the memory size - fate #159006 if (/*memsize >= fourGB &&*/ contains (cpuflags, "pae")) { - y2milestone ("Kernel switch: mem >= 4GB && PAE"); + y2milestone ("Kernel switch: PAE detected"); kernel_packages = ["kernel-bigsmp"]; // add PV drivers @@ -504,9 +506,9 @@ y2milestone ("Selecting '%1' as kernel package", the_kernel); // Check for provided kernel packages in installed system - if (Mode::normal ()) + if (Mode::normal () || Mode::repair()) { - while (the_kernel != "" && !Pkg::IsProvided (the_kernel)) + while (the_kernel != "" && !Pkg::PkgInstalled(the_kernel)) { the_kernel = fallbacks[the_kernel]:""; y2milestone ("Not provided, falling back to '%1'", the_kernel); @@ -516,7 +518,7 @@ // Check for available kernel packages during installation (instsys) else { - while (the_kernel != "" && !Pkg::IsAvailable (the_kernel)) + while (the_kernel != "" && !Pkg::PkgAvailable(the_kernel)) { the_kernel = fallbacks[the_kernel]:""; y2milestone ("Not available, falling back to '%1'", the_kernel); Modified: trunk/yast2/package/yast2.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/package/yast2.changes?rev=40693&r1=40692&r2=40693&view=diff ============================================================================== --- trunk/yast2/package/yast2.changes (original) +++ trunk/yast2/package/yast2.changes Mon Sep 3 13:24:29 2007 @@ -1,4 +1,18 @@ ------------------------------------------------------------------- +Mon Sep 3 13:08:17 CEST 2007 - lslezak@suse.cz + +- added fallback for "kernel-iseries64" - use "kernel-ppc64", + when it's not available (#302246) +- properly check whether a kernel package is available (use package + name instead of 'provides' capability), fixed check in 'repair' + mode (#302246, #299683) +- added Package::PackageAvailable() and Package::PackageInstaled() + functions to check whether a package is available or installed + (they check package name in contrast to Package::IsAvailable() + and Package::IsInstalled() which check 'provides' capability) +- 2.15.53 + +------------------------------------------------------------------- Mon Sep 3 08:24:32 CEST 2007 - mvidner@suse.cz - Use xmessage only if y2base fails. Don't use it for harmless Modified: trunk/yast2/yast2.spec.in URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/yast2.spec.in?rev=40693&r1=40692&r2=40693&view=diff ============================================================================== --- trunk/yast2/yast2.spec.in (original) +++ trunk/yast2/yast2.spec.in Mon Sep 3 13:24:29 2007 @@ -6,8 +6,8 @@ BuildRequires: perl-XML-Writer update-desktop-files yast2-devtools yast2-pkg-bindings yast2-testsuite yast2-perl-bindings # SCR::RegisterNewAgents() Requires: yast2-core >= 2.15.4 -# Pkg::CallbackInitDownload() -Requires: yast2-pkg-bindings >= 2.15.39 +# Pkg::PkgAvailable() and Pkg::PkgInstalled() +Requires: yast2-pkg-bindings >= 2.15.47 Requires: yast2_ui yast2_theme # For Cron Agent, Module Requires: perl-Config-Crontab -- 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