[pacman-dev] [PATCH] _alpm_checkconflicts split

Xavier shiningxc at gmail.com
Tue Nov 20 13:31:46 EST 2007


On Tue, Nov 20, 2007 at 10:00:55AM +0100, Nagy Gabor wrote:
 
> diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c
> index e6efe2d..8466876 100644
> --- a/lib/libalpm/add.c
> +++ b/lib/libalpm/add.c
> @@ -135,7 +135,7 @@ error:
>  
>  int _alpm_add_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data)
>  {
> -	alpm_list_t *lp = NULL, *i = NULL;
> +	alpm_list_t *lp = NULL;
>  
>  	ALPM_LOG_FUNC;
>  
> @@ -161,16 +161,19 @@ int _alpm_add_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data)
>  
>  		/* no unsatisfied deps, so look for conflicts */
>  		_alpm_log(PM_LOG_DEBUG, "looking for conflicts\n");
> -		lp = _alpm_checkconflicts(db, trans->packages);
> +		alpm_list_t *inner = _alpm_innerconflicts(trans->packages);
> +		alpm_list_t *outer = _alpm_outerconflicts(db, trans->packages);
> +		lp = alpm_list_join(inner, outer);
> +		
> +		/* attempt to resolve conflicts */
> +		/*
>  		for(i = lp; i; i = i->next) {
>  			pmconflict_t *conflict = i->data;
>  
> -			_alpm_log(PM_LOG_ERROR, _("replacing packages with -A and -U is not supported yet\n"));
> -			_alpm_log(PM_LOG_ERROR, _("please remove '%s' first, using -Rd\n"), conflict->package2);
> +			_alpm_log(PM_LOG_ERROR, _("conflict resolving with -A and -U is not supported yet\n"));
> +			_alpm_log(PM_LOG_ERROR, _("you cannot install '%s' and '%s' at the same time\n"), conflict->package1, conflict->package2);
>  			RET_ERR(PM_ERR_CONFLICTING_DEPS, -1);
>  

I'm confused, why did you update the log messages in the part you commented
out?
Also, do we really need all this disabled code? I think a simple TODO would
be enough. Something like :
TODO : factorize the conflict resolving code from sync.c to use it here
(FS#3492)




More information about the pacman-dev mailing list