Mailinglist Archive: yast-commit (711 mails)

< Previous Next >
[yast-commit] r48332 - in /trunk/product-creator: VERSION agent-kiwi/ package/yast2-product-creator.changes src/Kiwi.ycp src/kiwi_dialogs.ycp yast2-product-creator.spec.in
  • From: jsuchome@xxxxxxxxxxxxxxxx
  • Date: Mon, 16 Jun 2008 12:31:13 -0000
  • Message-id: <20080616123113.37FAE24E26@xxxxxxxxxxxxxxxx>
Author: jsuchome
Date: Mon Jun 16 14:31:12 2008
New Revision: 48332

URL: http://svn.opensuse.org/viewcvs/yast?rev=48332&view=rev
Log:
- image-creator: removed dependency on ag_kiwi, use generci ag_anyxml
agent for reading config.xml
- correctly handle plaindir repository type
- 2.17.1


Removed:
trunk/product-creator/agent-kiwi/
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
trunk/product-creator/yast2-product-creator.spec.in

Modified: trunk/product-creator/VERSION
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/VERSION?rev=48332&r1=48331&r2=48332&view=diff
==============================================================================
--- trunk/product-creator/VERSION (original)
+++ trunk/product-creator/VERSION Mon Jun 16 14:31:12 2008
@@ -1 +1 @@
-2.17.0
+2.17.1

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=48332&r1=48331&r2=48332&view=diff
==============================================================================
--- trunk/product-creator/package/yast2-product-creator.changes (original)
+++ trunk/product-creator/package/yast2-product-creator.changes Mon Jun 16
14:31:12 2008
@@ -1,4 +1,12 @@
-------------------------------------------------------------------
+Mon Jun 16 14:20:55 CEST 2008 - jsuchome@xxxxxxx
+
+- image-creator: removed dependency on ag_kiwi, use generci ag_anyxml
+ agent for reading config.xml
+- correctly handle plaindir repository type
+- 2.17.1
+
+-------------------------------------------------------------------
Wed Jun 11 11:18:33 CEST 2008 - jsuchome@xxxxxxx

- image-creator: added support for UID, GID and user's full name

Modified: trunk/product-creator/src/Kiwi.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/src/Kiwi.ycp?rev=48332&r1=48331&r2=48332&view=diff
==============================================================================
--- trunk/product-creator/src/Kiwi.ycp (original)
+++ trunk/product-creator/src/Kiwi.ycp Mon Jun 16 14:31:12 2008
@@ -23,14 +23,16 @@
import "String";
import "URL";

- string encryption_method = nil;
-
/**
* argument for any_xml agent: key indicating content of element without
* attributes
*/
global string content_key = "__yast_content__";

+ include "product-creator/routines.ycp";
+
+ string encryption_method = nil;
+
// temporary directory, where kiwi is working
global string tmp_dir = "";

@@ -106,18 +108,7 @@
foreach (string url, map repo, current_repositories, {
if (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"]:"";
+ ret = repo["org"]:$[];
}
});
if (ret != $[])
@@ -147,17 +138,14 @@
}
}
});
- ret = $[
- "__key" : "repository",
- "type" : type,
- "__children": [
+ return $[
+ "source": [
$[
- "__key" : "source",
- "path" : adapt_source_path (source)
+ "path" : adapt_source_path (source),
]
- ]
+ ],
+ "type" : type
];
- return ret;
}

/**
@@ -168,54 +156,6 @@
}


- /**
- * generate the values for image type
- */
- list<map> get_type_values (map config, string task) {
-
- string boot_image = sformat ("%1boot/%2", task, config[task +
"boot"]:"suse-10.2");
- list<map> retlist = maplist (
- string type, map typemap, (map<string,map>)config["type"]:$[], {
-
- if (typemap["boot"]:"" != "")
- boot_image = typemap["boot"]:"";
-
- map ret = $[
- "__key" : "type",
- "__value" : type,
- "boot" : boot_image,
- ];
- if (type != "iso")
- ret["filesystem"] = typemap["filesystem"]:"ext3";
- if (typemap["flags"]:"" != "")
- ret["flags"] = typemap["flags"]:"";
- if (typemap["format"]:"" != "")
- ret["format"] = typemap["format"]:"";
- if (type == "vmx" && ret["format"]:"" == "")
- ret["format"] = "vmdk";
- if (type == task)
- ret["primary"] = "true";
- return ret;
- });
- // create default values for new project FIXME
- if (retlist == [])
- {
- map ret = $[
- "__key" : "type",
- "__value" : task,
- "boot" : boot_image,
- "primary" : "true"
- ];
- if (task != "iso")
- ret["filesystem"] = "ext3";
- if (task == "vmx")
- ret["format"] = "vmdk";
- if (task == "iso" || task == "oem")
- ret["flags"] = "unified";
- retlist = [ ret ];
- }
- return retlist;
- }

