![](https://seccdn.libravatar.org/avatar/ccabc6c04379b11d036b089b67199614.jpg?s=120&d=mm&r=g)
Author: jsuchome Date: Wed Oct 3 22:32:51 2007 New Revision: 41251 URL: http://svn.opensuse.org/viewcvs/yast?rev=41251&view=rev Log: - copy whole content of imported kiwi config directory (#330052) - save defaultroot value to config.xml (#330059) - don't ignore 'inherit' tag (#330079) - added support for "this://" in repository paths (#330095) - do not close module after kiwi failure (#327593) - check stderr and stdout after kiwi finish/failure (#327610) - do not allow configuration without name (#328003) - destination directory specified in sysconfig file (#327055) - support for kiwi images templates (F302371) - support project control for images (F302370) - use zypper instead of smart - write schemeversion to config.xml - directories with templates are specified in /etc/sysconfig/product-creator - enable modifications of configurations without creating images - do not import already imported and modified configuration - enable support for unlisted boot images (e.g. netboot) - show the maximum available space - use lazy initialization of installation sources - tell zypper to ignore zypp lock (#310581) - remove 'prepare' directory before calling kiwi (#325664) - use defaultroot value from config.xml for 'prepare' directory (F302371) - 2.13.12 Modified: branches/SuSE-SLE-10-SP1-Branch/product-creator/agent-kiwi/ag_kiwi branches/SuSE-SLE-10-SP1-Branch/product-creator/package/yast2-product-creator.changes branches/SuSE-SLE-10-SP1-Branch/product-creator/src/Kiwi.ycp branches/SuSE-SLE-10-SP1-Branch/product-creator/src/complex.ycp branches/SuSE-SLE-10-SP1-Branch/product-creator/src/data/sysconfig.product-creator branches/SuSE-SLE-10-SP1-Branch/product-creator/src/kiwi_dialogs.ycp branches/SuSE-SLE-10-SP1-Branch/product-creator/src/wizards.ycp Modified: branches/SuSE-SLE-10-SP1-Branch/product-creator/agent-kiwi/ag_kiwi URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/product-creator/agent-kiwi/ag_kiwi?rev=41251&r1=41250&r2=41251&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP1-Branch/product-creator/agent-kiwi/ag_kiwi (original) +++ branches/SuSE-SLE-10-SP1-Branch/product-creator/agent-kiwi/ag_kiwi Wed Oct 3 22:32:51 2007 @@ -36,7 +36,7 @@ for (my $i=1;$i<= $packageNodeList->size();$i++) { my $node = $packageNodeList -> get_node($i); my $type = $node -> getAttribute ("type"); - y2milestone ("package list type: $type"); + y2debug ("package list type: $type"); $retmap{$key}{$type} = {}; my $patterntype = $node -> getAttribute ("patternType"); $retmap{$key}{$type}{"patternType"} = $patterntype if $patterntype; @@ -60,7 +60,8 @@ } my $prefs = $optionsNodeList -> get_node(1); foreach my $tag ("packagemanager", "version", "rpm-check-signatures", - "rpm-force", "size", "defaultdestination", "defaultroot") { + "rpm-force", "size", "defaultdestination", "defaultroot", "locale") + { my $element = $prefs -> getElementsByTagName ($tag); $retmap{$tag} = $element->get_node(1)->textContent () if ($element); } @@ -96,11 +97,17 @@ my $image = $systemTree -> getElementsByTagName ("image")->get_node (1); my $image_name = $image -> getAttribute ("name"); - $retmap{"name"} = $image_name if $image_name; + if ($image_name) { + $retmap{"name"} = $image_name; + y2milestone ("image name: $image_name"); + } my $scheme_ver = $image -> getAttribute ("schemeversion"); $retmap{"schemeversion"} = $scheme_ver if $scheme_ver; + my $inherit = $image -> getAttribute ("inherit"); + $retmap{"inherit"} = $inherit if $inherit; + $retmap{"users"} = {}; foreach my $usernode ($usrdataNodeList -> get_nodelist()) { my $group = $usernode -> getAttribute("group"); @@ -123,7 +130,7 @@ for (my $i=1;$i<= $driversNodeList->size();$i++) { my $node = $driversNodeList -> get_node($i); my $type = $node -> getAttribute ("type"); - y2milestone ("driver list type: $type"); + y2debug ("driver list type: $type"); $retmap{$key}{$type} = {}; foreach my $tag ("file") { my @list = (); Modified: branches/SuSE-SLE-10-SP1-Branch/product-creator/package/yast2-product-creator.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/product-creator/package/yast2-product-creator.changes?rev=41251&r1=41250&r2=41251&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP1-Branch/product-creator/package/yast2-product-creator.changes (original) +++ branches/SuSE-SLE-10-SP1-Branch/product-creator/package/yast2-product-creator.changes Wed Oct 3 22:32:51 2007 @@ -1,11 +1,25 @@ ------------------------------------------------------------------- -Tue Sep 18 09:46:27 CEST 2007 - jsuchome@suse.cz +Tue Oct 2 11:49:14 CEST 2007 - jsuchome@suse.cz +- copy whole content of imported kiwi config directory (#330052) +- save defaultroot value to config.xml (#330059) +- don't ignore 'inherit' tag (#330079) +- added support for "this://" in repository paths (#330095) +- 2.13.12 + +------------------------------------------------------------------- +Mon Oct 1 14:43:47 CEST 2007 - jsuchome@suse.cz + +- do not close module after kiwi failure (#327593) +- check stderr and stdout after kiwi finish/failure (#327610) +- do not allow configuration without name (#328003) +- destination directory specified in sysconfig file (#327055) - support for kiwi images templates (F302371) - support project control for images (F302370) - use zypper instead of smart - write schemeversion to config.xml -- directories with templates are specified in sysconfig/product-creator +- directories with templates are specified in + /etc/sysconfig/product-creator - enable modifications of configurations without creating images - do not import already imported and modified configuration - enable support for unlisted boot images (e.g. netboot) @@ -14,7 +28,6 @@ - tell zypper to ignore zypp lock (#310581) - remove 'prepare' directory before calling kiwi (#325664) - use defaultroot value from config.xml for 'prepare' directory (F302371) -- 2.13.12 ------------------------------------------------------------------- Mon Sep 17 15:27:43 CEST 2007 - jsuchome@suse.cz Modified: branches/SuSE-SLE-10-SP1-Branch/product-creator/src/Kiwi.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/product-creator/src/Kiwi.ycp?rev=41251&r1=41250&r2=41251&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP1-Branch/product-creator/src/Kiwi.ycp (original) +++ branches/SuSE-SLE-10-SP1-Branch/product-creator/src/Kiwi.ycp Wed Oct 3 22:32:51 2007 @@ -27,8 +27,14 @@ // temporary directory, where kiwi is working global string tmp_dir = ""; + // directory for saving image configurations global string images_dir = Directory::vardir + "/product-creator/images"; + // directories with user-made templated + global list<string> templates_dirs = []; + + global string default_packagemanager = "zypper"; + list<map> all_sources = []; // repositories used for current configuration @@ -79,8 +85,34 @@ /** * generate the 'repository' tag */ - map get_source_value (string source) { + map get_source_value (string source, map config) { + + map ret = $[]; + // first check if we weren't importing this source: + foreach (integer id, map repo, current_repositories, { + if (repo["url"]:"" == source && repo["org"]:$[] != $[]) + { + ret = $[ + "__key" : "repository", + "type" : repo["org","type"]:"", + "__children": [ + $[ + "__key" : "source", + "path" : repo["org","source",0,"path"]:"", + ] + ] + ]; + if (repo["org","status"]:"" != "") + ret["status"] = repo["org","status"]:""; + } + }); + if (ret != $[]) + { + y2milestone ("imported source: %1", source); + return ret; + } + // ... otherwise, we must ask zypp: string type = "yast2"; string source_path = adapt_source_path (source); @@ -96,7 +128,7 @@ type = "rpm-md"; } }); - return $[ + ret = $[ "__key" : "repository", "type" : type, "__children": [ @@ -106,6 +138,7 @@ ] ] ]; + return ret; } /** @@ -128,10 +161,11 @@ "__value" : task, "primary" : "true", "boot" : boot_image, -//TODO (KiwiConfig["compressed"]:false ? ",compressed" : ""), ]; if (task != "iso") - ret["filesystem"] = "ext3"; + ret["filesystem"] = config["type",task,"filesystem"]:"ext3"; + if (config["type",task,"flags"]:"" != "") + ret["flags"] = config["type",task,"flags"]:""; return ret; } @@ -247,7 +281,7 @@ foreach (string key, [ "author", "contact", "specification", "packagemanager", "version", "rpm-check-signatures", "rpm-force", "sizeunit", "type", "name", "repository", "defaultdestination", - "schemeversion", "defaultroot"], + "schemeversion", "defaultroot", "inherit"], { if (config[key]:nil != nil) ret[key] = config[key]:nil; @@ -353,30 +387,7 @@ ]) ); - list write_list = [ $[ - "__key" : "image", - "name" : KiwiConfig["name"]:"", - "schemeversion" : KiwiConfig["schemeversion"]:"1.4", - "__children" : [ - $[ - "__key" : "description", - "type" : "system", - "__children" : [ - $[ - "__key" : "author", - "__value" : KiwiConfig["author"]:"", - ], - $[ - "__key" : "contact", - "__value" : KiwiConfig["contact"]:"", - ], - $[ - "__key" : "specification", - "__value" : KiwiConfig["specification"]:"", - ], - ], - ], - $[ + map preferences = $[ "__key" : "preferences", "__children" : [ get_type_value (KiwiConfig, task), @@ -391,8 +402,7 @@ ], $[ "__key" : "packagemanager", - "__value" : "zypper", -// "__value" : "smart", + "__value" : KiwiConfig["packagemanager"]:default_packagemanager ], $[ "__key" : "rpm-check-signatures", @@ -407,9 +417,44 @@ "__value" : KiwiConfig["iso-directory"]:"", ], ], + ]; + if (KiwiConfig["defaultroot"]:"" != "") + { + preferences["__children"] = add (preferences["__children"]:[], $[ + "__key" : "defaultroot", + "__value" : KiwiConfig["defaultroot"]:"", + ]); + } + + + list write_list = [ $[ + "__key" : "image", + "name" : KiwiConfig["name"]:"", + "schemeversion" : KiwiConfig["schemeversion"]:"1.4", + "__children" : [ + $[ + "__key" : "description", + "type" : "system", + "__children" : [ + $[ + "__key" : "author", + "__value" : KiwiConfig["author"]:"", + ], + $[ + "__key" : "contact", + "__value" : KiwiConfig["contact"]:"", + ], + $[ + "__key" : "specification", + "__value" : KiwiConfig["specification"]:"", + ], + ], ], + preferences, ], ]]; + if (KiwiConfig["inherit"]:"" != "") + write_list[0,"inherit"] = KiwiConfig["inherit"]:""; if (haskey (KiwiConfig, "users")) { write_list[0,"__children"] = add (write_list[0,"__children"]:[], $[ @@ -428,7 +473,7 @@ } write_list[0,"__children"] = union (write_list[0,"__children"]:[], maplist (string source, (list<string>) KiwiConfig["sources"]:[], - ``(get_source_value (source)) + ``(get_source_value (source, KiwiConfig)) ) ); write_list[0,"__children"] = union (write_list[0,"__children"]:[], [ @@ -467,7 +512,7 @@ SCR::Write (.target.string, config_dir + "/config.xml", write_string); foreach (string dir, ["root_dir", "config_dir"], { foreach (string val, KiwiConfig[dir]:[], { - string realdir = config_dir + "/" + substring (dir, 0, find (dir, "_")); + string realdir = config_dir + "/" + substring (dir, 0, search (dir, "_")); boolean created = false; if (val != "" && FileUtils::Exists (val)) { @@ -487,6 +532,10 @@ SCR::Execute (.target.bash, "chmod +x " + config_dir + "/" + file); } }); + foreach (string file, KiwiConfig["import_files"]:[], { + y2milestone ("copying %1 to %2", file,config_dir); + SCR::Execute (.target.bash, sformat ("cp -ar %1 %2/", file,config_dir)); + }); return true; } @@ -507,12 +556,6 @@ SCR::Execute (.target.bash, sformat ("rm -rf %1", chroot_dir)); } - string cmd = sformat ("ZYPP_READONLY_HACK=1 kiwi --root %1 --prepare %2 --logfile terminal", chroot_dir, config_dir); - - y2milestone ("calling '%1'", cmd); - - SCR::Execute (.background.run_output_err, cmd); - // construct the dialog UI::OpenDialog(`opt(`decorated), `HBox(`HSpacing(1.5), `VBox( @@ -534,6 +577,27 @@ ), `HSpacing(1.5) )); + void update_output () { + // read the output line from irw: + list<string> out = (list<string>)SCR::Read(.background.newout); + foreach (string line, out, { + line = String::Replace (line, "\r", "\n"); + UI::ChangeWidget (`id(`log), `LastLine, line + "\n"); + }); + + list<string> err = (list<string>) SCR::Read(.background.newerr); + foreach (string line, err, { + line = String::Replace (line, "\r", "\n"); + UI::ChangeWidget (`id(`errlog), `LastLine, line + "\n"); + }); + } + + string cmd = sformat ("ZYPP_READONLY_HACK=1 kiwi --root %1 --prepare %2 --logfile terminal", chroot_dir, config_dir); + + y2milestone ("calling '%1'", cmd); + + SCR::Execute (.background.run_output_err, cmd); + symbol ret = nil; boolean creating = false; do @@ -542,21 +606,12 @@ if ((boolean) SCR::Read(.background.output_open) && (integer) SCR::Read(.background.newlines)>0) { - // read the output line from irw: - list<string> out = (list<string>)SCR::Read(.background.newout); - foreach (string line, out, { - line = String::Replace (line, "\r", "\n"); - UI::ChangeWidget (`id(`log), `LastLine, line + "\n"); - }); - - list<string> err = (list<string>) SCR::Read(.background.newerr); - foreach (string line, err, { - line = String::Replace (line, "\r", "\n"); - UI::ChangeWidget (`id(`errlog), `LastLine, line + "\n"); - }); + update_output (); } else if (!(boolean)SCR::Read(.background.isrunning)) { + update_output (); + integer status = (integer) SCR::Read (.background.status); if (status != 0) { @@ -620,8 +675,10 @@ /** * Import repositories from given kiwi image configuration + * @patam Config configuration map, as read from config.xml + * @param dir path to directory containing this config.xml */ - global map <integer,map> ImportImageRepositories (map Config) { + global map <integer,map> ImportImageRepositories (map Config, string dir) { current_repositories = $[]; integer i = 0; @@ -630,22 +687,17 @@ if (source != "") { string url = ""; - if (substring (source, 0, 1) == "/") - url = "dir://"; - /* - integer id = -1; - if (repo["type"]:"" == "rpm-dir") + if (substring (source, 0, 7) == "this://") { - id = Pkg::SourceCreateType (url + source, "", "Plaindir"); + string source_path = substring (source, 7); + source = dir + "/" + source_path; } - else - id = Pkg::SourceCreate (url + source, ""); - if (id != -1) - current_repositories[id] = url + source; - */ + if (substring (source, 0, 1) == "/") + url = "dir://"; current_repositories [i] = $[ "url" : url + source, - "plaindir" : repo["type"]:"" == "rpm-dir" + "plaindir" : repo["type"]:"" == "rpm-dir", + "org" : repo, ]; i = i + 1; } @@ -656,7 +708,6 @@ /** * Initialize the list of current repositories */ -// global map <integer,string> InitCurrentRepositories () { global map <integer,map> InitCurrentRepositories () { Pkg::SourceRestore (); @@ -665,7 +716,6 @@ integer srcid = source["SrcId"]:-1; map data = Pkg::SourceGeneralData (srcid); string url = data["url"]:""; -// current_repositories[srcid] = url; current_repositories[i] = $[ "url" : url, "plaindir" : data["type"]:"" == "Plaindir" @@ -680,24 +730,12 @@ */ global boolean ReadImageTemplates () { - /* - // get the list of directories with templates from config file - string file = Directory::vardir + "/product-creator/image_templates"; - if (!FileUtils::Exists (file)) - { - SCR::Execute (.target.bash, sformat ("cp %1/image_templates %2/", - Directory::datadir + "/product-creator", - Directory::vardir + "/product-creator")); - } - - string cont = (string) SCR::Read (.target.string, file); - if (cont == nil) - return false; - */ string dirs = (string)SCR::Read(.sysconfig.product-creator.IMAGE_TEMPLATES); + map name_version = $[]; foreach (string line, splitstring (dirs, "\t "), { if (line == "" || substring (line, 0, 1) == "#") return; + templates_dirs = add (templates_dirs, line); if (!FileUtils::IsDirectory (line)) { y2warning ("%1 is not a directory", line); @@ -708,15 +746,36 @@ foreach (string d, splitstring(out["stdout"]:"", "\n"), { if (d == "") return; map config = Kiwi::ReadConfigXML (line + "/" + d); - // index by full path, there may be same names // (templates could be provided by different vendors) if (config != nil && config != $[]) - Templates[line + "/" + d] = config; + { + string name = config["name"]:""; + string ver = config["version"]:""; + if (name_version[name]:"" == ver) + y2warning ("template %1,%2 already imported", name, ver); + else + { + name_version[name] = ver; + Templates[line + "/" + d] = config; + } + } }); }); return true; } + /** + * REad the confgiuration stuff for image creator + */ + global boolean Read () { + + string dir = + (string) SCR::Read (.sysconfig.product-creator.IMAGE_CONFIGURATIONS); + if (dir != nil && dir != "") + images_dir = dir; + return ReadImageTemplates (); + } + } Modified: branches/SuSE-SLE-10-SP1-Branch/product-creator/src/complex.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/product-creator/src/complex.ycp?rev=41251&r1=41250&r2=41251&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP1-Branch/product-creator/src/complex.ycp (original) +++ branches/SuSE-SLE-10-SP1-Branch/product-creator/src/complex.ycp Wed Oct 3 22:32:51 2007 @@ -646,7 +646,7 @@ string dir = config["kiwi_configuration_"+ config["current_task"]:""]:""; // TODO at the end? (solve possible new config with same name..) - if (dir != "" && issubstring (dir, Directory::vardir)) + if (dir != "" && issubstring (dir, Kiwi::images_dir)) SCR::Execute (.target.bash, "rm -rf " + dir); Configurations = remove (Configurations, current); overview = filter (term it, (list<term>) overview, @@ -670,7 +670,9 @@ } if (Package::InstallAll (to_install)) { - Kiwi::ImportImageRepositories (ProductCreator::Config); + string dir = + ProductCreator::Config["kiwi_configuration_" + task]:""; + Kiwi::ImportImageRepositories (ProductCreator::Config, dir); Kiwi::kiwi_task = task; ret = `kiwi; break; Modified: branches/SuSE-SLE-10-SP1-Branch/product-creator/src/data/sysconfig.product-creator URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/product-creator/src/data/sysconfig.product-creator?rev=41251&r1=41250&r2=41251&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP1-Branch/product-creator/src/data/sysconfig.product-creator (original) +++ branches/SuSE-SLE-10-SP1-Branch/product-creator/src/data/sysconfig.product-creator Wed Oct 3 22:32:51 2007 @@ -7,7 +7,7 @@ # Items are separated by spaces. # # -IMAGE_TEMPLATES="" +IMAGE_TEMPLATES="/var/lib/YaST2/product-creator/templates" ## Path: System/Yast2/Product-creator ## Description: YaST2 Product Creator Modified: branches/SuSE-SLE-10-SP1-Branch/product-creator/src/kiwi_dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/product-creator/src/kiwi_dialogs.ycp?rev=41251&r1=41250&r2=41251&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP1-Branch/product-creator/src/kiwi_dialogs.ycp (original) +++ branches/SuSE-SLE-10-SP1-Branch/product-creator/src/kiwi_dialogs.ycp Wed Oct 3 22:32:51 2007 @@ -645,7 +645,7 @@ define boolean CreateImage (string key, map event) { if (event["ID"]:nil != `next) return true; - + boolean ret = true; map question = $[ // popup question "iso" : _("Create ISO image now?"), @@ -703,6 +703,10 @@ directory."), out_dir)); } } + else + { + ret = false; + } } } string dir = Kiwi::SaveConfiguration (KiwiConfig, kiwi_task); @@ -710,7 +714,7 @@ { ProductCreator::Config["kiwi_configuration_" + kiwi_task] = dir; } - return true; + return ret; } /** @@ -775,6 +779,20 @@ KiwiConfig[file] = contents; } }); + // take care of the rest in the input directory (#330052) + list import_files = []; + map out = (map) SCR::Execute (.target.bash_output, + sformat ("ls -A1 -d %1/* 2>/dev/null", kiwi_configuration)); + foreach (string line, splitstring (out["stdout"]:"", "\n"), { + if (line == "") return; + string last = substring (line, findlastof (line, "/") + 1); + if (contains (["images.sh", "config.sh", "config.xml", "root","config"], + last)) + return; + import_files = add (import_files, line); + }); + KiwiConfig["import_files"] = import_files; + map<string,any> read_config = Kiwi::ReadConfigXML (kiwi_configuration); if (!KiwiConfig["_imported"]:false) @@ -1438,9 +1456,9 @@ string kiwi_configuration = Config["kiwi_configuration_" + kiwi_task]:""; string name = Config["name"]:""; string out_dir = Config["iso-directory"]:""; -// map <integer,string> repositories = Kiwi::current_repositories; map <integer,map> repositories = Kiwi::current_repositories; boolean new_configuration = (Config == $[]); + boolean append_name = false; string help = (new_configuration ? // help text for kiwi UI preparation @@ -1448,7 +1466,7 @@ : "") + // help text for kiwi UI preparation - (new_configuration ? sformat (_("<p>For information about configuration templates, see <tt>%1</tt> file.</p>"), Directory::vardir + "/product-creator/image_templates") : "") + + (new_configuration ? sformat (_("<p>Place custom configuration templates under <tt>%1</tt> directory.</p>"), Kiwi::templates_dirs[0]:"") : "") + // help text for kiwi UI preparation, cont. _("<p>Choose the <b>Image Type</b> which should be created.</p>") + @@ -1480,34 +1498,9 @@ // on start, show the default YaST sources if (Config == $[]) { - /* - sources already initialized? FIXME not for kiwi.ycp - Pkg::SourceRestore (); - Pkg::SourceLoad(); - Config["sources"] = maplist (map source, Pkg::SourceEditGet (), { - integer srcid = source["SrcId"]:-1; - map data = Pkg::SourceGeneralData (srcid); - string url = data["url"]:""; - repositories[srcid] = url; - return url; - }); - */ } else if (Config["sources"]:[] != [] && repositories == $[]) { - /* - list sources = Config["sources"]:[]; - list<map> all_sources = Pkg::SourceEditGet(); - foreach (map source, all_sources, { - integer srcid = source["SrcId"]:-1; - map data = Pkg::SourceGeneralData (srcid); - string url = data["url"]:""; - string stripped = url; - if (substring (url, 0, 6) == "dir://") - stripped = substring (url, 6); - if (contains(sources, url) || contains (sources, stripped)) - repositories[srcid] = url; - }); - */ integer i = 0; foreach (string src, Config["sources"]:[], { repositories[i] = $[ @@ -1533,7 +1526,7 @@ (config == $[] ? Kiwi::ReadConfigXML (kiwi_configuration) : config); // busy popup Popup::ShowFeedback (_("Importing repositories..."), _("Please wait...")); - repositories = Kiwi::ImportImageRepositories (Config); + repositories = Kiwi::ImportImageRepositories (Config, dir); Popup::ClearFeedback (); if (!new_configuration) { @@ -1545,7 +1538,7 @@ Config["version"] = "1.0.0"; } if (Config["iso-directory"]:"" != "") - UI::ChangeWidget (`id (`out_dir), `Value, Config["iso-directory"]:""); + UI::ChangeWidget(`id(`out_dir), `Value, Config["iso-directory"]:""); update_repo_table (); list type_items = basic_type_items; boolean primary = false; @@ -1616,6 +1609,11 @@ `VBox ( `Label (""), `PushButton (`id (`browse), Label::BrowseButton ()) + ), + `VBox ( + `Label (""), + // checkbox label + `CheckBox (`id (`append), _("A&ppend Name"), append_name) ) ), `VSpacing (0.2), @@ -1706,12 +1704,6 @@ if (url != "") { boolean present = false; - /* - foreach (integer id, string repo, repositories, { - if (repo == url) - present = true; - }); - */ foreach (integer id, map repo, repositories, { if (repo["url"]:"" == url) { @@ -1721,24 +1713,12 @@ }); if (present) break; -// integer id = -1; map parsed = URL::Parse(url); if (parsed["scheme"]:"" == "pkg") { parsed["scheme"] = "dir"; url = URL::Build (parsed); -// id = Pkg::SourceCreateType (url, "", "Plaindir"); - } - /* - else - id = Pkg::SourceCreate (url, ""); - - if (id != -1) - { - repositories[id] = url; - update_repo_table (); } - */ repositories[size (repositories)] = $[ "url" : url, "plaindir" : parsed["scheme"]:"" == "dir" @@ -1750,13 +1730,8 @@ { integer selected = (integer) UI::QueryWidget (`id (`repositories), `CurrentItem); - /* - map generalData = Pkg::SourceGeneralData (selected); - string url = generalData["url"]:""; - */ string url = repositories[selected,"url"]:""; string selected_url = url; -// boolean plaindir = generalData["type"]:"YaST" == "Plaindir"; boolean plaindir = repositories[selected,"plaindir"]:false; // change schema if the source type is plaindir // to show the right popup dialog @@ -1770,21 +1745,13 @@ if (url == "" || url == nil || url == selected_url); continue; // remove current url + add new one -// Pkg::SourceDelete (selected); repositories = remove (repositories, selected); -// integer id = -1; map parsed = URL::Parse(url); if (parsed["scheme"]:"" == "pkg") { parsed["scheme"] = "dir"; url = URL::Build (parsed); -// id = Pkg::SourceCreateType (url, "", "Plaindir"); } - /* - else - id = Pkg::SourceCreate (url, ""); - repositories[id] = url; - */ repositories[size (repositories)] = $[ "url" : url, "plaindir" : parsed["scheme"]:"" == "dir" @@ -1795,7 +1762,6 @@ { integer selected = (integer) UI::QueryWidget (`id (`repositories), `CurrentItem); -// Pkg::SourceDelete (selected); repositories = remove (repositories, selected); update_repo_table (); } @@ -1811,7 +1777,14 @@ } else if (ret == `next) { - string name = (string) UI::QueryWidget (`id (`config), `Value); + name = (string) UI::QueryWidget (`id (`config), `Value); + if (name == "") + { + // error popup + Report::Error(_("Enter the name of the configuration.")); + UI::SetFocus (`id (`config)); + continue; + } if (new_configuration && FileUtils::Exists (Kiwi::images_dir + "/" + name)) { @@ -1844,7 +1817,7 @@ Config["kiwi_configuration_" + kiwi_task] = kiwi_configuration; Config["_imported"] = true; Config["iso-directory"] = out_dir; - Config["name"] = UI::QueryWidget (`id (`config), `Value); + Config["name"] = name; /* Config["sources"] = maplist ( integer id, string repo, repositories, ``(repo)); Modified: branches/SuSE-SLE-10-SP1-Branch/product-creator/src/wizards.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/product-creator/src/wizards.ycp?rev=41251&r1=41250&r2=41251&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP1-Branch/product-creator/src/wizards.ycp (original) +++ branches/SuSE-SLE-10-SP1-Branch/product-creator/src/wizards.ycp Wed Oct 3 22:32:51 2007 @@ -144,8 +144,7 @@ symbol InitRepositories () { Kiwi::current_repositories = Kiwi::InitCurrentRepositories (); - // TODO general Read function... - Kiwi::ReadImageTemplates (); + Kiwi::Read (); return `next; } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org