Hello community, here is the log from the commit of package yast2-product-creator for openSUSE:Factory checked in at 2012-12-07 14:53:37 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-product-creator (Old) and /work/SRC/openSUSE:Factory/.yast2-product-creator.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "yast2-product-creator", Maintainer is "jsuchome@suse.com" Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-product-creator/yast2-product-creator.changes 2012-12-05 14:10:52.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.yast2-product-creator.new/yast2-product-creator.changes 2012-12-07 14:53:40.000000000 +0100 @@ -1,0 +2,7 @@ +Wed Dec 5 13:17:58 CET 2012 - jsuchome@suse.cz + +- for images created in Studio, disable editing image.sh and + config.sh, but enable editing root/build-custom (fate#310978) +- 2.23.2 + +------------------------------------------------------------------- Old: ---- yast2-product-creator-2.23.1.tar.bz2 New: ---- yast2-product-creator-2.23.2.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-product-creator.spec ++++++ --- /var/tmp/diff_new_pack.5YlfaM/_old 2012-12-07 14:53:41.000000000 +0100 +++ /var/tmp/diff_new_pack.5YlfaM/_new 2012-12-07 14:53:41.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2-product-creator -Version: 2.23.1 +Version: 2.23.2 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ yast2-product-creator-2.23.1.tar.bz2 -> yast2-product-creator-2.23.2.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-product-creator-2.23.1/VERSION new/yast2-product-creator-2.23.2/VERSION --- old/yast2-product-creator-2.23.1/VERSION 2012-12-03 16:09:03.000000000 +0100 +++ new/yast2-product-creator-2.23.2/VERSION 2012-12-05 13:21:09.000000000 +0100 @@ -1 +1 @@ -2.23.1 +2.23.2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-product-creator-2.23.1/src/Kiwi.ycp new/yast2-product-creator-2.23.2/src/Kiwi.ycp --- old/yast2-product-creator-2.23.1/src/Kiwi.ycp 2012-12-04 16:00:22.000000000 +0100 +++ new/yast2-product-creator-2.23.2/src/Kiwi.ycp 2012-12-06 13:46:30.000000000 +0100 @@ -163,10 +163,11 @@ ret = repo["org"]:$[]; } }); - if (url2alias[source]:"" != "") + string adapted = adapt_source_path (source); + if (haskey (url2alias, source) || haskey (url2alias, adapted)) { - ret["source",0,"path"] = url2alias[source]:""; - y2milestone ("alias for %1 is %2", source, url2alias[source]:""); + ret["source",0,"path"] = url2alias[source]:url2alias[adapted]:""; + y2milestone ("alias for %1 is %2", source, ret["source",0,"path"]:""); return ret; } @@ -183,7 +184,7 @@ integer srcid = sourcemap["SrcId"]:-1; map data = Pkg::SourceGeneralData (srcid); string url = data["url"]:""; - if (adapt_source_path (url) == adapt_source_path (source)) + if (adapt_source_path (url) == adapted) { if (data["type"]:"" == "NONE") data["type"] = Pkg::RepositoryProbe (url, ""); @@ -526,7 +527,7 @@ } }); }); - foreach (string file, ["images.sh", "config.sh" ], { + foreach (string file, ["images.sh", "config.sh", "root/build-custom" ], { if (KiwiConfig[file]:"" != "") { SCR::Write (.target.string, config_dir + "/" + file, KiwiConfig[file]:""); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-product-creator-2.23.1/src/kiwi_dialogs.ycp new/yast2-product-creator-2.23.2/src/kiwi_dialogs.ycp --- old/yast2-product-creator-2.23.1/src/kiwi_dialogs.ycp 2012-12-03 13:14:58.000000000 +0100 +++ new/yast2-product-creator-2.23.2/src/kiwi_dialogs.ycp 2012-12-05 13:17:20.000000000 +0100 @@ -668,6 +668,10 @@ */ define void InitGeneric (string id) { UI::ChangeWidget (`id (id), `Value, KiwiConfig[id]:""); + if ((id == "config.sh" || id == "images.sh") && haskey (KiwiConfig, "root/build-custom")) + { + UI::ChangeWidget (`id (id), `Enabled, false); + } } /** @@ -1163,10 +1167,8 @@ */ string BrowseFileHandler (string key, string label) { - string current = (string) UI::QueryWidget (`id (key), `Value); - if (current == nil) current = ""; - string file = UI::AskForExistingFile (current, "", label); - if (file != nil && key != "config.sh") + string file = UI::AskForExistingFile (key, "", label); + if (file != nil && key != "config.sh" && key != "root/build-custom") { UI::ChangeWidget (`id (key), `Value, file); StoreGeneric (key, $[]); @@ -1175,41 +1177,22 @@ } /** - * Handler for browsing for images.sh file - */ - symbol HandleBrowseImagesFile (string key, map event) { - if (event["ID"]:nil != key) return nil; - // popup for file selection dialog - BrowseFileHandler ("images_path", _("Path to images.sh File")); - return nil; - } - - /** - * Handler for browsing for autoyast profile - */ - symbol HandleBrowseAutoYaSTFile (string key, map event) { - if (event["ID"]:nil != key) return nil; - // popup for file selection dialog - BrowseFileHandler ("autoyast_path", _("Path to AutoYaST Profile")); - return nil; - } - - /** * Handler for importing config.sh file */ symbol HandleImportConfigFile (string key, map event) { if (event["ID"]:nil != key) return nil; + string name = substring (key, 7); // removing 'import_' button id prefix // popup for file selection dialog - string file = BrowseFileHandler ("config.sh", _("Path to config.sh File")); + string file = BrowseFileHandler (name, sformat (_("Path to %1 File"), name)); if (file != nil) { if (FileUtils::Exists (file)) { - string configsh = (string) SCR::Read (.target.string, file); - if (configsh != nil) + string cont = (string) SCR::Read (.target.string, file); + if (cont != nil) { - UI::ChangeWidget (`id ("config.sh"), `Value, configsh); - StoreGeneric ("config.sh", event); + UI::ChangeWidget (`id (name), `Value, cont); + StoreGeneric (name, event); } } } @@ -1570,7 +1553,9 @@ // read all entries from root_dir and save to list map out = (map) SCR::Execute (.target.bash_output, sformat ("ls -A1 -d %1/root/* 2>/dev/null", kiwi_configuration)); - KiwiConfig["root_dir"] = filter (string f, splitstring(out["stdout"]:"", "\n"), ``(f!="")); + KiwiConfig["root_dir"] = filter (string f, splitstring(out["stdout"]:"", "\n"), { + return f != "" && f != kiwi_configuration + "/root/build-custom"; + }); } if (FileUtils::Exists (kiwi_configuration + "/config")) { @@ -1579,10 +1564,17 @@ KiwiConfig["config_dir"] = filter (string f, splitstring(out["stdout"]:"", "\n"),``(f!="")); } - foreach (string file, [ "images.sh", "config.sh" ], { + // existence of manifesto.xml means studio-generated configuration + if (FileUtils::Exists (kiwi_configuration + "/root/studio/manifesto.xml")) + { + KiwiConfig["root/build-custom"] = ""; + } + + foreach (string file, [ "images.sh", "config.sh", "root/build-custom" ], { string file_path = kiwi_configuration + "/" + file; if (FileUtils::Exists (file_path)) { + string contents = (string) SCR::Read (.target.string, file_path); if (contents != nil) KiwiConfig[file] = contents; @@ -1775,6 +1767,10 @@ } }); + // if root/build-custom file is present, offer its editing instead of + // config.sh & images.sh (fate#310978) + boolean show_buildcustom = haskey (KiwiConfig, "root/build-custom"); + map ret = $[ "config.xml" : $[ // tab header @@ -1867,14 +1863,27 @@ `VBox ( "general_scripts", `VSpacing (0.2), - `HBox ("config.sh", `Bottom ("import_config.sh")), - `HBox ("images.sh", `Bottom ("import_images.sh")), + show_buildcustom ? + `VBox ( + `VWeight (3, `HBox ("root/build-custom", `Bottom ("import_root/build-custom"))), + `Left ( + // informative label + `Label (_("Editing of following files is disabled for configurations imported from Studio.")) + ), + `VWeight (1, "config.sh"), + `VWeight (1, "images.sh") + ) : + `VBox ( + `HBox ("config.sh", `Bottom ("import_config.sh")), + `HBox ("images.sh", `Bottom ("import_images.sh")) + ), `VSpacing (0.2) ), `HSpacing (1)), "widget_names" : [ "general_scripts", "config.sh", "import_config.sh", "images.sh", "import_images.sh", + "root/build-custom", "import_root/build-custom", ], ], "directories" : $[ @@ -2106,6 +2115,21 @@ "no_help" : true, "handle" : HandleDeleteFromConfigDir, ], + "root/build-custom" : $[ + "widget" : `multi_line_edit, + // textentry label + "label" : _("Studio Custom Build Script"), + "init" : InitGeneric, + "store" : StoreGeneric, + "handle" : HandleGeneric, + ], + "import_root/build-custom" : $[ + "widget" : `push_button, + // textentry label + "label" : _("&Import..."), + "help" : "", + "handle" : HandleImportConfigFile + ], "config.sh" : $[ "widget" : `multi_line_edit, // textentry label @@ -2138,19 +2162,6 @@ "help" : "", "handle" : HandleBrowseConfigDirectory ], - "autoyast_path" : $[ - "widget" : `textentry, - // textentry label - "label" : _("Path to Auto&YaST Profile"), - "help" : _("Choose the path to the AutoYaST profile (config.xml)."), - ], - "browse_autoyast" : $[ - "widget" : `push_button, - // push button label - "label" : _("Brow&se..."), - "help" : "", - "handle" : HandleBrowseAutoYaSTFile - ], "images.sh" : $[ "widget" : `multi_line_edit, // textentry label -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org