Author: lslezak Date: Wed Apr 23 13:19:48 2008 New Revision: 46978 URL: http://svn.opensuse.org/viewcvs/yast?rev=46978&view=rev Log: - PackageSystem.ycp - do not initialize the package callbacks, they are already initialized in PackageCallbacks constructor - Product.ycp - do not initialize the package manager, read the installed product from /etc/SuSE-relase file instead (bnc#380652) - 2.16.55 Modified: trunk/yast2/VERSION trunk/yast2/library/modules/SuSERelease.ycp trunk/yast2/library/packages/src/PackageSystem.ycp trunk/yast2/library/packages/src/Product.ycp trunk/yast2/package/yast2.changes Modified: trunk/yast2/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/VERSION?rev=46978&r1=46977&r2=46978&view=diff ============================================================================== --- trunk/yast2/VERSION (original) +++ trunk/yast2/VERSION Wed Apr 23 13:19:48 2008 @@ -1 +1 @@ -2.16.54 +2.16.55 Modified: trunk/yast2/library/modules/SuSERelease.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/library/modules/SuSERelease.ycp?rev=46978&r1=46977&r2=46978&view=diff ============================================================================== --- trunk/yast2/library/modules/SuSERelease.ycp (original) +++ trunk/yast2/library/modules/SuSERelease.ycp Wed Apr 23 13:19:48 2008 @@ -78,7 +78,6 @@ * @return string the release information */ global string ReleaseName () { -{ if (Stage::initial ()) { return (string)SCR::Read (.content.PRODUCT); @@ -108,6 +107,40 @@ } } +/** + * Get information about the release + * Is limited for the currently running product + * @param directory containing the installed system (/ in installed system) + * @return string the release information + */ +global string ReleaseVersion() +{ + if (Stage::initial ()) + { + return (string)SCR::Read (.content.VERSION); + } + + string contents = ReleaseFileContents ("/"); + string version = ""; + + if (contents != "?") + { + list<string> lines = splitstring (contents, "\n"); + lines = filter (string l, lines, {return l != "";}); + + list<string> components = splitstring (lines[0]:"", " "); + + foreach(string c, components, + { + if (version == "" && regexpmatch (c, "^[0-9\\.]+$")) + { + version = c; + } + } + ); + } + + return version; } Modified: trunk/yast2/library/packages/src/PackageSystem.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/library/packages/src/PackageSystem.ycp?rev=46978&r1=46977&r2=46978&view=diff ============================================================================== --- trunk/yast2/library/packages/src/PackageSystem.ycp (original) +++ trunk/yast2/library/packages/src/PackageSystem.ycp Wed Apr 23 13:19:48 2008 @@ -55,7 +55,6 @@ */ global void EnsureTargetInit() { PackageLock::Check (); - PackageCallbacks::InitPackageCallbacks (); // always initizalize target, it should be cheap according to #45356 target_initialized = Pkg::TargetInit ("/", false); } @@ -75,8 +74,6 @@ return; } - PackageCallbacks::InitPackageCallbacks (); - if(! target_initialized) { // make sure we have the RPM keys imported Modified: trunk/yast2/library/packages/src/Product.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/library/packages/src/Product.ycp?rev=46978&r1=46977&r2=46978&view=diff ============================================================================== --- trunk/yast2/library/packages/src/Product.ycp (original) +++ trunk/yast2/library/packages/src/Product.ycp Wed Apr 23 13:19:48 2008 @@ -13,8 +13,7 @@ import "Mode"; import "Stage"; - import "PackageLock"; - import "PackageSystem"; + import "SuSERelease"; /** * General product name and version @@ -73,46 +72,6 @@ */ global string shortlabel = ""; -global list