[yast-commit] r41969 - in /trunk/product-creator: package/yast2-product-creator.changes src/Kiwi.ycp src/complex.ycp src/kiwi_dialogs.ycp
Author: jsuchome Date: Mon Nov 12 15:19:15 2007 New Revision: 41969 URL: http://svn.opensuse.org/viewcvs/yast?rev=41969&view=rev Log: - image-creator: do not allow importing non-system configurations (#340495) Modified: trunk/product-creator/package/yast2-product-creator.changes trunk/product-creator/src/Kiwi.ycp trunk/product-creator/src/complex.ycp trunk/product-creator/src/kiwi_dialogs.ycp Modified: trunk/product-creator/package/yast2-product-creator.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/package/yast2-product-creator.changes?rev=41969&r1=41968&r2=41969&view=diff ============================================================================== --- trunk/product-creator/package/yast2-product-creator.changes (original) +++ trunk/product-creator/package/yast2-product-creator.changes Mon Nov 12 15:19:15 2007 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Mon Nov 12 13:11:58 CET 2007 - jsuchome@suse.cz + +- image-creator: + do not allow importing non-system configurations (#340495) + +------------------------------------------------------------------- Fri Nov 9 17:04:59 CET 2007 - lslezak@suse.cz - y2mkiso - updated and enhanced help text (#336821) Modified: trunk/product-creator/src/Kiwi.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/src/Kiwi.ycp?rev=41969&r1=41968&r2=41969&view=diff ============================================================================== --- trunk/product-creator/src/Kiwi.ycp (original) +++ trunk/product-creator/src/Kiwi.ycp Mon Nov 12 15:19:15 2007 @@ -309,7 +309,7 @@ ret["xen_disk"] = packages["xen","disk"]:""; if (packages["xen","memory"]:"" != "") ret["xen_memory"] = tointeger (packages["xen","memory"]:"512"); - foreach (string key, [ "author", "contact", "specification", + foreach (string key, [ "author", "contact", "image_type", "specification", "packagemanager", "version", "rpm-check-signatures", "rpm-force", "sizeunit", "type", "name", "repository", "defaultdestination", "schemeversion", "defaultroot", "inherit", "locale"], @@ -795,7 +795,9 @@ { string name = config["name"]:""; string ver = config["version"]:""; - if (name_version[name]:"" == ver) + if (config["image_type"]:"" != "system") + y2warning ("%1 not a 'system' image type, skipping", name); + else if (name_version[name]:"" == ver) y2warning ("template %1,%2 already imported", name, ver); else { Modified: trunk/product-creator/src/complex.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/src/complex.ycp?rev=41969&r1=41968&r2=41969&view=diff ============================================================================== --- trunk/product-creator/src/complex.ycp (original) +++ trunk/product-creator/src/complex.ycp Mon Nov 12 15:19:15 2007 @@ -578,6 +578,11 @@ if (FileUtils::Exists (images_dir + "/" + d + "/config.xml")) { map config = Kiwi::ReadConfigXML (images_dir + "/" + d); + if (config["image_type"]:"" != "system") + { + y2warning ("%1 not a 'system' image type, skipping", d); + return; + } string task = "iso"; // FIXME duplicated in kiwi_dialogs foreach (string type, map data, config["type"]:$[], { Modified: trunk/product-creator/src/kiwi_dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/src/kiwi_dialogs.ycp?rev=41969&r1=41968&r2=41969&view=diff ============================================================================== --- trunk/product-creator/src/kiwi_dialogs.ycp (original) +++ trunk/product-creator/src/kiwi_dialogs.ycp Mon Nov 12 15:19:15 2007 @@ -1573,11 +1573,20 @@ // read the new configuration and update UI accordingly // (no need to read config if it is provided as argument) - void update_config (string dir, map config) { + boolean update_config (string dir, map config) { kiwi_configuration = dir; Config = (config == $[] ? Kiwi::ReadConfigXML (kiwi_configuration) : config); + + if (Config["image_type"]:"" != "system") + { + y2warning ("%1 does not have 'system' image type, skipping", dir); + // error popup + Popup::Error (_("Selected directory does not contain valid description of system configuration")); + return false; + } + // busy popup Popup::ShowFeedback (_("Importing repositories..."), _("Please wait...")); repositories = Kiwi::ImportImageRepositories (Config, dir); @@ -1611,6 +1620,7 @@ }); UI::ChangeWidget (`id (`type), `Items, type_its); UI::ChangeWidget (`id (`type), `Value, kiwi_task); + return true; } list template_items = maplist (string dir, map template, Kiwi::Templates, { @@ -1736,10 +1746,9 @@ kiwi_configuration== "" ? Kiwi::images_dir : kiwi_configuration, // popup for file selection dialog _("Directory to Import")); - if (dir!= nil) + if (dir!= nil && update_config (dir, $[])) { UI::ChangeWidget (`id (`import_dir), `Value, dir); - update_config (dir, $[]); } } else if (ret == `template) @@ -1747,7 +1756,8 @@ string dir = (string) UI::QueryWidget (`id (`template), `Value); update_config (dir, Kiwi::Templates[dir]:$[]); } - else if (is (ret, string)) // system repository selected + else if (is (ret, string) && // system repository selected + ret != "rb_dir" && ret != "rb_new") { map system_repo = Kiwi::initial_repositories[(string)ret]:$[]; if (!haskey (repositories, (string)ret)) -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
jsuchome@svn.opensuse.org