[pacman-dev] [PATCH] src/pacman/sync.c : cleanup of pacman_sync

Xavier shiningxc at gmail.com
Mon Jun 2 07:37:05 EDT 2008


2008/6/2 Nagy Gabor <ngaba at bibl.u-szeged.hu>:
>> @@ -861,7 +823,43 @@ int pacman_sync(alpm_list_t *targets)
>>               return(sync_list(sync_dbs, targets));
>>       }
>>
>> -     return(0);
>> +     if(targets == NULL) {
>> +             if(config->op_s_sync) {
>> +                     return(0);
>
> I may overlook something, but won't this break -Syu?
>

Oops, you are right, good catch.
I probably got confused because op_s_sync used to get resetted after
doing the -y operation, but I removed that part :
-               config->op_s_sync = 0;

So now, I could probably just invert the order of these two checks :
do s_upgrade check first, then s_sync.
Does that sound alright?

>> +             } else if(config->op_s_upgrade) {
>> +                     /* proceed */
>> +             } else {
>> +                     /* don't proceed here unless we have an
>> operation that doesn't require a
>> +                      * target list */
>> +                     pm_printf(PM_LOG_ERROR, _("no targets
>> specified (use -h for help)\n"));
>> +                     return(1);
>> +             }
>> +     }
>




More information about the pacman-dev mailing list