Author: jsuchome Date: Fri Aug 24 15:22:17 2007 New Revision: 40465 URL: http://svn.opensuse.org/viewcvs/yast?rev=40465&view=rev Log: - use local templates for image descriptions - show kiwi error output in separate window - mark plaindir installation types as rpm-dir in config.xml Modified: branches/SuSE-SLE-10-SP1-Branch/product-creator/src/Kiwi.ycp branches/SuSE-SLE-10-SP1-Branch/product-creator/src/kiwi.ycp 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=40465&r1=40464&r2=40465&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 Fri Aug 24 15:22:17 2007 @@ -27,6 +27,8 @@ global string images_dir = "/usr/share/kiwi/image"; + list<map> all_sources = []; + // where the kiwi configuration files are stored string config_dir = ""; @@ -57,11 +59,42 @@ if (substring (source, 0, 6) == "dir://") return substring (source, 6); - //FIXME plaindir -> rpm-dir return source; } /** + * generate the 'repository' tag + */ + map get_source_value (string source) { + + string type = "yast2"; + string source_path = adapt_source_path (source); + + foreach (map sourcemap, all_sources, { + integer srcid = sourcemap["SrcId"]:-1; + map data = Pkg::SourceGeneralData (srcid); + string url = data["url"]:""; + if (url == source || url == source_path) + { + if (data["type"]:"" == "Plaindir") + type = "rpm-dir"; + if (data["type"]:"" == "YUM") + type = "rpm-md"; + } + }); + return $[ + "__key" : "repository", + "type" : type, + "__children": [ + $[ + "__key" : "source", + "path" : source_path + ] + ] + ]; + } + + /** * generate the name of directory with kiwi configuration */ string get_config_dir (string name, string task) { @@ -182,6 +215,8 @@ */ global boolean WriteConfigXML (map KiwiConfig, string kiwi_task) { + all_sources = Pkg::SourceEditGet(); + tmp_dir = Directory::tmpdir; list packages_list = []; @@ -317,18 +352,9 @@ ]); } write_list[0,"__children"] = union (write_list[0,"__children"]:[], - maplist (string source, (list<string>) KiwiConfig["sources"]:[], { - return $[ - "__key" : "repository", - "type" : "yast2", //FIXME rpm-dir? - "__children": [ - $[ - "__key" : "source", - "path" : adapt_source_path (source), - ] - ] - ]; - }) + maplist (string source, (list<string>) KiwiConfig["sources"]:[], + ``(get_source_value (source)) + ) ); write_list[0,"__children"] = union (write_list[0,"__children"]:[], [ $[ @@ -411,18 +437,23 @@ // construct the dialog UI::OpenDialog(`opt(`decorated), `HBox(`HSpacing(1.5), - `VSpacing(25), `VBox( `HSpacing(85), - `VSpacing(0.5), - // label - `ReplacePoint (`id (`rpl), `Left (`Label(_("Preparing for Image Creation")))), - `VSpacing(0.5), - `LogView (`id (`log), "", 8, 0), - `VSpacing(0.5), - `ReplacePoint (`id (`rp), `PushButton (`id(`cancel),`opt(`key_F9), Label::CancelButton ())), - `VSpacing(0.5)), - `HSpacing(1.5) + `VWeight (2, `VBox ( + `VSpacing(0.5), + // label + `ReplacePoint (`id (`rpl), `Left (`Label(_("Preparing for Image Creation")))), + `VSpacing(0.5), + `LogView (`id (`log), "", 8, 0) + )), + `VWeight (1, `VBox ( + `VSpacing(0.5), + `LogView (`id (`errlog), "", 8, 0), + `VSpacing(0.5), + `ReplacePoint (`id (`rp), `PushButton (`id(`cancel),`opt(`key_F9), Label::CancelButton ())), + `VSpacing(0.5) + )) + ), `HSpacing(1.5) )); symbol ret = nil; @@ -440,7 +471,11 @@ UI::ChangeWidget (`id(`log), `LastLine, line + "\n"); }); - list script_err = (list) SCR::Read(.background.newerr); + 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"); + }); } else if (!(boolean)SCR::Read(.background.isrunning)) { 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=40465&r1=40464&r2=40465&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 Fri Aug 24 15:22:17 2007 @@ -11,6 +11,7 @@ import "CWM"; import "CWMTab"; + import "Directory"; import "ProductCreator"; import "FileUtils"; import "Label"; @@ -724,6 +725,12 @@ if (!FileUtils::Exists (kiwi_configuration)) { + // use local template if default dir does not exist (bug #289552) + if (!FileUtils::Exists (default_dir)) + { + default_dir = Directory::datadir+"/product-creator/kiwi_templates/"; + default_dir = default_dir + (kiwi_task == "xen" ? "xen" : "iso"); + } y2warning ("directory %1 is not available, using %2", kiwi_configuration, default_dir); kiwi_configuration = default_dir; } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org