[pacman-dev] [PATCH] Change the exit code for pacman_deptest() and some clean up.

Andrew Fyfe andrew at neptune-one.net
Fri Jun 29 00:20:49 EDT 2007

First off I should have attached a BIG warning, this is my first attempt 
at doing anything serious in C beyond basic examples :p

The original reason for the patch was to change the exit code. At the 
moment pacman uses 1 for missing deps & errors. This can confuse makepkg 
if pacman returns an error instead of the list of missing packages and 
you end up with pacman saying something like

Checking deps...
Missing deps:

Xavier wrote:
> 2007/6/29, Andrew Fyfe <andrew at neptune-one.net>:
>> -       newstr = strdup(depstring);
>> +
>> +       newstr = calloc(strlen(depstring)+1, sizeof(char));
>> +       strncpy(newstr, depstring, strlen(depstring));
> hmm, that's basically the same, isn't it? :)
>> -
>> -               /* splitdep modifies the string... we'll compensate for now */
>> -               char *saved_target = NULL;
>> -               saved_target = calloc(strlen(target)+1, sizeof(char));
>> -               strncpy(saved_target, target, strlen(target));
>> -
As for the rest of the patch, looking at the code I saw this and thought 
it looked a bit out of place, the problem is in alpm_splitdeps() and I 
didn't see anything else that depended on this behaviour of 
alpm_splitdeps(). So I changed alpm_splitdeps() not to modify the string 
passed to it.


More information about the pacman-dev mailing list