[lokisetup] Problem with scripts not adding to installed_bytes

Rob Crittenden rcrit at greyoak.com
Tue Jun 29 10:03:58 EDT 2004

On Tue, 29 Jun 2004, Derek R. Gaston wrote:
> At around 866 of copy.c there is:
>                 rc = copy_script(info, node,
>                         xmlNodeListGetString(info->config, node->childs, 1),
>                         path, update, from_cdrom, msg);
>                 if (rc == 0 && sz) {
>                     info->installed_bytes += atoi(sz);
>                     size += atoi(sz);
>                 }
> Now - that looks good and all - but in practice rc is NEVER 0 - so a 
> script never adds to the installed bytes.  Is there a reason for this or 
> is it a bug?  Not only that but I'm not sure that "atoi(sz)" is going to 
> do what we want (there is an M in sz so it needs to be converted like it 
> is elsewhere).

run_script returns the exit value of the script it ran so your script
should return 0 upon exit. A non-zero error returning from a script
generally indicates an error.

There should NOT be an M in sz. size is the number of >bytes< that were
copied. This could be a documentation defect, I don't know. I suppose it
would be reasonable to add support for "M".


More information about the Lokisetup mailing list