/**
* convert YCP map (of type read from any_xml agent) to XML
@@ -318,8 +258,10 @@
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;
}
@@ -338,14 +280,6 @@
return ret;
}

- map config = (map) SCR::Read (.kiwi, base_path + "/config.xml");
- if (config == nil)
- return ret;
-
- // 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",
@@ -381,6 +315,9 @@
ret["profiles"] = image["profiles"]:[];
ret["split"] = image["split"]:[];

+ if (image["repository"]:nil != nil)
+ ret["repository"] = image["repository"]:nil;
+
// FIXME iso-directory should be used only when converting PC->IC
if (haskey (ret["preferences",0]:$[], "defaultdestination"))
{
@@ -394,67 +331,20 @@
/**
* Write currect configuration to new config.xml
*/
- global boolean WriteConfigXML (map KiwiConfig, string task) {
+ global boolean WriteConfigXML (map<string,any> KiwiConfig, string task) {

all_sources = Pkg::SourceEditGet();
-
tmp_dir = Directory::tmpdir;
chroot_dir = tmp_dir + "/myphysical";
- if (KiwiConfig["defaultroot"]:"" != "")
+ string defaultroot = get_preferences (KiwiConfig, "defaultroot", "");
+ if (defaultroot != "")
{
- chroot_dir = KiwiConfig["defaultroot"]:"";
+ chroot_dir = defaultroot;
if (KiwiConfig["new_configuration"]:false)
chroot_dir = chroot_dir + "/" + KiwiConfig["name"]:"";
- KiwiConfig["defaultroot"] = chroot_dir;
+ KiwiConfig = save_preferences(KiwiConfig,"defaultroot",chroot_dir);
}

- /*
- map preferences = $[
- "__key" : "preferences",
- "__children" : [
- $[
- "__key" : "version",
- "__value" : KiwiConfig["version"]:"1",
- ],
- $[
- "__key" : "size",
- "unit" : KiwiConfig["sizeunit"]:"M",
- "__value" : sformat ("%1", KiwiConfig["size"]:2700),
- ],
- $[
- "__key" : "packagemanager",
- "__value" :
KiwiConfig["packagemanager"]:default_packagemanager
- ],
- $[
- "__key" : "rpm-check-signatures",
- "__value" : KiwiConfig["rpm-check-signatures"]:"False",
- ],
- $[
- "__key" : "rpm-force",
- "__value" : KiwiConfig["rpm-force"]:"True",
- ],
- ],
- ];
- // "type" goes to the first place
- foreach (map typemap, get_type_values (KiwiConfig, task), {
- preferences["__children"] = prepend (preferences["__children"]:[],
- typemap);
- });
- // iso-directory is the correct value, it could have been altered via UI
- KiwiConfig["defaultdestination"] = KiwiConfig["iso-directory"]:"";
- foreach (string key, [ "keytable", "timezone", "locale",
- "defaultdestination", "defaultroot" ],
- {
- if (KiwiConfig[key]:"" != "")
- {
- preferences["__children"] = add (preferences["__children"]:[], $[
- "__key" : key,
- "__value" : KiwiConfig[key]:"",
- ]);
- }
- });
- */
-
// generate a structure for Map2XML function
list write_list = [ $[
"__key" : "image",
@@ -467,7 +357,6 @@
"__value" : KiwiConfig["description",0]:$[],
"__level" : 1
],
-// preferences,
$[
"__key" : "__anyxml",
"__item" : "preferences",
@@ -507,12 +396,15 @@
]);
});
}
-// 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))
- )
- );
+ foreach (string source, KiwiConfig["sources"]:[], {
+ map sourcemap = get_source_value (source, KiwiConfig);
+ write_list[0,"__children"] = add (write_list[0,"__children"]:[], $[
+ "__key" : "__anyxml",
+ "__item" : "repository",
+ "__value" : sourcemap,
+ "__level" : 1
+ ]);
+ });
foreach (map packagemap, KiwiConfig["packages"]:[], {
if (size (packagemap["opensusePattern"]:[]) == 0 &&
size (packagemap["package"]:[]) == 0)
@@ -528,20 +420,19 @@
]);
});

- // 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)
{
- string split = MapAny2XML ("split", KiwiConfig["split",0]:$[], 1);
- if (split != "")
- {
- write_string = write_string + split + "\n";
- }
+ write_list[0,"__children"] = add (write_list[0,"__children"]:[], $[
+ "__key" : "__anyxml",
+ "__item" : "split",
+ "__value" : KiwiConfig["split",0]:$[],
+ "__level" : 1
+ ]);
}
- write_string = write_string + "</image>";
+ // generate the XML using current Map2XML function
+ 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);
@@ -578,7 +469,12 @@
return true;
}

