Test fix for advanced installation mode size checking

pull/239/head
parent 6dc506e5db
commit 211f785253

@ -1882,6 +1882,22 @@ msgstr ""
msgid "Invalid devices chosen. Needed:"
msgstr ""
#: source/ubl-strings.h:543
msgid "The size of the new partition exceeds the free space of the selected partition"
msgstr ""
#: source/ubl-strings.h:543
msgid "The size of the new disk partition is larger than the size of the selected partition"
msgstr ""
#: source/ubl-strings.h:543
msgid "There is not enough space to install modules"
msgstr ""
#: source/ubl-strings.h:543
msgid "There is not enough space to install packages"
msgstr ""
#: source/ubl-strings.h:543
msgid "Shudown"
msgstr ""

@ -1873,6 +1873,22 @@ msgstr "Неверная проверка четности устройств.
msgid "Invalid devices chosen. Needed:"
msgstr "Выбраны недействительные устройства. Требуется:"
#: source/ubl-strings.h:543
msgid "The size of the new partition exceeds the free space of the selected partition"
msgstr "Размер нового раздела превышает свободное место выбранного раздела"
#: source/ubl-strings.h:543
msgid "The size of the new disk partition is larger than the size of the selected partition"
msgstr "Размер нового раздела диска превышает размер выбранного раздела"
#: source/ubl-strings.h:543
msgid "There is not enough space to install modules"
msgstr "Недостаточно места для установки модулей"
#: source/ubl-strings.h:543
msgid "There is not enough space to install packages"
msgstr "Недостаточно места для установки пакетов"
#: source/ubl-strings.h:543
msgid "Shudown"
msgstr "Выключить"

@ -565,6 +565,14 @@ int yon_advanced_save(main_window *widgets){
}
}
}
if (cur_section->format==2){
format[0]="yes";
} else if (cur_section->format == 1){
format[0]="no";
} else {
format[0]=NULL;
}
if (!yon_char_is_empty(cur_section->partition)){
if (!yon_char_is_empty(cur_section->partition)){
parts[0]=cur_section->partition;
@ -585,6 +593,8 @@ int yon_advanced_save(main_window *widgets){
devices[1]=cur_section->device;
}
}
if (cur_section->format==2){
if (cur_section->size&&yon_size_long_convert_to_mod(cur_section->full_part_size,cur_section->size_letter)>cur_section->size){
char *size_str = yon_char_from_long(cur_section->size);
@ -603,26 +613,26 @@ int yon_advanced_save(main_window *widgets){
if (!yon_char_is_empty(cur_section->fs_label)){
fs_label[0]=cur_section->fs_label;
}
if (cur_section->format==2){
format[0]="yes";
} else if (cur_section->format == 1){
format[0]="no";
} else {
format[0]=NULL;
}
if (!yon_char_is_empty(cur_section->encryption)){
char *encrypt_str = yon_char_unite(cur_section->encryption,":",cur_section->encryption_password,NULL);
encryption[0]=encrypt_str;
}
if (sections_size>1){
cur_section = sections[0]->sys_section?sections[1]:sections[0];
if (cur_section->format==2){
format[1]="yes";
} else if (cur_section->format==1){
format[1]="no";
} else {
format[1] = NULL;
}
devices[1]=cur_section->device;
if (!yon_char_is_empty(cur_section->partition)){
parts[1]=cur_section->partition;
} else {
parts[1]="";
}
if (cur_section->format==2){
if (cur_section->size){
char *size_str = yon_char_from_long(cur_section->size);
char *sz_str = yon_char_append_c(size_str,cur_section->size_letter);
@ -637,18 +647,12 @@ int yon_advanced_save(main_window *widgets){
if (!yon_char_is_empty(cur_section->fs_label)){
fs_label[1]=cur_section->fs_label;
}
if (cur_section->format==2){
format[1]="yes";
} else if (cur_section->format==1){
format[1]="no";
} else {
format[1] = NULL;
}
if (!yon_char_is_empty(cur_section->encryption)){
char *encrypt_str = yon_char_unite(cur_section->encryption,":",cur_section->encryption_password,NULL);
encryption[1]=encrypt_str;
}
}
}
if (devices[0]||devices[1]){
char *devices_str = yon_char_parsed_to_string_full(devices,2,",");

@ -25,8 +25,23 @@ int yon_installation_check_packages_size(main_window *widgets){
modules = yon_char_parsed_to_string(module_names,modules_size,",");
}
if (strcmp(install_mode,"fast")){
if (!strcmp(install_mode,"fast")){
char *device = config(AUTOINSTALL_DEVICE);
GtkTreeIter iter;
for_iter(widgets->DevicesList,&iter){
char *target;
long disk_size;
gtk_tree_model_get(GTK_TREE_MODEL(widgets->DevicesList),&iter,0,&target,7,&disk_size,-1);
if (!strcmp(device,target)){
part_size = disk_size;
}
}
} else if (!strcmp(install_mode,"advanced")) {
char *part = config(part_parameter);
part = yon_char_new(part);
char *sys_part = yon_char_divide_search(part,",",-1);
free(part);
part = sys_part;
for (int i=0;i<main_config.part_size;i++){
int parsed_size;
config_str parsed = yon_char_parse(main_config.partitions[i],&parsed_size,";");
@ -38,16 +53,19 @@ int yon_installation_check_packages_size(main_window *widgets){
}
yon_char_parsed_free(parsed,parsed_size);
}
} else {
char *device = config(AUTOINSTALL_DEVICE);
GtkTreeIter iter;
for_iter(widgets->DevicesList,&iter){
char *target;
long disk_size;
gtk_tree_model_get(GTK_TREE_MODEL(widgets->DevicesList),&iter,0,&target,7,&disk_size,-1);
if (!strcmp(device,target)){
part_size = disk_size;
char *part = config(part_parameter);
for (int i=0;i<main_config.part_size;i++){
int parsed_size;
config_str parsed = yon_char_parse(main_config.partitions[i],&parsed_size,";");
if (!strcmp(parsed[2],part)&&parsed_size>3&&!yon_char_is_empty(parsed[3])){
part_size = atol(parsed[3]);
yon_char_parsed_free(parsed,parsed_size);
break;
}
yon_char_parsed_free(parsed,parsed_size);
}
}
long packages_size = 0;

Loading…
Cancel
Save