Author: jsuchome
Date: Fri May 16 16:33:02 2008
New Revision: 47627
URL: http://svn.opensuse.org/viewcvs/yast?rev=47627&view=rev
Log:
- updated kiwi templates, added support for spit section,
fixed handling of ignored and deleted packages (bnc#343212)
- 2.16.17
Modified:
trunk/product-creator/VERSION
trunk/product-creator/package/yast2-product-creator.changes
trunk/product-creator/src/Kiwi.ycp
trunk/product-creator/src/kiwi_dialogs.ycp
Modified: trunk/product-creator/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/VERSION?rev=47627&r1=47626&r2=47627&view=diff
==============================================================================
--- trunk/product-creator/VERSION (original)
+++ trunk/product-creator/VERSION Fri May 16 16:33:02 2008
@@ -1 +1 @@
-2.16.16
+2.16.17
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=47627&r1=47626&r2=47627&view=diff
==============================================================================
--- trunk/product-creator/package/yast2-product-creator.changes (original)
+++ trunk/product-creator/package/yast2-product-creator.changes Fri May 16 16:33:02 2008
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Fri May 16 16:32:38 CEST 2008 - jsuchome@suse.cz
+
+- updated kiwi templates, added support for spit section,
+ fixed handling of ignored and deleted packages (bnc#343212)
+- 2.16.17
+
+-------------------------------------------------------------------
Tue May 6 17:51:04 CEST 2008 - ug@suse.de
- set "implicit" to "1" in the isolinux.cfg
Modified: trunk/product-creator/src/Kiwi.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/src/Kiwi.ycp?rev=47627&r1=47626&r2=47627&view=diff
==============================================================================
--- trunk/product-creator/src/Kiwi.ycp (original)
+++ trunk/product-creator/src/Kiwi.ycp Fri May 16 16:33:02 2008
@@ -64,6 +64,7 @@
*/
string crypt_password (string pw)
{
+ if (pw == "") return pw;
if (encryption_method == nil)
{
boolean progress = Progress::set (false);
@@ -190,6 +191,7 @@
ret["primary"] = "true";
return ret;
});
+ // create default values for new project
if (retlist == [])
{
map ret = $[
@@ -202,28 +204,14 @@
ret["filesystem"] = "ext3";
if (task == "vmx")
ret["format"] = "vmdk";
+ if (task == "iso" || task == "oem")
+ ret["flags"] = "unified";
retlist = [ ret ];
}
return retlist;
}
/**
- * generate the list of packages/patterns for image
- * FIXME generate from new map...
- */
- map get_image_packages (map config, list packages, list patterns,list ignored)
- {
- map ret = $[
- "__key" : "packages",
- "type" : "image",
- "__children": union (union (packages, patterns), ignored)
- ];
- if (config["image_patternType"]:"" != "")
- ret["patternType"] = config["image_patternType"]:"";
- return ret;
- }
-
- /**
* which keys in config.xml are not unique
*/
map non_unique_key = $[
@@ -247,7 +235,6 @@
integer i = 0;
while (i < level) {
i = i + 1;
-// tab = tab + "\t";
tab = tab + " ";
}
string key = descr["__key"]:"";
@@ -261,7 +248,7 @@
});
else if (subkey == "__value")
value = String::EscapeTags (sformat ("%1", val));
- else if (is (val, string))
+ else if (is (val, string) || is (val, integer))
ret = sformat ("%1 %2=\"%3\"",
ret, subkey, String::EscapeTags (tostring (val)));
});
@@ -273,10 +260,59 @@
ret = ret + ">";
if (children != "")
ret = ret + children + "\n";
+
+ if (level == 0 && key == "image") // ugly hack
+ return ret;
ret = sformat ("%1%2%3>", ret, haskey (descr, "__value") ? "" : tab, key);
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
@@ -293,12 +329,6 @@
return ret;
map packages = config["packages"]:$[];
- // FIXME these should be part of "packages" already...
- if (packages["xen","disk"]:"" != "")
- ret["xen_disk"] = packages["xen","disk"]:"";
- if (packages["xen","memory"]:"" != "")
- ret["xen_memory"] = tointeger (packages["xen","memory"]:"512");
-
foreach (string key, [ "author", "contact", "image_type", "specification",
"packagemanager", "version", "rpm-check-signatures", "rpm-force",
"sizeunit", "type", "name", "repository", "defaultdestination",
@@ -315,11 +345,11 @@
foreach (string user, map usermap, (map) config["users"]:$[], {
if (!haskey (ret, "users"))
ret["users"] = $[];
- string pwd = usermap["pwd"]:"";
- boolean crypted = (pwd != "");
+ any pwd = usermap["pwd"]:nil;
+ boolean crypted = (pwd != nil);
ret["users",user] = $[
"home" : usermap["home"]:sformat ("/home/%1", user),
- "pwd" : (pwd == "") ? user : pwd,
+ "pwd" : (pwd == nil) ? user : pwd,
"encrypted" : crypted,
"group" : usermap["group"]:"",
"username" : user,
@@ -354,36 +384,6 @@
KiwiConfig["defaultroot"] = chroot_dir;
}
- list packages_xen_list = [];
- list patterns_xen_list = [];
- list ignored_xen_list = [];
-
- foreach (string package, KiwiConfig["xen_packages"]:[], {
- packages_xen_list = add (packages_xen_list, $[
- "__key" : "package",
- "name" : package,
- ]);
- });
- foreach (string pattern, KiwiConfig["xen_patterns"]:[], {
- patterns_xen_list = add (patterns_xen_list, $[
- "__key" : "pattern",
- "name" : pattern,
- ]);
- });
- foreach (string ignore, KiwiConfig["xen_ignore"]:[], {
- ignored_xen_list = add (ignored_xen_list, $[
- "__key" : "ignore",
- "name" : ignore,
- ]);
- });
-
- list packages_delete_list = maplist (string package,
- KiwiConfig["delete_packages"]:[], ``($[
- "__key" : "package",
- "name" : package,
- ])
- );
-
// for the order of keys in preferences section, see bug 355568
map preferences = $[
"__key" : "preferences",
@@ -503,7 +503,7 @@
)
);
map image_packages = $[];
- list<map> profiles_packages = []; // + FIXME XEN + delete are here?
+ list<map> profiles_packages = [];
map bootstrap_packages = $[];
foreach (map packagemap, KiwiConfig["packages"]:[], {
/* example of packagemap:
@@ -546,9 +546,14 @@
if (type == "bootstrap")
bootstrap_packages = pmap;
else if (type == "image" && pmap["profiles"]:"" == "")
+ {
image_packages = pmap;
- else
+ }
+ else if (size (pmap["__children"]:[]) > 0)
+ {
+y2internal ("pmap: %1", pmap);
profiles_packages = add (profiles_packages, pmap);
+ }
});
if (image_packages != $[])
write_list[0,"__children"] =
@@ -559,45 +564,22 @@
if (bootstrap_packages != $[])
write_list[0,"__children"] =
add (write_list[0,"__children"]:[], bootstrap_packages);
- /*
- if (task == "xen")
- {
- write_list[0,"__children"] = add (write_list[0,"__children"]:[], $[
- "__key" : "packages",
- "type" : "xen",
- // FIXME disk and memory not configurable
- "disk" : KiwiConfig["xen_disk"]:"/dev/sda",
- "memory" : sformat ("%1", KiwiConfig["xen_memory"]:512),
- "__children": union (union (packages_xen_list, patterns_xen_list), ignored_xen_list)
- ]);
- }
- if (packages_delete_list != [])
+ // generate the XML using current Map2XML function
+ string write_string = "<?xml version=\"1.0\"?>\n" +
+ Map2XML (write_list[0]:$[], 0);
+
+ // now, add the rest, created using more generic MapAny2XML function
+ if (haskey (KiwiConfig, "split") && size (KiwiConfig["split"]:[]) > 0)
{
- write_list[0,"__children"] = add (write_list[0,"__children"]:[], $[
- "__key" : "packages",
- "type" : "delete",
- "__children": packages_delete_list
- ]);
+ string split = MapAny2XML ("split", KiwiConfig["split",0]:$[], 1);
+ if (split != "")
+ {
+ write_string = write_string + split + "\n";
+ }
}
- */
- if (haskey (KiwiConfig, "split"))
- write_list[0,"__children"] = add (write_list[0,"__children"]:[], $[
- "__key" : "split",
- /* FIXME
- "__children": maplist (map what, KiwiConfig["split"]:[], {
- map ret = $[];
- foreach (string k, list val, what, {
- ret["__key"] = k;
- ret
- });
- return ret;
- });
- */
- ]);
+ write_string = write_string + "</image>";
- string write_string = "<?xml version=\"1.0\"?>\n" +
- Map2XML (write_list[0]:$[], 0);
config_dir = tmp_dir + "/" + KiwiConfig["name"]:"";
SCR::Execute (.target.mkdir, config_dir);
SCR::Write (.target.string, config_dir + "/config.xml", write_string);
@@ -886,6 +868,5 @@
supported_boot_images = "";
return ReadImageTemplates ();
}
-
}
Modified: trunk/product-creator/src/kiwi_dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/src/kiwi_dialogs.ycp?rev=47627&r1=47626&r2=47627&view=diff
==============================================================================
--- trunk/product-creator/src/kiwi_dialogs.ycp (original)
+++ trunk/product-creator/src/kiwi_dialogs.ycp Fri May 16 16:33:02 2008
@@ -85,13 +85,47 @@
* Initialize the widget with packages intended for deletion
*/
define void InitSWDelete (string id) {
- UI::ChangeWidget (`id (id), `Value, mergestring (KiwiConfig["delete_packages"]:[], "\n"));
+
+ list<string> to_delete = [];
+ foreach (map pmap, KiwiConfig["packages"]:[], {
+ string type = pmap["type"]:"";
+ if (type == "delete")
+ {
+ to_delete = maplist (map pacmap, pmap["package"]:[], ``(
+ pacmap["name"]:"")
+ );
+ }
+ });
+ UI::ChangeWidget (`id (id), `Value, mergestring (to_delete, "\n"));
}
define void StoreSWDelete (string key, map event) {
- string ignore_key = "delete_packages";
- KiwiConfig[ignore_key] = filter (string p,
- splitstring ((string) UI::QueryWidget(`id(key), `Value), "\n"), ``(p != ""));
+
+ list<string> to_delete = filter (string p, splitstring (
+ (string) UI::QueryWidget (`id(key), `Value), "\n"), ``(p != "")
+ );
+ integer index = 0;
+ integer del_index = -1;
+ foreach (map pmap, KiwiConfig["packages"]:[], {
+ if (pmap["type"]:"" == "delete")
+ {
+ del_index = index;
+ break;
+ }
+ index = index + 1;
+ });
+
+ map sw_contents = KiwiConfig["packages",del_index]:$[];
+ if (del_index == -1)
+ {
+ sw_contents = $[ "type" : "delete" ];
+ del_index = size (KiwiConfig["packages"]:[]);
+ KiwiConfig["packages"] = add (KiwiConfig["packages"]:[], $[]);
+ }
+ sw_contents["package"] = maplist (string name, to_delete,
+ ``($[ "name" : name])
+ );
+ KiwiConfig["packages",del_index] = sw_contents;
}
define symbol HandleSWDelete (string key, map event) {
@@ -110,6 +144,7 @@
list packages = KiwiConfig["packages"]:[];
string pat = "";
string pac = "";
+ string ign = "";
if (size (packages[package_set,"opensusePattern"]:[]) > 0)
// richtext header
@@ -123,7 +158,13 @@
foreach (map pacmap, packages[package_set,"package"]:[], {
pac = Summary::AddListItem (pac, pacmap["name"]:"");
});
- UI::ChangeWidget (`id (id), `Value, pat + pac);
+ if (size (packages[package_set,"ignore"]:[]) > 0)
+ ign = Summary::AddHeader ("",
+ deletechars (_("&Ignored Software"), "&"));
+ foreach (map pacmap, packages[package_set,"ignore"]:[], {
+ ign = Summary::AddListItem (ign, pacmap["name"]:"");
+ });
+ UI::ChangeWidget (`id (id), `Value, pat + pac + ign);
}
/**
@@ -151,15 +192,14 @@
);
if (ret_map["ui"]:nil == `cancel)
return nil;
- sw_contents["opensusePattern"] = maplist (string patname,
- ret_map["addons"]:[], ``($[ "name" : patname]));
- sw_contents["package"] = maplist (string patname,
- ret_map["packages"]:[], ``($[ "name" : patname]));
- sw_contents["ignore"] = maplist (string patname,
- ret_map["taboo"]:[], ``($[ "name" : patname]));
+ sw_contents["opensusePattern"] = maplist (string name,
+ ret_map["addons"]:[], ``($[ "name" : name]));
+ sw_contents["package"] = maplist (string name,
+ ret_map["packages"]:[], ``($[ "name" : name]));
+ sw_contents["ignore"] = maplist (string name,
+ ret_map["taboo"]:[], ``($[ "name" : name]));
KiwiConfig["packages",package_set] = sw_contents;
InitSWRichText ("rt_sw");
-// InitSWIgnore ("ignore"); FIXME
}
return nil;
}
@@ -175,6 +215,13 @@
string type = pmap["type"]:"";
// combo box label
string label = _("Packages for Image");
+ if (type == "delete")
+ {
+ // combo box label
+ label = _("Packages to Delete");
+ i = i + 1; // index to list must be increased
+ return; // delete is handled by different widgets
+ }
if (type == "bootstrap")
// combo box label
label = _("Bootstrap");
@@ -184,14 +231,11 @@
else if (type == "testsuite")
// combo box label
label = _("Testing");
- else if (type == "delete")
- // combo box label
- label = _("Packages to Delete");
else if (type != "image")
label = type;
if (pmap["profiles"]:"" != "")
// combo box label, %1 is profile name
- label = sformat (_("Image, profile %1"), pmap["profiles"]:"");
+ label = sformat(_("Image, profile %1"),pmap["profiles"]:"");
items = add (items, `item (`id (i), label, package_set == i));
i = i + 1;
});
@@ -212,12 +256,11 @@
else if (event["ID"]:nil == key)
{
integer selected = (integer) UI::QueryWidget(`id(key), `Value);
- if (selected != KiwiConfig["package_set"]:0)
+ if (selected != KiwiConfig["package_set"]:-1)
{
-// StoreSWIgnore ("ignore", event); FIXME
+ KiwiConfig["package_set"] = selected;
StoreSWSelectionCombo (key, event);
InitSWRichText ("rt_sw");
-// InitSWIgnore ("ignore"); FIXME
}
}
return nil;
@@ -273,7 +316,7 @@
* initialize the value of version
*/
define void InitVersion (string id) {
- UI::ChangeWidget (`id (id), `Value, sformat ("%1", KiwiConfig[id]:"1"));
+ UI::ChangeWidget (`id (id), `Value, sformat ("%1", KiwiConfig[id]:"1.0.0"));
}
/**
@@ -747,7 +790,13 @@
define void InitImageConfiguration () {
kiwi_task = Kiwi::kiwi_task;
- string kiwi_dir = "/usr/share/kiwi/image/";
+
+
+ // path to definition of openSUSE live CD (used if kiwi-config-openSUSE-kde,
+ // resp. kiwi-config-openSUSE-gnome is installed)
+ string kiwi_dir = "/usr/share/openSUSE/kiwi-config-kde";
+ if (!FileUtils::Exists (kiwi_dir))
+ kiwi_dir = "/usr/share/openSUSE/kiwi-config-gnome";
// read the information from the base product
integer src_id = ProductCreator::checkProductDependency ();
@@ -757,17 +806,10 @@
// busy popup
Popup::ShowFeedback (_("Reading current image configuration..."), _("Please wait..."));
- map default_dirmap = $[
- "iso" : sformat ("%1/kwliveDVD-suse-10.3", kiwi_dir),
- "xen" : sformat ("%1/buildhost-suse-SLES10", kiwi_dir),
- "usb" : sformat ("%1/kwliveDVD-suse-10.3", kiwi_dir),
- "vmx" : sformat ("%1/kwliveDVD-suse-10.3", kiwi_dir),
- ];
-
// path to current config directory
- string default_dir = default_dirmap[kiwi_task]:"";
+ string default_dir = (kiwi_task == "iso") ? kiwi_dir : "";
string kiwi_configuration = KiwiConfig["kiwi_configuration_" + kiwi_task]:default_dir;
- if (!FileUtils::Exists (kiwi_configuration))
+ if (kiwi_configuration == "" || !FileUtils::Exists (kiwi_configuration))
{
// use local template if default dir does not exist (bug #289552)
if (!FileUtils::Exists (default_dir))
@@ -915,21 +957,14 @@
`VSpacing (0.2),
`HBox (
`HWeight (1, "version"),
- `HWeight (1, `HBox ("size", "sizeunit")),
+ `HWeight (1, `HBox ("size", "sizeunit"))
+ /*
`VBox (
`Label (""), "compressed"
+ FIXME compressed vs. unified
)
+ */
),
- /*
- "sw_selection",
- `HBox (
- `HWeight (1, `VBox (
- `Left (`Label (_("Installed Software"))),
- "rt_sw", `Right ("configure_sw")
- ))
-// `HWeight (1, `VBox ("ignore", "delete_sw"))
- ),
- */
`HBox (
`HWeight (2, `VBox (
"sw_selection",
@@ -937,18 +972,16 @@
"rt_sw",
`Right ("configure_sw")
)),
-// `HWeight (1, "delete_sw")
- `HWeight (1, "ignore")
+ `HWeight (1, "delete_sw")
),
`VSpacing (0.2)
), `HSpacing(1)),
"widget_names" : [
"version",
- "size", "sizeunit", "compressed",
+ "size", "sizeunit", // "compressed",
"sw_selection",
"rt_sw", "configure_sw",
- "ignore",
-// "delete_sw",
+ "delete_sw",
],
],
"description" : $[
@@ -1326,17 +1359,6 @@
// general help for users tab
"help" : _("<p>Here, create users that should be available in the target system.</p>"),
],
- /*
- "group" : $[
- "widget" : `textentry,
- // textentry label
- "label" : _("&Group name"),
- "help" : _("<p>Select the <b>Group Name</b> to which the users belong.</p>"),
- "init" : InitDescription,
- "store" : StoreDescription,
- "handle" : HandleDescription,
- ],
- */
"userstable" : $[
"widget" : `custom,
"custom_widget" : `Table (`id("table"), `opt (`notify), `header(
@@ -1448,7 +1470,7 @@
map Config = ProductCreator::Config;
string kiwi_configuration = Config["kiwi_configuration_" + kiwi_task]:"";
string name = Config["name"]:"";
- string out_dir = Config["iso-directory"]:"";
+ string out_dir = Config["iso-directory"]:"/tmp";
map repositories = Kiwi::current_repositories;
boolean new_configuration = (Config == $[]);
boolean append_name = false;
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org