… | |
… | |
556 | |
556 | |
557 | if (arch != NULL) |
557 | if (arch != NULL) |
558 | tmp = arch_to_object (arch); |
558 | tmp = arch_to_object (arch); |
559 | else |
559 | else |
560 | { |
560 | { |
561 | tmp = get_object (); |
561 | tmp = object::create (); |
562 | /* record the name of the broken object */ |
562 | /* record the name of the broken object */ |
563 | tmp->name = str; |
563 | tmp->name = str; |
564 | } |
564 | } |
565 | |
565 | |
566 | parse_object (tmp, thawer, map_flags); |
566 | parse_object (tmp, thawer, map_flags); |
… | |
… | |
593 | op_inv = tmp; |
593 | op_inv = tmp; |
594 | } |
594 | } |
595 | else |
595 | else |
596 | { |
596 | { |
597 | LOG (llevDebug, "Discarding object without arch: %s\n", tmp->name ? (const char *) tmp->name : "(null)"); |
597 | LOG (llevDebug, "Discarding object without arch: %s\n", tmp->name ? (const char *) tmp->name : "(null)"); |
598 | tmp->destroy (0); |
598 | tmp->destroy (); |
599 | } |
599 | } |
600 | } |
600 | } |
601 | else |
601 | else |
602 | { |
602 | { |
603 | /* This is the actual archetype definition then */ |
603 | /* This is the actual archetype definition then */ |
604 | op->arch = archetype::find (str); |
604 | op->arch = archetype::find (str); |
605 | |
605 | |
606 | if (op->arch != NULL) |
606 | if (op->arch) |
607 | copy_object (&op->arch->clone, op); |
607 | op->arch->clone.copy_to (op); |
608 | else if (!arch_init) |
608 | else if (!arch_init) |
609 | /* record the name of the broken object */ |
609 | /* record the name of the broken object */ |
610 | op->name = str; |
610 | op->name = str; |
611 | } |
611 | } |
612 | } |
612 | } |
… | |
… | |
1303 | if (!arch_field || my_field->value != arch_field->value) |
1303 | if (!arch_field || my_field->value != arch_field->value) |
1304 | f.put (my_field->key, my_field->value); |
1304 | f.put (my_field->key, my_field->value); |
1305 | } |
1305 | } |
1306 | |
1306 | |
1307 | /* We don't need to worry about the arch's extra fields - they |
1307 | /* We don't need to worry about the arch's extra fields - they |
1308 | * will get taken care of the copy_object function. |
1308 | * will get taken care of the copy_to method. |
1309 | */ |
1309 | */ |
1310 | |
1310 | |
1311 | { |
1311 | { |
1312 | char uids[64]; |
1312 | char uids[64]; |
1313 | snprintf (uids, sizeof (uids), "<1.%llx>", (unsigned long long)op->uuid.seq); |
1313 | snprintf (uids, sizeof (uids), "<1.%llx>", (unsigned long long)op->uuid.seq); |
… | |
… | |
1498 | save_object (fp, tmp, flag); |
1498 | save_object (fp, tmp, flag); |
1499 | old = tmp; |
1499 | old = tmp; |
1500 | } |
1500 | } |
1501 | |
1501 | |
1502 | if (!(flag & 2)) |
1502 | if (!(flag & 2)) |
1503 | { |
|
|
1504 | op->remove (); |
|
|
1505 | op->destroy (0); |
1503 | op->destroy (); |
1506 | } |
|
|
1507 | |
1504 | |
1508 | fp.put (op); |
1505 | fp.put (op); |
1509 | fprintf (fp, "end\n"); |
1506 | fprintf (fp, "end\n"); |
1510 | } |
1507 | } |
1511 | |
1508 | |