- // run kiwi to finally create the live iso image
+ /**
+ * run kiwi to finally create the selected image
+ * @param out_dir output directory for the result
+ * @param selected_profiles which profiles should be build (prepared part
+ * of command line option)
+ */
global boolean PrepareAndCreate (string out_dir, string selected_profiles) {

if (config_dir == "" || !FileUtils::Exists (config_dir))

Modified: trunk/product-creator/src/kiwi_dialogs.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/src/kiwi_dialogs.ycp?rev=48332&r1=48331&r2=48332&view=diff
==============================================================================
--- trunk/product-creator/src/kiwi_dialogs.ycp (original)
+++ trunk/product-creator/src/kiwi_dialogs.ycp Mon Jun 16 14:31:12 2008
@@ -36,11 +36,6 @@

string content_key = Kiwi::content_key;

- // return the id of actual widget for boot image
- string boot_image_widget () {
- return kiwi_task + "boot";
- }
-
// read available the images under /usr/share/kiwi/image/ directory
list<term> GetAvailableImages (string subdir) {

@@ -271,20 +266,20 @@


/**
- * initialize the value of combo box with isoboot items
+ * initialize the value of combo box with boot items
*/
define void InitBootCombo (string id) {
UI::ChangeWidget (`id (id), `Items, GetAvailableImages (id));
}

/**
- * store the value of current isoboot image
+ * store the value of current boot image
*/
define void StoreBootCombo (string key, map event) {
KiwiConfig[key] = (string) UI::QueryWidget(`id(key), `Value);
}
/**
- * handler for combo box with isoboot items
+ * handler for combo box with boot items
*/
define symbol HandleBootCombo (string key, map event) {
// store the value on exiting
@@ -343,7 +338,7 @@
}

/**
- * initialize the value of combo box with isoboot items
+ * initialize the value of size unit
*/
define void InitSizeUnitCombo (string id) {
string unit = KiwiConfig["preferences",0,"size",0,"unit"]:"M";
@@ -1116,6 +1111,9 @@
pref[0,"version"] = [ $[
content_key : "1.0.0"
]];
+ KiwiConfig["preferences"] = pref;
+// FIXME check if boot directories match current product (-> enable building
+// for product different from installed one)
}
// set the primary building target according to kiwi_task
KiwiConfig["preferences",0,"type"] = maplist (
@@ -1196,11 +1194,11 @@

****************************************************************************/

// return map with description of tabs
- // it is a function, to be able to adapt to actual state (e.g.
boot_image_widget ())
+ // it is a function, to be able to adapt to actual state)
map tabs_descr () {

return $[
- "config.xml" : $[
+ "config.xml" : $[
// tab header
"header" : _("Image Configuration"),
"contents" : `HBox (`HSpacing(1),
@@ -1305,7 +1303,7 @@
"root_dir_table", "root_dir_add", "root_dir_delete",
"config_dir_table", "config_dir_add", "config_dir_delete",
],
- ],
+ ],
];
}

@@ -1918,7 +1916,7 @@
)
),
`VSpacing (0.2),
- `Table (`id(`repositories), `header (
+ `Table (`id(`repositories), `opt (`notify), `header (
// table header
_("Package Repository"))
),
@@ -2060,7 +2058,7 @@
update_repo_table ();
}
}
- else if (ret == `edit)
+ else if (ret == `edit || ret == `repositories)
{
string url = (string)
UI::QueryWidget (`id (`repositories), `CurrentItem);
@@ -2071,22 +2069,17 @@
if (plaindir)
{
map parsed = URL::Parse(url);
- parsed["scheme"] = "pkg";
url = URL::Build (parsed);
+ url = SourceDialogs::EditPopupType (url, true);
}
- url = SourceDialogs::EditPopup (url);
+ else
+ url = SourceDialogs::EditPopup (url);
if (url == "" || url == nil || url == selected_url)
continue;
// remove current url + add new one
repositories = remove (repositories, selected_url);
- map parsed = URL::Parse(url);
- plaindir = false;
- if (parsed["scheme"]:"" == "pkg")
- {
- parsed["scheme"] = "dir";
- plaindir = true;
- url = URL::Build (parsed);
- }
+ map parsed = URL::Parse(url);
+ plaindir = SourceDialogs::IsPlainDir();
repositories[url] = $[
"url" : url,
"plaindir" : plaindir

Modified: trunk/product-creator/yast2-product-creator.spec.in
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/yast2-product-creator.spec.in?rev=48332&r1=48331&r2=48332&view=diff
==============================================================================
--- trunk/product-creator/yast2-product-creator.spec.in (original)
+++ trunk/product-creator/yast2-product-creator.spec.in Mon Jun 16 14:31:12 2008
@@ -5,7 +5,7 @@

PreReq: %fillup_prereq

-Requires: autoyast2-installation yast2-security perl-XML-LibXML
+Requires: autoyast2-installation yast2-security

# SourceDialogs::IsPlainDir()
Requires: yast2-packager >= 2.16.20
@@ -53,5 +53,4 @@
@ydatadir@/product-creator/*
#%dir /etc/YaST2/product-creator
@scrconfdir@/*.scr
-@agentdir@/ag_*
/var/adm/fillup-templates/sysconfig.product-creator

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages