Author: jsuchome
Date: Fri Oct 12 16:49:02 2007
New Revision: 41409
URL: http://svn.opensuse.org/viewcvs/yast?rev=41409&view=rev
Log:
- fix adding CD/DVD/SLP repositories (#333106)
- show correct list of repositories when going back (#332253)
- use system repositories when none is specified (#332253)
- menubutton for adding system repositories (#332253)
- added SUPPORTED_BOOT_IMAGES to /etc/sysconfig/product-creator:
possibility to limit list of offered boot images (#331733)
- append image name to defaultdestination and defaultroot (#327057)
- 2.13.13
Modified:
branches/SuSE-SLE-10-SP1-Branch/product-creator/VERSION
branches/SuSE-SLE-10-SP1-Branch/product-creator/package/yast2-product-creator.changes
branches/SuSE-SLE-10-SP1-Branch/product-creator/src/Kiwi.ycp
branches/SuSE-SLE-10-SP1-Branch/product-creator/src/data/sysconfig.product-creator
branches/SuSE-SLE-10-SP1-Branch/product-creator/src/kiwi_dialogs.ycp
branches/SuSE-SLE-10-SP1-Branch/product-creator/src/wizards.ycp
Modified: branches/SuSE-SLE-10-SP1-Branch/product-creator/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/product-creator/VERSION?rev=41409&r1=41408&r2=41409&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/product-creator/VERSION (original)
+++ branches/SuSE-SLE-10-SP1-Branch/product-creator/VERSION Fri Oct 12 16:49:02 2007
@@ -1 +1 @@
-2.13.12
+2.13.13
Modified: branches/SuSE-SLE-10-SP1-Branch/product-creator/package/yast2-product-creator.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/product-creator/package/yast2-product-creator.changes?rev=41409&r1=41408&r2=41409&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/product-creator/package/yast2-product-creator.changes (original)
+++ branches/SuSE-SLE-10-SP1-Branch/product-creator/package/yast2-product-creator.changes Fri Oct 12 16:49:02 2007
@@ -1,4 +1,16 @@
-------------------------------------------------------------------
+Fri Oct 12 11:15:01 CEST 2007 - jsuchome@suse.cz
+
+- fix adding CD/DVD/SLP repositories (#333106)
+- show correct list of repositories when going back (#332253)
+- use system repositories when none is specified (#332253)
+- menubutton for adding system repositories (#332253)
+- added SUPPORTED_BOOT_IMAGES to /etc/sysconfig/product-creator:
+ possibility to limit list of offered boot images (#331733)
+- append image name to defaultdestination and defaultroot (#327057)
+- 2.13.13
+
+-------------------------------------------------------------------
Tue Oct 2 11:49:14 CEST 2007 - jsuchome@suse.cz
- copy whole content of imported kiwi config directory (#330052)
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=41409&r1=41408&r2=41409&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 Oct 12 16:49:02 2007
@@ -30,6 +30,9 @@
// directory for saving image configurations
global string images_dir = Directory::vardir + "/product-creator/images";
+ // bug 331733
+ global string supported_boot_images = "";
+
// directories with user-made templated
global list<string> templates_dirs = [];
@@ -40,6 +43,9 @@
// repositories used for current configuration
global map current_repositories = $[];
+ // initial system repositories
+ global map initial_repositories = $[];
+
// where the kiwi configuration files are stored
string config_dir = "";
@@ -313,8 +319,11 @@
tmp_dir = Directory::tmpdir;
chroot_dir = tmp_dir + "/myphysical";
if (KiwiConfig["defaultroot"]:"" != "")
- chroot_dir = KiwiConfig["defaultroot"]:"";
-
+ {
+ chroot_dir =
+ KiwiConfig["defaultroot"]:"" + "/" + KiwiConfig["name"]:"";
+ KiwiConfig["defaultroot"] = chroot_dir;
+ }
list packages_list = [];
list patterns_list = [];
@@ -507,7 +516,7 @@
}
string write_string = Map2XML (write_list[0]:$[], 0);
- config_dir = tmp_dir + "/" + get_config_dir (KiwiConfig["name"]:"", task);
+ config_dir = tmp_dir + "/" + KiwiConfig["name"]:"";
SCR::Execute (.target.mkdir, config_dir);
SCR::Write (.target.string, config_dir + "/config.xml", write_string);
foreach (string dir, ["root_dir", "config_dir"], {
@@ -613,6 +622,7 @@
update_output ();
integer status = (integer) SCR::Read (.background.status);
+y2internal ("status: %1", status);
if (status != 0)
{
UI::ReplaceWidget (`id (`rp), `HBox (
@@ -670,7 +680,7 @@
if (!FileUtils::Exists (images_dir))
SCR::Execute (.target.mkdir, images_dir);
SCR::Execute (.target.bash, sformat ("cp -ar %1 %2/", config_dir, images_dir));
- return (images_dir + get_config_dir (KiwiConfig["name"]:"", task));
+ return (images_dir + KiwiConfig["name"]:"");
}
/**
@@ -774,6 +784,10 @@
(string) SCR::Read (.sysconfig.product-creator.IMAGE_CONFIGURATIONS);
if (dir != nil && dir != "")
images_dir = dir;
+ supported_boot_images =
+ (string) SCR::Read (.sysconfig.product-creator.SUPPORTED_BOOT_IMAGES);
+ if (supported_boot_images == nil)
+ supported_boot_images = "";
return ReadImageTemplates ();
}
Modified: branches/SuSE-SLE-10-SP1-Branch/product-creator/src/data/sysconfig.product-creator
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/product-creator/src/data/sysconfig.product-creator?rev=41409&r1=41408&r2=41409&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/product-creator/src/data/sysconfig.product-creator (original)
+++ branches/SuSE-SLE-10-SP1-Branch/product-creator/src/data/sysconfig.product-creator Fri Oct 12 16:49:02 2007
@@ -18,3 +18,15 @@
#
#
IMAGE_CONFIGURATIONS="/var/lib/YaST2/product-creator/images"
+
+## Path: System/Yast2/Product-creator
+## Description: YaST2 Product Creator
+## Type: string(template)
+## Default: none
+#
+# Which boot images are offered for configuration. Use comma separated list
+# of image types (like "iso,xen,usb") or special value "template" for
+# supporting only image types found in imported configurations.
+#
+#
+SUPPORTED_BOOT_IMAGES=""
Modified: branches/SuSE-SLE-10-SP1-Branch/product-creator/src/kiwi_dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/product-creator/src/kiwi_dialogs.ycp?rev=41409&r1=41408&r2=41409&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/product-creator/src/kiwi_dialogs.ycp (original)
+++ branches/SuSE-SLE-10-SP1-Branch/product-creator/src/kiwi_dialogs.ycp Fri Oct 12 16:49:02 2007
@@ -18,6 +18,7 @@
import "Kiwi";
import "Popup";
import "SourceDialogs";
+ import "SourceManager";
import "Summary";
import "URL";
import "Wizard";
@@ -1475,7 +1476,7 @@
_("<p>Select <b>Output Directory</b> for the created image.</p>") +
// help text for kiwi UI preparation, cont.
- _("<p>Modify the list of <b>Package Repositories</b> that will be used for creating the image. If the list is empty, current system repositories will be used.</p>") +
+ _("<p>Modify the list of <b>Package Repositories</b> that will be used for creating the image. Use <b>Add From System</b> to add one of current system repository.</p>") +
// help text for kiwi UI preparation, cont.
_("<p>Use <b>Next</b> to continue with the configuration.</p>");
@@ -1492,14 +1493,42 @@
];
map task2label = $[
// combo box item
- "pxe" : _("Network Boot Image")
+ "pxe" : _("Network Boot Image"),
+ // combo box item
+ "iso" : _("Live ISO Image"),
+ // combo box item
+ "xen" : _("Xen Image"),
+ // combo box item
+ "usb" : _("USB Stick Image"),
+ // combo box item
+ "vmx" : _("Virtual Disk Image")
];
- // on start, show the default YaST sources
- if (Config == $[])
+ list type_items = basic_type_items;
+ list default_type_items = basic_type_items;
+
+ string supported_images = Kiwi::supported_boot_images;
+ if (supported_images != "" && supported_images != "template")
{
+ type_items = []; // will be read from template..., or:
+ foreach (string type, splitstring (supported_images,","),
+ {
+ if (haskey (task2label, type))
+ {
+ type_items = add (type_items,
+ `item (`id (type), task2label[type]:type));
+ }
+ });
+ default_type_items = type_items;
}
- else if (Config["sources"]:[] != [] && repositories == $[])
+ if (!contains (["iso", "xen", "usb", "vmx"], kiwi_task))
+ type_items = add (type_items,
+ `item (`id (kiwi_task), task2label[kiwi_task]:kiwi_task, true));
+ list present_types = maplist (
+ term it, (list<term>)type_items, ``(it[0,0]:""));
+
+ // on start, show the default YaST sources
+ if (Config["sources"]:[] != [] && repositories == $[])
{
integer i = 0;
foreach (string src, Config["sources"]:[], {
@@ -1509,6 +1538,10 @@
i = i + 1;
});
}
+ list system_repo_items = maplist (integer id, map repo,
+ Kiwi::initial_repositories, {
+ return `item (`id (id), repo["url"]:"");
+ });
void update_repo_table () {
UI::ChangeWidget (`id (`repositories), `Items, maplist (
@@ -1540,18 +1573,22 @@
if (Config["iso-directory"]:"" != "")
UI::ChangeWidget(`id(`out_dir), `Value, Config["iso-directory"]:"");
update_repo_table ();
- list type_items = basic_type_items;
+ list type_its = supported_images != "template" ? default_type_items: [];
boolean primary = false;
foreach (string type, map data, Config["type"]:$[], {
if (!primary)
kiwi_task = type;
if (data["primary"]:"" == "true")
primary = true;
- if (!contains (["iso", "xen", "usb", "vmx"], type))
- type_items = add (type_items,
+ if ((supported_images == "" && !contains (present_types, type)) ||
+ supported_images == "template")
+ {
+ type_its = add (type_its,
`item (`id (kiwi_task), task2label[kiwi_task]:kiwi_task));
+ present_types = union (present_types, [type]);
+ }
});
- UI::ChangeWidget (`id (`type), `Items, type_items);
+ UI::ChangeWidget (`id (`type), `Items, type_its);
UI::ChangeWidget (`id (`type), `Value, kiwi_task);
}
@@ -1562,10 +1599,6 @@
);
});
- list type_items = basic_type_items;
- if (!contains (["iso", "xen", "usb", "vmx"], kiwi_task))
- type_items = add (type_items,
- `item (`id (kiwi_task), task2label[kiwi_task]:kiwi_task, true));
term contents = `VBox (
new_configuration ?
`VBox (
@@ -1582,6 +1615,7 @@
// radio button label
_("Base on Template"))
),
+ template_items == [] ? `VSpacing (0) :
`HBox (
`HSpacing (2.5),
`ComboBox (`id (`template), `opt (`notify, `hstretch), "",
@@ -1601,7 +1635,7 @@
) :
`Left (`Label (`id (`config), name)),
// combo box label
- `ComboBox (`id (`type), `opt (`notify, `hstretch), _("Image Type"),
+ `ComboBox (`id (`type), `opt (`notify, `hstretch), _("I&mage Type"),
type_items),
`HBox (
// text entry label
@@ -1609,12 +1643,14 @@
`VBox (
`Label (""),
`PushButton (`id (`browse), Label::BrowseButton ())
- ),
+ )
+ /*
`VBox (
`Label (""),
// checkbox label
`CheckBox (`id (`append), _("A&ppend Name"), append_name)
)
+ */
),
`VSpacing (0.2),
`Table (`id(`repositories), `header (
@@ -1623,6 +1659,9 @@
),
`HBox (
`PushButton (`id (`add), Label::AddButton ()),
+ // menu butto label
+ `MenuButton (`id (`addsystem), _("A&dd From System"),
+ system_repo_items),
`PushButton (`id (`edit), Label::EditButton ()),
`PushButton (`id (`delete), Label::DeleteButton ()),
`HStretch ()
@@ -1644,8 +1683,10 @@
if (new_configuration)
{
UI::SetFocus (`id (`config));
- UI::ChangeWidget (`id (`template), `Enabled, false);
+ if (template_items != [])
+ UI::ChangeWidget (`id (`template), `Enabled, false);
UI::ChangeWidget (`id (`import), `Enabled, false);
+ UI::ChangeWidget (`id (`config), `ValidChars, String::CAlnum ());
}
any ret = nil;
while (true)
@@ -1658,7 +1699,8 @@
}
else if (ret == "rb_dir")
{
- UI::ChangeWidget (`id (`template), `Enabled, false);
+ if (template_items != [])
+ UI::ChangeWidget (`id (`template), `Enabled, false);
UI::ChangeWidget (`id (`import), `Enabled, true);
if (kiwi_configuration == "")
ret = `import;
@@ -1691,14 +1733,43 @@
string dir = (string) UI::QueryWidget (`id (`template), `Value);
update_config (dir, Kiwi::Templates[dir]:$[]);
}
+ else if (is (ret, integer)) // system repository selected
+ {
+ map system_repo = Kiwi::initial_repositories[(integer)ret]:$[];
+ boolean present = false;
+ foreach (integer id, map repo, repositories, {
+ if (repo["url"]:"" == system_repo["url"]:"")
+ {
+ present = true;
+ break;
+ }
+ });
+ if (present) continue;
+ repositories[size (repositories)] = system_repo;
+ update_repo_table ();
+ }
else if (ret == `add)
{
Wizard::CreateDialog ();
- string url = "";
- if (SourceDialogs::TypeDialog () == `next &&
- SourceDialogs::EditDialog () == `next)
+ string url = "";
+ symbol type_ret = SourceDialogs::TypeDialog ();
+
+ if ((type_ret == `next || type_ret == `finish))
{
- url = SourceDialogs::GetURL ();
+ // FIXME SLP code for SLE10SP1 only, adapt for 10.3...
+ if (type_ret == `finish && SourceDialogs::GetURL () == "slp://")
+ {
+ string service = SourceManager::AddSourceTypeSLP ();
+ if (service != nil)
+ {
+ url = service;
+ }
+ }
+ else
+ {
+ if (SourceDialogs::EditDialog () == `next)
+ url = SourceDialogs::GetURL ();
+ }
}
Wizard::CloseDialog ();
if (url != "")
@@ -1711,7 +1782,7 @@
break;
}
});
- if (present) break;
+ if (present) continue;
map parsed = URL::Parse(url);
if (parsed["scheme"]:"" == "pkg")
@@ -1802,6 +1873,14 @@
UI::SetFocus (`id (`out_dir));
continue;
}
+ if (repositories == $[])
+ {
+ // error popup
+ Popup::Error(_("Specify at least one package repository."));
+ UI::SetFocus (`id (`repositories));
+ continue;
+ }
+
kiwi_task = (string) UI::QueryWidget (`id (`type), `Value);
break;
}
@@ -1816,12 +1895,9 @@
{
Config["kiwi_configuration_" + kiwi_task] = kiwi_configuration;
Config["_imported"] = true;
- Config["iso-directory"] = out_dir;
+ Config["iso-directory"] = out_dir +
+ (new_configuration ? "/" + name : "");
Config["name"] = name;
- /*
- Config["sources"] = maplist (
- integer id, string repo, repositories, ``(repo));
- */
Config["sources"] = maplist (
integer id, map repo, repositories, ``(repo["url"]:""));
if (Config["sources"]:[] != [])
@@ -1855,13 +1931,8 @@
});
Pkg::SourceLoad();
}
- else
- {
- // reenable original sources
- Pkg::SourceRestore ();
- Pkg::SourceLoad();
- }
ProductCreator::Config = Config;
+ Kiwi::current_repositories = repositories;
Kiwi::kiwi_task = kiwi_task;
}
y2milestone("Returning %1", ret);
Modified: branches/SuSE-SLE-10-SP1-Branch/product-creator/src/wizards.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/product-creator/src/wizards.ycp?rev=41409&r1=41408&r2=41409&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP1-Branch/product-creator/src/wizards.ycp (original)
+++ branches/SuSE-SLE-10-SP1-Branch/product-creator/src/wizards.ycp Fri Oct 12 16:49:02 2007
@@ -143,7 +143,7 @@
*/
symbol InitRepositories () {
- Kiwi::current_repositories = Kiwi::InitCurrentRepositories ();
+ Kiwi::initial_repositories = Kiwi::InitCurrentRepositories ();
Kiwi::Read ();
return `next;
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org