Author: locilka Date: Thu Apr 10 12:01:58 2008 New Revision: 46329 URL: http://svn.opensuse.org/viewcvs/yast?rev=46329&view=rev Log: - Filtering installation imagesets using the default architecture. Modified: trunk/installation/TODO trunk/installation/package/yast2-installation.changes trunk/installation/src/modules/ImageInstallation.ycp Modified: trunk/installation/TODO URL: http://svn.opensuse.org/viewcvs/yast/trunk/installation/TODO?rev=46329&r... ============================================================================== --- trunk/installation/TODO (original) +++ trunk/installation/TODO Thu Apr 10 12:01:58 2008 @@ -12,8 +12,6 @@ * Bugs? - Fix metadata image (seems not to be used anymore or ignored?) - - Important: filter imagesets according to current architecture - tag <archs> * Missig documentation - Some new tags in control file Modified: trunk/installation/package/yast2-installation.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/installation/package/yast2-instal... ============================================================================== --- trunk/installation/package/yast2-installation.changes (original) +++ trunk/installation/package/yast2-installation.changes Thu Apr 10 12:01:58 2008 @@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Thu Apr 10 12:02:07 CEST 2008 - locilka@suse.cz + +- Filtering installation imagesets using the default architecture. + +------------------------------------------------------------------- Wed Apr 9 16:39:36 CEST 2008 - jsrain@suse.cz - handle compressed logs properly at the end of first stage Modified: trunk/installation/src/modules/ImageInstallation.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/installation/src/modules/ImageIns... ============================================================================== --- trunk/installation/src/modules/ImageInstallation.ycp (original) +++ trunk/installation/src/modules/ImageInstallation.ycp Thu Apr 10 12:01:58 2008 @@ -22,6 +22,7 @@ import "Progress"; import "Report"; import "String"; +import "Arch"; textdomain "installation"; @@ -350,6 +351,7 @@ _image_order = []; _metadata_image = ""; + // checking whether images are supported string filename = Pkg::SourceProvideOptionalFile (_repo, 1, "/images/images.xml"); if (filename == nil) { @@ -368,6 +370,7 @@ return false; } + // images are supported list<map<string,any> > image_sets = image_descr["image_sets"]:[]; y2debug ("Image set descriptions: %1", image_sets); map<string,any> result = $[]; @@ -378,6 +381,23 @@ map <string, integer> matching_patterns = $[]; map <string, integer> patterns_in_imagesets = $[]; + // ppc (covers also ppc64), i386, x86_64 ... + string arch_short = Arch::arch_short(); + y2milestone ("Current architecture is: %1", arch_short); + + // filter out imagesets for another architecture + image_sets = filter (map<string,any> image, image_sets, { + list <string> imageset_archs = splitstring (image["archs"]:"", " ,"); + + // no architecture defined == noarch + if (size (imageset_archs) == 0) { + return true; + // does architecture match? + } else { + return (contains (imageset_archs, arch_short)); + } + }); + // trying to find all matching patterns foreach (map<string,any> image, image_sets, { string pattern = image["patterns"]:""; @@ -400,6 +420,7 @@ y2debug ("Matching patterns: %1, sizes: %2", possible_patterns, matching_patterns); + // selecting the best imageset string last_pattern = ""; if (size (possible_patterns) > 0) { @@ -423,14 +444,15 @@ y2milestone ("Result: %1/%2", last_pattern, result); - if (result == $[]) - { + // No matching pattern + if (result == $[]) { Installation::image_installation = false; Installation::image_only= false; y2milestone ("No image for installation found"); return true; } + // We've selected one Installation::image_installation = true; if (haskey (result, "pkg_image")) { @@ -439,8 +461,9 @@ Installation::image_only= true; } + // Adding images one by one into the pool foreach (map<string,string> img, result["images"]:[], { - // image must have unique <name>...</name> defined + // image must have unique <file>...</file> defined if (img["file"]:"" == "") { y2error ("No file defined for %1", img); return; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org