Author: jsuchome
Date: Fri Jun 13 16:30:50 2008
New Revision: 48304
URL: http://svn.opensuse.org/viewcvs/yast?rev=48304&view=rev
Log:
removing dependency on ag_kiwi in favor of ag_anyxml (WIP)
Modified:
trunk/product-creator/src/Kiwi.ycp
trunk/product-creator/src/complex.ycp
trunk/product-creator/src/helps.ycp
trunk/product-creator/src/kiwi_dialogs.ycp
Modified: trunk/product-creator/src/Kiwi.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/src/Kiwi.ycp?rev=48304&r1=48303&r2=48304&view=diff
==============================================================================
--- trunk/product-creator/src/Kiwi.ycp (original)
+++ trunk/product-creator/src/Kiwi.ycp Fri Jun 13 16:30:50 2008
@@ -25,6 +25,12 @@
string encryption_method = nil;
+ /**
+ * argument for any_xml agent: key indicating content of element without
+ * attributes
+ */
+ global string content_key = "__yast_content__";
+
// temporary directory, where kiwi is working
global string tmp_dir = "";
@@ -191,7 +197,7 @@
ret["primary"] = "true";
return ret;
});
- // create default values for new project
+ // create default values for new project FIXME
if (retlist == [])
{
map ret = $[
@@ -212,37 +218,48 @@
}
/**
- * generate the value map for group to be used by Map2XML
+ * convert YCP map (of type read from any_xml agent) to XML
*/
- map get_group_value (string group, list<map> userlist) {
+ string MapAny2XML (string item_key, map item_descr, integer level) {
- string gid = "";
- map ret = $[
- "__key" : "users",
- "group" : group,
- "__children" : maplist (map usermap, userlist, {
- map u = $[
- "__key" : "user",
- "name" : usermap["username"]:"",
- "pwd" : (usermap["encrypted"]:false) ?
- usermap["pwd"]:"" :
- crypt_password (usermap["pwd"]:""),
- "home" : usermap["home"]:"",
- ];
- if (usermap["realname"]:"" != "")
- u["realname"] = usermap["realname"]:"";
- if (usermap["id"]:"" != "")
- u["id"] = usermap["id"]:"";
- if (usermap["gid"]:"" != "")
- gid = usermap["gid"]:"";
- return u;
- })
- ];
- if (gid != "")
- ret["id"] = gid;
+ string tab = "";
+ integer i = 0;
+ while (i < level) {
+ i = i + 1;
+ tab = tab + " ";
+ }
+ string ret = tab + "<" + item_key;
+ string attr = "";
+ string subret = "";
+ string content = "";
+ foreach (string key, any value, (map) item_descr, {
+
+ if (is (value, list))
+ {
+ foreach (map it_map, (list<map>) value, {
+ subret = subret + "\n" + MapAny2XML (key, it_map, level + 1);
+ });
+ }
+ else if (is (value,string) || is (value,integer) || is (value,boolean))
+ {
+ if (key == content_key)
+ content = String::EscapeTags (tostring (value));
+ else
+ attr = attr + sformat (" %1=\"%2\"",
+ key, String::EscapeTags (tostring (value))
+ );
+ }
+ });
+ ret = ret + attr;
+ ret = ret + ((subret == "" && content == "")? "/>" : ">");
+ if (content != "")
+ ret = ret + content + sformat ("%1>", item_key);
+ else if (subret != "")
+ ret = ret + subret + "\n" + tab + sformat ("%1>", item_key);
return ret;
}
+
/**
* which keys in config.xml are not unique
*/
@@ -271,6 +288,14 @@
}
string key = descr["__key"]:"";
if (key == "") return "";
+
+ if (key == "__anyxml")
+ {
+ // workaround, used until everything is transformed into MapAny2XML
+ return MapAny2XML (
+ descr["__item"]:"", descr["__value"]:$[], descr["__level"]:0);
+ }
+
string ret = tab + "<" + key;
foreach (string subkey, any val, (map) descr, {
if (subkey == "__key" || non_unique_key[subkey]:false) return;
@@ -299,52 +324,6 @@
return ret;
}
- // argument for any_xml agent: key indicating content of element without
- // attributes
- string content_key = "__yast_content__";
-
- /**
- * convert YCP map (of type read from any_xml agent) to XML
- */
- string MapAny2XML (string item_key, map item_descr, integer level) {
-
- string tab = "";
- integer i = 0;
- while (i < level) {
- i = i + 1;
- tab = tab + " ";
- }
- string ret = tab + "<" + item_key;
- string attr = "";
- string subret = "";
- string content = "";
- foreach (string key, any value, (map) item_descr, {
-
- if (is (value, list))
- {
- foreach (map it_map, (list<map>) value, {
- subret = subret + "\n" + MapAny2XML (key, it_map, level + 1);
- });
- }
- else if (is (value,string) || is (value,integer) || is (value,boolean))
- {
- if (key == content_key)
- content = String::EscapeTags (tostring (value));
- else
- attr = attr + sformat (" %1=\"%2\"",
- key, String::EscapeTags (tostring (value))
- );
- }
- });
- ret = ret + attr;
- ret = ret + ((subret == "" && content == "")? "/>" : ">");
- if (content != "")
- ret = ret + content + sformat ("%1>", item_key);
- else if (subret != "")
- ret = ret + subret + "\n" + tab + sformat ("%1>", item_key);
- return ret;
- }
-
/**
* import the data from given config.xml
* @param directory where to look for config.xml
@@ -354,49 +333,61 @@
map ret = $[];
if (!FileUtils::Exists (base_path + "/config.xml"))
+ {
+ y2warning ("no such file %1/config.xml", base_path);
return ret;
+ }
map config = (map) SCR::Read (.kiwi, base_path + "/config.xml");
if (config == nil)
return ret;
- map packages = config["packages"]:$[];
-
- foreach (string key, [ "author", "contact", "image_type", "specification",
- "packagemanager", "version", "rpm-check-signatures", "rpm-force",
- "sizeunit", "type", "name", "repository", "defaultdestination",
- "schemeversion", "defaultroot", "inherit", "locale", "timezone",
- "keytable"],
- {
- if (config[key]:nil != nil)
- ret[key] = config[key]:nil;
- });
- if (haskey (config, "size"))
- ret["size"] = tointeger (config["size"]:"2700");
- if (haskey (config, "defaultdestination"))
- ret["iso-directory"] = config["defaultdestination"]:"";
- foreach (string user, map usermap, (map) config["users"]:$[], {
- if (!haskey (ret, "users"))
- ret["users"] = $[];
- any pwd = usermap["pwd"]:nil;
- boolean crypted = (pwd != nil);
- ret["users",user] = $[
- "home" : usermap["home"]:sformat ("/home/%1", user),
- "pwd" : (pwd == nil) ? user : pwd,
- "encrypted" : crypted,
- "group" : usermap["group"]:"",
- "username" : user,
- "id" : sformat ("%1", usermap["id"]:""),
- "gid" : sformat ("%1", usermap["gid"]:""),
- ];
- if (usermap["realname"]:"" != "")
- ret["users",user,"realname"] = usermap["realname"]:"";
- });
- map anyxml = (map) SCR::Read (.anyxml, base_path + "/config.xml");
+ // FIXME last remnant of .kiwi usage...
+ if (config["repository"]:nil != nil)
+ ret["repository"] = config["repository"]:nil;
+
+ // read rest of config.xml using more generic agent
+ map anyxml = (map) SCR::Read (.anyxml, $[
+ "file" : base_path + "/config.xml",
+ "args" : $[
+ "ForceArray" : 1,
+ "KeepRoot" : 1,
+ "KeyAttr" : [],
+ "ForceContent" : 1,
+ "ContentKey" : content_key,
+ ]
+ ]);
map image = anyxml["image",0]:$[];
+ ret["name"] = image["name"]:"";
+ ret["schemeversion"]= image["schemeversion"]:"2.0";
+ if (haskey (image, "inherit"))
+ ret["inherit"] = image["inherit"]:"";
+ ret["preferences"] = image["preferences"]:[];
+ ret["description"] = image["description"]:[];
+ ret["users"] = maplist (map gmap, (list<map>)image["users"]:[], {
+ // convert integer values to strings
+ gmap["user"] = maplist (map umap, (list<map>) gmap["user"]:[], {
+ if (umap["id"]:nil != nil)
+ umap["id"] = sformat ("%1", umap["id"]:nil);
+ // add internal info if password was already crypted
+ umap["encrypted"] = (umap["pwd"]:nil != nil);
+ return umap;
+ });
+ if (gmap["id"]:nil != nil)
+ gmap["id"] = sformat ("%1", gmap["id"]:nil);
+ return gmap;
+ });
ret["packages"] = image["packages"]:[];
ret["profiles"] = image["profiles"]:[];
ret["split"] = image["split"]:[];
+
+ // FIXME iso-directory should be used only when converting PC->IC
+ if (haskey (ret["preferences",0]:$[], "defaultdestination"))
+ {
+ ret["iso-directory"] =
+ ret["preferences",0,"defaultdestination",0,content_key]:"";
+ }
+
return ret;
}
@@ -417,7 +408,7 @@
KiwiConfig["defaultroot"] = chroot_dir;
}
- // for the order of keys in preferences section, see bug 355568
+ /*
map preferences = $[
"__key" : "preferences",
"__children" : [
@@ -462,31 +453,27 @@
]);
}
});
+ */
+ // generate a structure for Map2XML function
list write_list = [ $[
"__key" : "image",
"name" : KiwiConfig["name"]:"",
- "schemeversion" : KiwiConfig["schemeversion"]:"1.4",
+ "schemeversion" : KiwiConfig["schemeversion"]:"2.0",
"__children" : [
$[
- "__key" : "description",
- "type" : "system",
- "__children" : [
- $[
- "__key" : "author",
- "__value" : KiwiConfig["author"]:"",
- ],
- $[
- "__key" : "contact",
- "__value" : KiwiConfig["contact"]:"",
- ],
- $[
- "__key" : "specification",
- "__value" : KiwiConfig["specification"]:"",
- ],
- ],
+ "__key" : "__anyxml",
+ "__item" : "description",
+ "__value" : KiwiConfig["description",0]:$[],
+ "__level" : 1
+ ],
+// preferences,
+ $[
+ "__key" : "__anyxml",
+ "__item" : "preferences",
+ "__value" : KiwiConfig["preferences",0]:$[],
+ "__level" : 1
],
- preferences,
],
]];
if (KiwiConfig["inherit"]:"" != "")
@@ -494,98 +481,52 @@
if (size (KiwiConfig["profiles"]:[]) > 0)
{
write_list[0,"__children"] = add (write_list[0,"__children"]:[], $[
- "__key" : "profiles",
- "__children" : maplist (
- map profile, KiwiConfig["profiles",0,"profile"]:[], {
- return union ($[ "__key" : "profile"], profile);
- })
+ "__key" : "__anyxml",
+ "__item" : "profiles",
+ "__value" : KiwiConfig["profiles",0]:$[],
+ "__level" : 1
]);
}
if (haskey (KiwiConfig, "users"))
{
- map groups2users = $[];
- foreach (string user, map usermap,
- (map) KiwiConfig["users"]:$[],
- {
- string g = usermap["group"]:"";
- if (g == "")
- g = user == "root" ? "root" : "users";
- if (!haskey (groups2users, g))
- groups2users[g] = [];
- groups2users[g] = add (groups2users[g]:[], usermap);
- });
- foreach (string group, list userlist, groups2users, {
- write_list[0,"__children"] = add (write_list[0,"__children"]:[],
- get_group_value (group, (list<map>) userlist)
- );
+ foreach (map gmap, KiwiConfig["users"]:[], {
+ gmap["user"] = maplist (map umap, (list<map>) gmap["user"]:[], {
+ boolean encrypted = umap["encrypted"]:false;
+ umap["pwd"] = (umap["encrypted"]:false) ?
+ umap["pwd"]:"" :
+ crypt_password (umap["pwd"]:"");
+ if (haskey (umap, "encrypted"))
+ umap = remove (umap, "encrypted");
+ return umap;
+ });
+ write_list[0,"__children"] = add (write_list[0,"__children"]:[], $[
+ "__key" : "__anyxml",
+ "__item" : "users",
+ "__value" : gmap,
+ "__level" : 1
+ ]);
});
}
+// FIXME use __anyxml for repository
write_list[0,"__children"] = union (write_list[0,"__children"]:[],
maplist (string source, (list<string>) KiwiConfig["sources"]:[],
``(get_source_value (source, KiwiConfig))
)
);
- map image_packages = $[];
- list<map> profiles_packages = [];
- map bootstrap_packages = $[];
foreach (map packagemap, KiwiConfig["packages"]:[], {
- /* example of packagemap:
- $[
- "opensusePattern" : [
- $[ "name":"base" ],
- $[ "name":"x11" ]
- ],
- "package" : [ $[ "name":"zypper" ] ],
- "type" : "image",
- "profiles" : "KDE"
- ]*/
- map pmap = union (packagemap, $[
- "__key" : "packages",
+ if (size (packagemap["opensusePattern"]:[]) == 0 &&
+ size (packagemap["package"]:[]) == 0)
+ {
+ y2milestone ("no patterns/packages in %1", packagemap);
+ return;
+ }
+ write_list[0,"__children"] = add (write_list[0,"__children"]:[], $[
+ "__key" : "__anyxml",
+ "__item" : "packages",
+ "__value" : packagemap,
+ "__level" : 1
]);
- string type = pmap["type"]:"";
- pmap["__children"] = maplist (map p, pmap["package"]:[], ``(
- union (p, $[ "__key" : "package"]))
- );
- if (haskey (pmap, "package"))
- pmap = remove (pmap,"package");
- if (haskey (pmap, "ignore"))
- {
- pmap["__children"] = union (pmap["__children"]:[],
- maplist (map p, pmap["ignore"]:[], ``(
- union (p, $[ "__key" : "ignore"]))
- )
- );
- pmap = remove (pmap, "ignore");
- }
- if (haskey (pmap, "opensusePattern"))
- {
- pmap["__children"] = union (pmap["__children"]:[],
- maplist (map p, pmap["opensusePattern"]:[], ``(
- union (p, $[ "__key" : "opensusePattern"]))
- )
- );
- pmap = remove (pmap,"opensusePattern");
- }
- if (type == "bootstrap")
- bootstrap_packages = pmap;
- else if (type == "image" && pmap["profiles"]:"" == "")
- {
- image_packages = pmap;
- }
- else if (size (pmap["__children"]:[]) > 0)
- {
- profiles_packages = add (profiles_packages, pmap);
- }
- });
- if (image_packages != $[])
- write_list[0,"__children"] =
- add (write_list[0,"__children"]:[], image_packages);
- if (profiles_packages != [])
- write_list[0,"__children"] =
- union (write_list[0,"__children"]:[], profiles_packages);
- if (bootstrap_packages != $[])
- write_list[0,"__children"] =
- add (write_list[0,"__children"]:[], bootstrap_packages);
+ });
// generate the XML using current Map2XML function
string write_string = "<?xml version=\"1.0\"?>\n" +
@@ -605,8 +546,9 @@
config_dir = tmp_dir + "/" + KiwiConfig["name"]:"";
SCR::Execute (.target.mkdir, config_dir);
SCR::Write (.target.string, config_dir + "/config.xml", write_string);
- // config.xml may contain password
+ // config.xml may contain password, do not let other users read it
SCR::Execute (.target.bash, sformat ("chmod 600 %1/config.xml",config_dir));
+
foreach (string dir, ["root_dir", "config_dir"], {
foreach (string val, KiwiConfig[dir]:[], {
string realdir = config_dir + "/" + substring (dir, 0, search (dir, "_"));
@@ -659,8 +601,10 @@
`HSpacing(85),
`VWeight (2, `VBox (
`VSpacing(0.5),
- // label
- `ReplacePoint (`id (`rpl), `Left (`Label(_("Preparing for Image Creation")))),
+ `ReplacePoint (`id (`rpl),
+ // label
+ `Left (`Label(_("Preparing for Image Creation")))
+ ),
`VSpacing(0.5),
`LogView (`id (`log), "", 8, 0)
)),
@@ -668,7 +612,9 @@
`VSpacing(0.5),
`LogView (`id (`errlog), "", 8, 0),
`VSpacing(0.5),
- `ReplacePoint (`id (`rp), `PushButton (`id(`cancel),`opt(`key_F9), Label::CancelButton ())),
+ `ReplacePoint (`id (`rp),
+ `PushButton (`id(`cancel),`opt(`key_F9), Label::CancelButton ())
+ ),
`VSpacing(0.5)
))
), `HSpacing(1.5)
Modified: trunk/product-creator/src/complex.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/src/complex.ycp?rev=48304&r1=48303&r2=48304&view=diff
==============================================================================
--- trunk/product-creator/src/complex.ycp (original)
+++ trunk/product-creator/src/complex.ycp Fri Jun 13 16:30:50 2008
@@ -27,6 +27,7 @@
include "product-creator/helps.ycp";
include "product-creator/dialogs.ycp";
+ include "product-creator/routines.ycp";
/**
* Return a modification status
@@ -91,7 +92,7 @@
contents,
`HBox (
// push button label
- `PushButton(`id(`create_button), _("&Create Image")),
+ `PushButton(`id(`create_button), _("&Create Product")),
// menu button label
`MenuButton (`id (`kiwi), _("Cre&ate Image with KIWI..."), [
// push button label
@@ -582,19 +583,15 @@
if (d == "") return;
if (FileUtils::Exists (images_dir + "/" + d + "/config.xml"))
{
+ // FIXME now, we should read only type, name, version, size to
+ // make initial start faster
map config = Kiwi::ReadConfigXML (images_dir + "/" + d);
- if (config["image_type"]:"" != "system")
+ if (config["description",0,"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"]:$[], {
- task = type;
- if (data["primary"]:"" == "true")
- break;
- });
+ string task = get_current_task (config);
config["kiwi_configuration_" + task] = images_dir + "/" + d;
config["current_task"] = task;
@@ -603,7 +600,8 @@
Configurations[name] = config;
overview = add (overview, `item (
`id (name), name,
- config["version"]:"1", config["size"]:0
+ get_preferences (config, "version", "1.0.0"),
+ get_preferences (config, "size", 0)
));
}
});
@@ -649,7 +647,8 @@
if (size (overview) > 0)
{
string current = (string) UI::QueryWidget(`id(`table), `CurrentItem);
- string val = Configurations[current,"specification"]:"";
+ string val = get_description (
+ Configurations[current]:$[], "specification");
UI::ChangeWidget (`id (`descr), `Value,
mergestring (splitstring(String::EscapeTags (val), "\n"), "<br>"));
}
@@ -657,18 +656,15 @@
any ret = nil;
while(true) {
- ret = UI::UserInput();
- string current = (string) UI::QueryWidget(`id(`table), `CurrentItem );
+ map event = UI::WaitForEvent ();
+ ret = event["ID"]:nil;
+
+ string current = (string) UI::QueryWidget(`id(`table), `CurrentItem );
if(ret == `abort || ret == `cancel) {
if(ProductCreator::ReallyAbort()) break;
else continue;
}
- else if (ret == `table)
- {
- UI::ChangeWidget (`id (`descr), `Value,
- Configurations[current,"specification"]:"");
- }
else if (ret == `add)
{
ProductCreator::Config = $[];
@@ -693,7 +689,14 @@
UI::ChangeWidget (`id (`table), `Items, overview);
}
}
- else if (ret == `edit)
+ else if (ret == `table)
+ {
+ UI::ChangeWidget (`id (`descr), `Value,
+ get_description (Configurations[current]:$[], "specification"));
+ if (event["EventReason"]:"" == "Activated")
+ ret = `edit;
+ }
+ if (ret == `edit)
{
ProductCreator::Config = Configurations[current]:$[];
string task = ProductCreator::Config["current_task"]:"";
@@ -709,13 +712,9 @@
}
continue;
}
- else if (ret == `next || ret == `back) {
+ if (ret == `next || ret == `back) {
break;
}
- else {
- y2error("unexpected retcode: %1", ret);
- continue;
- }
}
if (ret == `kiwi)
{
Modified: trunk/product-creator/src/helps.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/src/helps.ycp?rev=48304&r1=48303&r2=48304&view=diff
==============================================================================
--- trunk/product-creator/src/helps.ycp (original)
+++ trunk/product-creator/src/helps.ycp Fri Jun 13 16:30:50 2008
@@ -65,8 +65,7 @@
") +
// overview dialog help part 4
-_("<p>Use <b>Create Image</b> to create the ISO image or directory with your
-configured product.</p>") +
+_("<p>Use <b>Create Product</b> to create the ISO image or installation repository directory with selected product.</p>") +
// overview dialog help part 5
_("<p>Press <b>Create Image with KIWI</b> for additional configuration of various
Modified: trunk/product-creator/src/kiwi_dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/src/kiwi_dialogs.ycp?rev=48304&r1=48303&r2=48304&view=diff
==============================================================================
--- trunk/product-creator/src/kiwi_dialogs.ycp (original)
+++ trunk/product-creator/src/kiwi_dialogs.ycp Fri Jun 13 16:30:50 2008
@@ -26,6 +26,7 @@
import "Wizard";
include "product-creator/dialogs.ycp";
+ include "product-creator/routines.ycp";
// map of current image configuration
map KiwiConfig = $[];
@@ -33,6 +34,8 @@
// what are we configuring now ("iso"/"xen"/...)
string kiwi_task = "";
+ string content_key = Kiwi::content_key;
+
// return the id of actual widget for boot image
string boot_image_widget () {
return kiwi_task + "boot";
@@ -316,14 +319,18 @@
* initialize the value of version
*/
define void InitVersion (string id) {
- UI::ChangeWidget (`id (id), `Value, sformat ("%1", KiwiConfig[id]:"1.0.0"));
+ UI::ChangeWidget (`id (id), `Value,
+ get_preferences (KiwiConfig, "version", "1.0.0")
+ );
}
/**
* store the value of current version
*/
define void StoreVersion (string key, map event) {
- KiwiConfig[key] = sformat ("%1", UI::QueryWidget(`id(key), `Value));
+ KiwiConfig["preferences",0,"version"] = [ $[
+ content_key : sformat ("%1", UI::QueryWidget(`id(key), `Value))
+ ]];
}
/**
@@ -339,8 +346,9 @@
* initialize the value of combo box with isoboot items
*/
define void InitSizeUnitCombo (string id) {
+ string unit = KiwiConfig["preferences",0,"size",0,"unit"]:"M";
UI::ChangeWidget (`id (id), `Items, maplist (string u, [ "M", "G" ], ``(
- `item (`id (u), u + "B", KiwiConfig[id]:"M" == u))
+ `item (`id (u), u + "B", unit == u))
));
}
@@ -348,7 +356,28 @@
* initialize the value of version
*/
define void InitSize (string id) {
- UI::ChangeWidget (`id (id), `Value, KiwiConfig[id]:2700);
+ integer siz = tointeger (get_preferences (KiwiConfig, "size", "2000"));
+ if (siz == nil) siz = 2000;
+ UI::ChangeWidget (`id (id), `Value, siz);
+ }
+
+ /**
+ * store the size value
+ */
+ define void StoreSize (string key, map event) {
+ KiwiConfig["preferences",0,"size"] = [ $[
+ content_key : sformat ("%1", UI::QueryWidget(`id(key), `Value)),
+ "unit" : UI::QueryWidget (`id ("sizeunit"), `Value)
+ ]];
+ }
+
+ /**
+ * handler for size widget: store value on exit/save
+ */
+ define symbol HandleSize (string key, map event) {
+ // store the value on exiting
+ if (event["ID"]:nil == `next) StoreSize (key, event);
+ return nil;
}
/**
@@ -362,28 +391,51 @@
/**
* universal widget: initialize the string value of widget @param
*/
- define void InitDescription (string id) {
+ define void InitGeneric (string id) {
UI::ChangeWidget (`id (id), `Value, KiwiConfig[id]:"");
}
/**
* store the string value of given widget
*/
- define void StoreDescription (string key, map event) {
+ define void StoreGeneric (string key, map event) {
KiwiConfig[key] = UI::QueryWidget (`id(key), `Value);
}
/**
* handler for general string-value widgets: store their value on exit/save
*/
- define symbol HandleDescription (string key, map event) {
+ define symbol HandleGeneric (string key, map event) {
// store the value on exiting
- if (event["ID"]:nil == `next) StoreDescription (key, event);
+ if (event["ID"]:nil == `next) StoreGeneric (key, event);
return nil;
}
- define void InitOutputDir (string id) {
- UI::ChangeWidget (`id (id), `Value, KiwiConfig["iso-directory"]:"");
+ /**
+ * initialize the string value of "description" related widget
+ */
+ define void InitDescription (string id) {
+ UI::ChangeWidget (`id (id), `Value,
+ KiwiConfig["description",0,id,0,content_key]:""
+ );
+ }
+
+ /**
+ * store the string value of "description" related given widget
+ */
+ define void StoreDescription (string key, map event) {
+ KiwiConfig["description",0,key] = [ $[
+ content_key : UI::QueryWidget (`id(key), `Value)
+ ]];
+ }
+
+ /**
+ * handler for string-value "description" related widgets: store on exit/save
+ */
+ define symbol HandleDescription (string key, map event) {
+ // store the value on exiting
+ if (event["ID"]:nil == `next) StoreDescription (key, event);
+ return nil;
}
/**
@@ -391,16 +443,23 @@
*/
define void InitUsersTable (string id) {
- list items = maplist (string user, map usermap,
- (map) KiwiConfig["users"]:$[], ``(
- `item (`id (user),
- user, usermap["realname"]:"",
- sformat ("%1", usermap["id"]:""),
+ list items = [];
+ foreach (map groupmap, (list<map>) KiwiConfig["users"]:[], {
+ string group = groupmap["group"]:"";
+ string gid = groupmap["id"]:"";
+ foreach (map usermap, (list<map>) groupmap["user"]:[], {
+ items = add (items,
+ `item (
+ `id (usermap["name"]:""),
+ usermap["name"]:"",
+ usermap["realname"]:"",
+ usermap["id"]:"",
usermap["home"]:"",
- usermap["group"]:"users", usermap["gid"]:""
- )
- )
- );
+ group, gid
+ )
+ );
+ });
+ });
UI::ChangeWidget (`id ("table"), `Items, items);
UI::ChangeWidget (`id ("edituser"), `Enabled, size (items) > 0);
UI::ChangeWidget (`id ("deleteuser"), `Enabled, size (items) > 0);
@@ -410,29 +469,47 @@
* Handle changes in users table
*/
define symbol HandleAddEditUser (string key, map event) {
- if (event["ID"]:nil != key && (key != "userstable" || event["ID"]:nil != "table")) return nil;
+ if (event["ID"]:nil != key &&
+ (key != "userstable" || event["ID"]:nil != "table"))
+ return nil;
if (key == "userstable") key = "edituser";
- string current_user = (string) UI::QueryWidget (`id ("table"), `CurrentItem);
- map user_map = KiwiConfig["users", current_user]:$[];
-
+ string current_user = (string) UI::QueryWidget (`id ("table"),`CurrentItem);
+ map user_map = $[];
+ map group_map = $[];
+ if (key == "edituser")
+ {
+ foreach (map gmap, (list<map>) KiwiConfig["users"]:[], {
+ user_map = find (map umap, (list<map>) gmap["user"]:[],
+ ``(current_user == umap["name"]:"")
+ );
+ if (user_map != $[] && user_map != nil)
+ {
+ group_map = gmap;
+ break;
+ }
+ });
+ }
+ // store original names
+ string user = user_map["name"]:"";
+ string group = group_map["group"]:"";
UI::OpenDialog (`opt(`decorated), `HBox (`HSpacing (0.5), `VBox (
`VSpacing (0.5),
// popup label
`Label (`id (`label), _("Add new user")),
// text entry label
- `TextEntry (`id (`username), _("Login &Name")),
+ `InputField (`id (`username), `opt (`hstretch), _("Login &Name")),
// text entry label
- `TextEntry (`id (`realname), _("&Full Name")),
+ `InputField (`id ("realname"), `opt (`hstretch),_("&Full Name")),
`Password (`id (`pw1), `opt (`hstretch), Label::Password(), ""),
`Password (`id(`pw2), `opt (`hstretch), Label::ConfirmPassword(), ""),
// text entry label
- `TextEntry (`id (`home), _("&Home Directory")),
+ `InputField (`id ("home"), `opt (`hstretch), _("&Home Directory")),
// text entry label
- `InputField (`id (`uid), `opt (`hstretch), _("&UID")),
+ `InputField (`id ("id"), `opt (`hstretch), _("&UID")),
`HBox (
// text entry label
- `TextEntry (`id (`group), _("&Group Name")),
+ `InputField (`id (`group), `opt (`hstretch), _("G&roup Name")),
// text entry label
`InputField (`id (`gid), `opt (`hstretch), _("&GID"))
),
@@ -442,16 +519,16 @@
),
`VSpacing (0.5)), `HSpacing (0.5))
);
- UI::ChangeWidget (`id (`uid), `ValidChars, String::CDigit ());
+ UI::ChangeWidget (`id ("id"), `ValidChars, String::CDigit ());
UI::ChangeWidget (`id (`gid), `ValidChars, String::CDigit ());
if (key == "edituser")
{
UI::ChangeWidget (`id (`username), `Value, current_user);
- UI::ChangeWidget (`id (`realname), `Value, user_map["realname"]:"");
- UI::ChangeWidget (`id (`home), `Value, user_map["home"]:"");
- UI::ChangeWidget (`id (`group), `Value, user_map["group"]:"users");
- UI::ChangeWidget (`id (`uid), `Value, user_map["id"]:"");
- UI::ChangeWidget (`id (`gid), `Value, user_map["gid"]:"");
+ UI::ChangeWidget (`id ("realname"), `Value, user_map["realname"]:"");
+ UI::ChangeWidget (`id ("home"), `Value, user_map["home"]:"");
+ UI::ChangeWidget (`id ("id"), `Value, user_map["id"]:"");
+ UI::ChangeWidget (`id (`gid), `Value, group_map["id"]:"");
+ UI::ChangeWidget (`id (`group), `Value, group_map["group"]:"");
if (user_map["pwd"]:"" != "")
{
UI::ChangeWidget (`id (`pw1), `Value, user_map["pwd"]:"");
@@ -466,8 +543,10 @@
ret = UI::UserInput ();
if (ret == `ok)
{
- string username = (string) UI::QueryWidget (`id(`username), `Value);
- string pwd = (string) UI::QueryWidget (`id(`pw1), `Value);
+ string username = (string) UI::QueryWidget (`id (`username),`Value);
+ string pwd = (string) UI::QueryWidget (`id(`pw1), `Value);
+ string new_group = (string) UI::QueryWidget (`id (`group),`Value);
+ string gid = (string) UI::QueryWidget (`id (`gid),`Value);
if (username == "")
{
// popup message
@@ -483,32 +562,68 @@
ret = `notnext;
continue;
}
- /* password can be empty
- if (pwd == "")
- {
- // popup message
- Report::Error (_("Enter the user password."));
- ret = `notnext;
- continue;
- }
- */
- if (! haskey (KiwiConfig, "users"))
- KiwiConfig["users"] = $[];
- else if (key == "edituser" && username != current_user)
- KiwiConfig["users"] = remove (KiwiConfig["users"]:$[], current_user);
- string group = (string) UI::QueryWidget (`id(`group), `Value);
- if (group == "")
- group = username == "root" ? "root" : "users";
- KiwiConfig["users", username] = $[
- "pwd" : pwd,
+ // ok, now update the structures
+ user_map = $[
+ "pwd" : pwd,
"encrypted" : false,
- "home" : UI::QueryWidget (`id(`home), `Value),
- "realname" : UI::QueryWidget (`id(`realname), `Value),
- "group" : group,
- "username" : username,
- "id" : UI::QueryWidget (`id(`uid), `Value),
- "gid" : UI::QueryWidget (`id(`gid), `Value)
+ "name" : username,
];
+ foreach (string key, ["home", "realname", "id"], {
+ if (UI::QueryWidget (`id (key), `Value) != "")
+ user_map[key] = UI::QueryWidget (`id(key), `Value);
+ });
+
+ if (new_group == "")
+ new_group = (username == "root") ? "root" : "users";
+
+ boolean group_modified = false;
+ KiwiConfig["users"] = maplist (map gmap,
+ (list<map>) KiwiConfig["users"]:[],
+ {
+ // the group is already defined
+ if (gmap["group"]:"" == new_group)
+ {
+ if (gid != "")
+ gmap["id"] = gid;
+ boolean user_modified = false;
+ gmap["user"] = maplist (
+ map umap, (list<map>) gmap["user"]:[],
+ {
+ if (umap["name"]:nil == user ||
+ umap["name"]:nil == username)
+ {
+ umap = user_map;
+ user_modified = true;
+ }
+ return umap;
+ });
+ if (!user_modified)
+ gmap["user"] = add (gmap["user"]:[], user_map);
+ group_modified = true;
+ }
+ // remove user from original group (= group was 'renamed')
+ else if (gmap["group"]:"" == group)
+ {
+ gmap["user"] = filter (
+ map umap, (list<map>) gmap["user"]:[],
+ {
+ return (umap["name"]:nil != user);
+ });
+ }
+ return gmap;
+ });
+ if (!group_modified)
+ {
+ if (KiwiConfig["users"]:[] == [])
+ KiwiConfig["users"] = [];
+ group_map = $[ "group": new_group, "user" : [ user_map ]];
+ if (gid != "")
+ group_map["id"] = gid;
+ KiwiConfig["users"] = add (KiwiConfig["users"]:[], group_map);
+ }
+ // remove empty groups
+ KiwiConfig["users"] = filter (map gmap,
+ (list<map>) KiwiConfig["users"]:[], ``(gmap["user"]:[] != []));
}
} until (ret == `ok || ret == `cancel);
@@ -523,8 +638,24 @@
define symbol HandleDeleteUser (string key, map event) {
if (event["ID"]:nil != key) return nil;
- string current_user = (string) UI::QueryWidget (`id ("table"), `CurrentItem);
- KiwiConfig["users"] = remove (KiwiConfig["users"]:$[], current_user);
+ string current_user = (string) UI::QueryWidget(`id ("table"), `CurrentItem);
+ boolean is_empty = false;
+ KiwiConfig["users"] = maplist (map gmap, (list<map>) KiwiConfig["users"]:[],
+ {
+ gmap["user"] = filter (map umap, (list<map>) gmap["user"]:[],
+ ``(umap["name"]:"" != current_user)
+ );
+ if (size (gmap["user"]:[]) == 0)
+ is_empty = true;
+ return gmap;
+ });
+ if (is_empty)
+ {
+ // remove empty groups
+ KiwiConfig["users"] = filter (map gmap, (list<map>)
+ KiwiConfig["users"]:[], ``(gmap["user"]:[] != [])
+ );
+ }
InitUsersTable ("table");
return nil;
}
@@ -534,8 +665,8 @@
*/
define void InitRootDirTable (string id) {
- list items = maplist (string file, (list<string>) KiwiConfig["root_dir"]:[], {
-// return `item (`id (file), substring (file, findlastof (file, "/") + 1));
+ list items = maplist (string file, (list<string>) KiwiConfig["root_dir"]:[],
+ {
return `item (`id (file), file);
});
UI::ChangeWidget (`id ("roottable"), `Items, items);
@@ -560,7 +691,8 @@
define symbol HandleDeleteFromRootDir (string key, map event) {
if (event["ID"]:nil != key) return nil;
string current = (string) UI::QueryWidget (`id ("roottable"), `Value);
- KiwiConfig["root_dir"] = filter (string f, KiwiConfig["root_dir"]:[], ``(f != current));
+ KiwiConfig["root_dir"] =
+ filter (string f, KiwiConfig["root_dir"]:[], ``(f != current));
InitRootDirTable ("roottable");
return nil;
}
@@ -570,8 +702,8 @@
*/
define void InitConfigDirTable (string id) {
- list items = maplist (string file, (list<string>) KiwiConfig["config_dir"]:[], {
-// return `item (`id (file), substring (file, findlastof (file, "/") + 1));
+ list items = maplist (string file,(list<string>)KiwiConfig["config_dir"]:[],
+ {
return `item (`id (file), file);
});
UI::ChangeWidget (`id ("configtable"), `Items, items);
@@ -586,7 +718,7 @@
string dir = UI::AskForExistingFile ("", "", _("Script to Import"));
if (dir!= nil)
{
- KiwiConfig["config_dir"] = union (KiwiConfig["config_dir"]:[], [dir]);
+ KiwiConfig["config_dir"] = union (KiwiConfig["config_dir"]:[], [dir]);
InitConfigDirTable ("configtable");
}
return nil;
@@ -612,7 +744,7 @@
if (dir!= nil)
{
UI::ChangeWidget (`id (key), `Value, dir);
- StoreDescription (key, $[]);
+ StoreGeneric (key, $[]);
}
return dir;
}
@@ -638,16 +770,6 @@
}
/**
- * handler for output directory browse
- */
- symbol HandleBrowseOutputDirectory (string key, map event) {
- if (event["ID"]:nil != key) return nil;
- // popup for file selection dialog
- BrowseDirectoryHandler ("output_dir", _("Path to the Output Directory"));
- return nil;
- }
-
- /**
* universal handler for file browsing
*/
string BrowseFileHandler (string key, string label) {
@@ -658,7 +780,7 @@
if (file != nil && key != "config.sh")
{
UI::ChangeWidget (`id (key), `Value, file);
- StoreDescription (key, $[]);
+ StoreGeneric (key, $[]);
}
return file;
}
@@ -698,7 +820,7 @@
if (configsh != nil)
{
UI::ChangeWidget (`id ("config.sh"), `Value, configsh);
- StoreDescription ("config.sh", event);
+ StoreGeneric ("config.sh", event);
}
}
}
@@ -721,7 +843,7 @@
if (imagessh != nil)
{
UI::ChangeWidget (`id ("images.sh"), `Value, imagessh);
- StoreDescription ("images.sh", event);
+ StoreGeneric ("images.sh", event);
}
}
}
@@ -947,11 +1069,33 @@
if (haskey (KiwiConfig, "type"))
KiwiConfig = remove (KiwiConfig, "type");
KiwiConfig = (map) union (KiwiConfig, read_config);
- // for new configuration, do not read all from the template
+ // do not read everything from the template, use the data defined in
+ // Product Creator
y2milestone ("product-creator based configuration...");
- foreach (string key, ["addons", "packages", "sources"], {
- KiwiConfig[key] = ProductCreator::Config[key]:[];
+
+ KiwiConfig["sources"] = ProductCreator::Config["sources"]:[];
+
+ // find the set with 'image' packages
+ integer index = 0;
+ integer i = -1;
+ foreach (map set, (list<map>) KiwiConfig["packages"]:[], {
+ i = i + 1;
+ if (set["type"]:"" == "image")
+ {
+ index = i;
+ break;
+ }
});
+ map sw_contents = KiwiConfig["packages",index]:$[];
+ sw_contents["opensusePattern"] = maplist (string name,
+ ProductCreator::Config["addons"]:[], ``($[ "name" : name]));
+ sw_contents["package"] = maplist (string name,
+ ProductCreator::Config["packages"]:[], ``($[ "name" : name]));
+ sw_contents["ignore"] = maplist (string name,
+ ProductCreator::Config["taboo"]:[], ``($[ "name" : name]));
+
+ KiwiConfig["packages",index] = sw_contents;
+
KiwiConfig["name"] = ProductCreator::Config["name"]:"";
}
else
@@ -959,16 +1103,40 @@
y2milestone ("imported configuration...");
// ignore options already set earlier...
foreach (string key, any val, read_config, {
- if (!contains (["name", "iso-directory", "sources", "version",
- "type"],key))
+ if (!contains (["name", "sources", "version", "preferences"],key))
{
KiwiConfig[key] = val;
}
});
- // "sources" are already there...
- foreach (string key, ["addons", "packages"], {
- ProductCreator::Config[key] = KiwiConfig[key]:[];
+ list<map> pref = KiwiConfig["preferences"]:[];
+ // new configuration doesn't get preferences at all...
+ if (pref == [])
+ {
+ pref = read_config["preferences"]:[];
+ pref[0,"version"] = [ $[
+ content_key : "1.0.0"
+ ]];
+ }
+ // set the primary building target according to kiwi_task
+ KiwiConfig["preferences",0,"type"] = maplist (
+ map typemap, (list<map>)pref[0,"type"]:[],
+ {
+ string type = typemap[content_key]:"";
+ if (typemap["primary"]:false && type != kiwi_task)
+ typemap = remove (typemap, "primary");
+ else if (type == kiwi_task)
+ typemap["primary"] = true;
+ return typemap;
});
+ // save the info about packages and patterns into ProductCreator::Config
+ // ("sources" are already there...)
+ map sw_contents = KiwiConfig["packages",0]:$[];
+ ProductCreator::Config["addons"] = maplist (
+ map pat, sw_contents["opensusePattern"]:[], ``(pat["name"]:""));
+ ProductCreator::Config["packages"] = maplist (
+ map pat, sw_contents["package"]:[], ``(pat["name"]:""));
+ ProductCreator::Config["taboo"] = maplist (
+ map pat, sw_contents["ignore"]:[], ``(pat["name"]:""));
}
map label2boot = $[
@@ -978,6 +1146,8 @@
"SUSE Linux 10.1" : "suse-10.1",
"SUSE Linux Enterprise Server 10" : "suse-SLES10",
"SUSE Linux Enterprise Desktop 10" : "suse-SLED10",
+ "SUSE Linux Enterprise Desktop 10 SP2" : "suse-SLED10-SP2",
+ "SUSE Linux Enterprise Server 10 SP2" : "suse-SLES10-SP2",
];
map distproduct2boot = $[
"openSUSE-10.2-CD-download" : "suse-10.2",
@@ -988,7 +1158,9 @@
"SUSE-Linux-Enterprise-Server-i386" : "suse-SLES10",
"SUSE-Linux-Enterprise-Desktop-i386" : "suse-SLED10",
"SUSE-Linux-Enterprise-Server-SP1" : "suse-SLES10-SP1",
- "SUSE-Linux-Enterprise-Desktop-SP1" : "suse-SLED10-SP1"
+ "SUSE-Linux-Enterprise-Desktop-SP1" : "suse-SLED10-SP1",
+ "SUSE-Linux-Enterprise-Server-SP2" : "suse-SLES10-SP2",
+ "SUSE-Linux-Enterprise-Desktop-SP2" : "suse-SLED10-SP2",
];
string boot_image = label2boot[content["LABEL"]:""]:"";
if (boot_image == "")
@@ -1015,8 +1187,6 @@
KiwiConfig["xenboot"] = boot_image;
}
string name = KiwiConfig["name"]:"";
- if (!haskey (KiwiConfig, "specification"))
- KiwiConfig["specification"] = KiwiConfig["name"]:"";
Popup::ClearFeedback ();
}
@@ -1087,8 +1257,6 @@
`VBox (
"general_users",
`VSpacing (0.2),
-// "group",
- `VSpacing (0.2),
"userstable",
`VSpacing (0.2),
`HBox ("adduser", "edituser", "deleteuser", `HStretch ()),
@@ -1160,23 +1328,6 @@
"store" : StoreCompressCheckBox,
"handle" : HandleCompressCheckBox,
],
- /*
- "sw_selection" : kiwi_task == "xen" ? $[
- "widget" : `combobox,
- "opt" : [ `hstretch, `notify ],
- // combo box label
- "label" : _("So&ftware Selection"),
- // help text for "So&ftware selection"
- "help" : "",
- "items" : [],
- "init" : InitSWSelectionCombo,
- "store" : StoreSWSelectionCombo,
- "handle" : HandleSWSelectionCombo,
- ] : $[
- "widget" : `empty,
- "no_help" : true,
- ],
- */
"sw_selection" : $[
"widget" : `combobox,
"opt" : [ `hstretch, `notify ],
@@ -1222,19 +1373,6 @@
// help text for "&Ignored software"
"help" : _("<p>Each entry of <b>Packages to Delete</b> is one package name to be uninstalled from the target image.</p>"),
],
- "output_dir" : $[
- "widget" : `textentry,
- // textentry label
- "label" : _("O&utput Directory"),
- "help" : _("help for output dir"),
- "init" : InitOutputDir,
- ],
- "browse_output_dir" : $[
- "widget" : `push_button,
- "label" : Label::BrowseButton (),
- "help" : "",
- "handle" : HandleBrowseOutputDirectory
- ],
"version" : $[
"widget" : `textentry,
// textentry label
@@ -1252,8 +1390,8 @@
"label" : _("&Size"),
"help" : _("<p>Set the image <b>Size</b> in the specified <b>Unit</b>.</p>"),
"init" : InitSize,
- "store" : StoreDescription,
- "handle" : HandleDescription,
+ "store" : StoreSize,
+ "handle" : HandleSize,
],
"sizeunit" : $[
"widget" : `combobox,
@@ -1262,8 +1400,10 @@
"no_help" : true,
"items" : [],
"init" : InitSizeUnitCombo,
- "store" : StoreDescription,
- "handle" : HandleDescription,
+ /*
+ "store" : StoreGeneric,
+ "handle" : HandleGeneric,
+ */
],
// ---------------- widgtes for directory structure
"general_scripts" : $[
@@ -1282,9 +1422,9 @@
"label" : _("Directory with System Configur&ation"),
// help text
"help" : _("<p>Define the path to the <b>Directory with System Configuration</b> (the <tt>root</tt> directory). The entire directory is copied into the root of the image tree using <tt>cp -a</tt>.</p>"),
- "init" : InitDescription,
- "store" : StoreDescription,
- "handle" : HandleDescription,
+ "init" : InitGeneric,
+ "store" : StoreGeneric,
+ "handle" : HandleGeneric,
],
"browse_root_dir" : $[
"widget" : `push_button,
@@ -1349,9 +1489,9 @@
// textentry label
"label" : _("I&mage Configuration Script"),
"help" : _("<p>Edit your <b>Image Configuration Script</b>, called <tt>config.sh</tt>. This script is run at the end of the installation but before the package scripts have run.</p>"),
- "init" : InitDescription,
- "store" : StoreDescription,
- "handle" : HandleDescription,
+ "init" : InitGeneric,
+ "store" : StoreGeneric,
+ "handle" : HandleGeneric,
],
"import_config.sh" : $[
"widget" : `push_button,
@@ -1365,9 +1505,9 @@
// textentry label
"label" : _("Pa&th to Directory with Scripts"),
"help" : _("<p>The optional <b>Directory with Scripts</b> (<tt>config</tt> directory) contains scripts that are run after the installation of all the image packages.</p>"),
- "init" : InitDescription,
- "store" : StoreDescription,
- "handle" : HandleDescription,
+ "init" : InitGeneric,
+ "store" : StoreGeneric,
+ "handle" : HandleGeneric,
],
"browse_config_dir" : $[
"widget" : `push_button,
@@ -1394,9 +1534,9 @@
// textentry label
"label" : _("C&leanup Script"),
"help" : _("<p>Edit your <b>Cleanup Script</b> (<tt>images.sh</tt>). This script is run at the beginning of the image creation process.</p>"),
- "init" : InitDescription,
- "store" : StoreDescription,
- "handle" : HandleDescription,
+ "init" : InitGeneric,
+ "store" : StoreGeneric,
+ "handle" : HandleGeneric,
],
"import_images.sh" : $[
"widget" : `push_button,
@@ -1628,7 +1768,8 @@
{
list type_its = [];
//solve `back here (=no import)
- foreach (string type, map data, Config["type"]:$[], {
+ foreach (map typemap, (list<map>) Config["preferences",0,"type"]:[], {
+ string type = typemap[content_key]:"";
type_its = add (type_its,
`item (`id (type), task2label[type]:type, type == kiwi_task));
});
@@ -1675,7 +1816,7 @@
Config =
(config == $[] ? Kiwi::ReadConfigXML (kiwi_configuration) : config);
- if (Config["image_type"]:"" != "system")
+ if (Config["description",0,"type"]:"" != "system")
{
y2warning ("%1 does not have 'system' image type, skipping", dir);
// error popup
@@ -1694,17 +1835,19 @@
}
else
{
- Config["version"] = "1.0.0";
+ Config = save_preferences (Config, "version", "1.0.0");
}
if (Config["iso-directory"]:"" != "")
UI::ChangeWidget(`id(`out_dir), `Value, Config["iso-directory"]:"");
update_repo_table ();
list type_its = supported_images != "template" ? default_type_items: [];
boolean primary = false;
- foreach (string type, map data, Config["type"]:$[], {
+
+ foreach (map typemap, (list<map>) Config["preferences",0,"type"]:[], {
+ string type = typemap[content_key]:"";
if (!primary)
kiwi_task = type;
- if (data["primary"]:"" == "true")
+ if (typemap["primary"]:false)
primary = true;
if ((supported_images == "" && !contains (present_types, type)) ||
supported_images == "template")
@@ -1729,8 +1872,9 @@
term contents = `VBox (
new_configuration ?
`VBox (
- // text entry label
- `TextEntry (`id (`config), _("&Kiwi configuration"), name),
+ `InputField (`id (`config), `opt (`hstretch),
+ // text entry label
+ _("&Kiwi configuration"), name),
`RadioButtonGroup (`id (`imp), `HBox (`HSpacing (), `VBox (
`VSpacing (0.2),
`Left (`RadioButton (`id ("rb_new"), `opt (`notify),
@@ -1765,8 +1909,9 @@
`ComboBox (`id (`type), `opt (`notify, `hstretch), _("I&mage Type"),
type_items),
`HBox (
- // text entry label
- `TextEntry (`id (`out_dir), _("&Output directory"), out_dir),
+ `InputField (`id (`out_dir), `opt (`hstretch),
+ // text entry label
+ _("&Output directory"), out_dir),
`VBox (
`Label (""),
`PushButton (`id (`browse), Label::BrowseButton ())
@@ -2063,7 +2208,7 @@
string to_install = "";
if (contains ([ "iso", "xen", "vmx", "usb" ], kiwi_task))
{
- string bootdir = Config["type",kiwi_task,"boot"]:"";
+ string bootdir = get_bootdir (Config, kiwi_task);
if (bootdir == "" ||
(!FileUtils::Exists ("/usr/share/kiwi/image/" + bootdir) &&
!FileUtils::Exists (bootdir))
@@ -2079,11 +2224,11 @@
break;
}
}
- string boot = Config["type",kiwi_task,"boot"]:"";
+ string boot = get_bootdir (Config, kiwi_task);
if (boot != "" && issubstring (boot, "/"))
{
string prefix = kiwi_task == "pxe" ? "net" : kiwi_task;
- Config[prefix + "boot"] = substring (boot, search (boot, "/") + 1);
+ Config[prefix + "boot"] = substring (boot, search (boot, "/") + 1);//FIXME this should not be needed...
}
if (ret == `next)
{
@@ -2096,6 +2241,8 @@
Config["_imported"] = true;
Config["iso-directory"] = out_dir +
(new_configuration ? "/" + name : "");
+ Config = save_preferences (
+ Config, "defaultdestination", Config["iso-directory"]:"");
Config["name"] = name;
Config["new_configuration"] = new_configuration;
Config["sources"] = maplist (
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org