Multi part software list items that do have different interfaces used are mounted now (only first part per interface part is loaded) (no whatsnew)

This commit is contained in:
Miodrag Milanovic 2011-06-16 13:39:53 +00:00
parent e022252bf2
commit b58c772d9a

View File

@ -200,24 +200,33 @@ int cli_frontend::execute(int argc, char **argv)
{
software_info *swinfo = software_list_find(list, m_options.software_name(), NULL);
if (swinfo!=NULL) {
const device_image_interface *image = NULL;
software_part *part = software_find_part(swinfo, NULL, NULL);
for (software_part *swpart = software_find_part(swinfo, NULL, NULL); swpart != NULL; swpart = software_part_next(swpart))
{
// loop trough all parts
// search for a device with the right interface
const device_image_interface *image = NULL;
for (bool gotone = config.devicelist().first(image); gotone; gotone = image->next(image))
{
const char *interface = image->image_interface();
if (interface != NULL)
{
if (!strcmp(interface, part->interface_))
if (!strcmp(interface, swpart->interface_))
{
const char *option = m_options.value(image->brief_instance_name());
// mount only if not already mounted
if (strlen(option)==0) {
astring val;
astring error;
m_options.set_value(image->brief_instance_name(), m_options.software_name(), OPTION_PRIORITY_CMDLINE, error);
val.printf("%s:%s",m_options.software_name(),swpart->name);
m_options.set_value(image->brief_instance_name(), val.cstr(), OPTION_PRIORITY_CMDLINE, error);
assert(!error);
software_list_close(list);
}
break;
}
}
}
}
software_list_close(list);
found = TRUE;
break;
}