[pacman-dev] [PATCH] Allow sync_prepare to work when no sync packages are being used

Allan McRae allan at archlinux.org
Wed Jan 15 08:49:41 EST 2014


On 15/01/14 23:15, Andrew Gregory wrote:
> On 01/15/14 at 04:16pm, Allan McRae wrote:
>> Commit 9363e7dc allowed sync prepare to work when not sync packages were being
>> used and databases were missing.  However, it still required any databases
>> that were present had valid signatures (if these were required).  Relax this
>> further so that sync database status is not considered when on using local
>> package files.
>>
>> Signed-off-by: Allan McRae <allan at archlinux.org>
>> ---
> 
> I don't think we can do this unless --nodeps is also used, because we
> could still pull sync packages in as a dependency.
> 

Good point...   Patch rejected!

But why do we require databases to be present when the target is a sync
one?  If we allow installing the dependencies of a local package when
sync dbs are missing, why not packages from the (available) sync dbs too?

Allan


>>  lib/libalpm/sync.c | 19 ++++++++++---------
>>  1 file changed, 10 insertions(+), 9 deletions(-)
>>
>> diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
>> index 17a3e8e..5015237 100644
>> --- a/lib/libalpm/sync.c
>> +++ b/lib/libalpm/sync.c
>> @@ -387,15 +387,16 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data)
>>  		}
>>  	}
>>  
>> -	/* ensure all sync database are valid if we will be using them */
>> -	for(i = handle->dbs_sync; i; i = i->next) {
>> -		const alpm_db_t *db = i->data;
>> -		if(db->status & DB_STATUS_INVALID) {
>> -			RET_ERR(handle, ALPM_ERR_DB_INVALID, -1);
>> -		}
>> -		/* missing databases are not allowed if we have sync targets */
>> -		if(from_sync && db->status & DB_STATUS_MISSING) {
>> -			RET_ERR(handle, ALPM_ERR_DB_NOT_FOUND, -1);
>> +	/* ensure all sync database are present and valid if we will be using them */
>> +	if(from_sync) {
>> +		for(i = handle->dbs_sync; i; i = i->next) {
>> +			const alpm_db_t *db = i->data;
>> +			if(db->status & DB_STATUS_INVALID) {
>> +				RET_ERR(handle, ALPM_ERR_DB_INVALID, -1);
>> +			}
>> +			if(db->status & DB_STATUS_MISSING) {
>> +				RET_ERR(handle, ALPM_ERR_DB_NOT_FOUND, -1);
>> +			}
>>  		}
>>  	}
>>  
>> -- 
>> 1.8.5.2
>>
>>
> 
> 
> 



More information about the pacman-dev mailing list