Skip to content

Commit

Permalink
Merge pull request #8 from jsuchome/master
Browse files Browse the repository at this point in the history
create reasonable default when size was not defined (bnc#786696)
  • Loading branch information
kobliha committed Nov 5, 2012
2 parents 29e9144 + 1cf43a8 commit dbfa3c0
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 13 deletions.
31 changes: 31 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Makefile
Makefile.am
Makefile.in
aclocal.m4
autom4te.cache
config.cache
config.guess
config.h
config.h.in
config.log
config.status
config.sub
configure
configure.in
depcomp
install-sh
*.pot
libtool
ltconfig
ltmain.sh
missing
mkinstalldirs
stamp-h*
Makefile.am.common
*.ami
*.bz2
*.spec
.dep
tmp.*
*.log
*.ybc
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.22.8
2.23.0
2 changes: 0 additions & 2 deletions package/.cvsignore

This file was deleted.

6 changes: 6 additions & 0 deletions package/yast2-product-creator.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Nov 2 12:57:34 CET 2012 - jsuchome@suse.cz

- create reasonable default when size was not defined (bnc#786696)
- 2.23.0

-------------------------------------------------------------------
Thu Aug 16 15:53:29 CEST 2012 - jsuchome@suse.cz

Expand Down
3 changes: 3 additions & 0 deletions src/Kiwi.ycp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@
*/
global string content_key = "__yast_content__";

// default image size, if none was given (in MB)
global string default_size = "10";

include "product-creator/routines.ycp";

string encryption_method = nil;
Expand Down
6 changes: 0 additions & 6 deletions src/ProductCreator.ycp
Original file line number Diff line number Diff line change
Expand Up @@ -600,13 +600,7 @@ global define boolean Write() ``{
// translators: error message
if(!ret) Report::Error (_("Error while writing settings."));


// run SuSEconfig
if(Abort()) return false;
Progress::NextStage ();
// translators: error message
if(false) Report::Error (_("SuSEconfig script failed."));
sleep(sl);

if(Abort()) return false;
// translators: progress finished
Expand Down
13 changes: 11 additions & 2 deletions src/complex.ycp
Original file line number Diff line number Diff line change
Expand Up @@ -718,8 +718,17 @@ define symbol ImagesOverviewDialog() {
Configurations[i] = config;
map size_map = get_current_size_map (config, task);
string unit = size_map["unit"]:"M";
string i_size = size_map[Kiwi::content_key]:"0" + unit;

string i_size = size_map[Kiwi::content_key]:"";
// fallback values when size is not given
if (i_size == "")
{
i_size = Kiwi::default_size;
if (size_map["additive"]:"" == "")
{
size_map["additive"] = "true";
}
}
i_size = i_size + unit;
// with "additive", "size" has a different meaning
if (size_map["additive"]:"" == "true")
i_size = "+" + i_size;
Expand Down
16 changes: 14 additions & 2 deletions src/kiwi_dialogs.ycp
Original file line number Diff line number Diff line change
Expand Up @@ -604,8 +604,20 @@ Continue anyway?")))
define void InitSize (string id) {

map size_map = get_current_size_map (KiwiConfig, kiwi_task);
integer siz = tointeger (size_map[Kiwi::content_key]:"0");
if (siz == nil) siz = 0;
integer siz = 0;
if (haskey (size_map, Kiwi::content_key))
{
siz = tointeger (size_map[Kiwi::content_key]:"0");
}
// fallback values when size is not given
else
{
siz = tointeger (Kiwi::default_size);
if (size_map["additive"]:"" == "")
{
size_map["additive"] = "true";
}
}
UI::ChangeWidget (`id ("size"), `Value, siz);
UI::ChangeWidget (`id ("additive"), `Value, size_map["additive"]:"" == "true");
UI::ChangeWidget (`id ("sizeunit"), `Items, maplist (string u, [ "M", "G" ], ``(
Expand Down

0 comments on commit dbfa3c0

Please sign in to comment.