OK, that sounds like a legitimate bug. In the future though, avoid changing the indentations of code too
much in your patches because it increases the size needlessly and makes it harder to follow...
Right, sorry about that.
I wouldn't normally do that - but the indentation in that part of the code was
so terrible that I couldn't decipher it.
I'll not do that in the future.
Something else I just noticed in my patch... the:
char *symlink = xmlGetProp(node, "size");
line that is at the top need NOT be present for this patch to work. That is
part of a different patch that I'm working on (so that the progress bars are
updated correctly for scripts). Sorry about that - I will screen my diffs a
little better in the future.
Derek
In the XML specification it says that you can specify a size for scripts (in case they copy some files). But in reality the interface doesn't reflect this when you select an option that contains script elements. This change makes the program account for script "size" elements properly. Again - I apologize for the format of the diff - I have no CVS access from here. --- copy.c.old 2004-04-30 21:53:10.000000000 -0600 +++ copy.c 2004-06-28 08:58:06.000000000 -0600 @@ -746,6 +746,8 @@ { struct cdrom_elem *cdrom; struct cdrom_elem *cdrom_start; + char *symlink = xmlGetProp(node, "size"); + int rc; if ( corrupts ) { /* Don't run any scripts while restoring files */ @@ -1198,32 +1200,48 @@ /* Get the install size of an option tree, in bytes */ unsigned long long size_tree(install_info *info, xmlNodePtr node) { - unsigned long long size = 0; + unsigned long long size = 0; - while ( node ) { - char *wanted; + while ( node ) + { + char *wanted; - if ( ! strcmp(node->name, "option") ) { + if ( ! strcmp(node->name, "option") ) + { wanted = xmlGetProp(node, "install"); - if ( wanted && (strcmp(wanted, "true") == 0) ) { + if ( wanted && (strcmp(wanted, "true") == 0) ) + { size += size_node(info, node); size += size_tree(info, node->childs); } + xmlFree(wanted); - } else if ( !strcmp(node->name, "exclusive") ) { + } + else if ( !strcmp(node->name, "exclusive") ) + { size += size_tree(info, node->childs); - } else if ( !strcmp(node->name, "component") ) { - if ( match_arch(info, xmlGetProp(node, "arch")) && - match_libc(info, xmlGetProp(node, "libc")) && - match_distro(info, xmlGetProp(node, "distro")) ) { - size += size_tree(info, node->childs); - } - } else if ( !strcmp(node->name, "readme") || !strcmp(node->name, "eula") ) { + } + else if ( !strcmp(node->name, "component") ) + { + if ( match_arch(info, xmlGetProp(node, "arch")) && + match_libc(info, xmlGetProp(node, "libc")) && + match_distro(info, xmlGetProp(node, "distro")) ) + { + size += size_tree(info, node->childs); + } + } + else if ( !strcmp(node->name, "readme") || !strcmp(node->name, "eula") ) + { size += size_readme(info, node); } - node = node->next; - } - return size; + else if ( !strcmp(node->name, "script") ) + { + size += size_node(info, node); + } + node = node->next; + } + + return size; } int has_binaries(install_info *info, xmlNodePtr node)