[pacman-dev] [PATCH] skip unknown repo names for pacman -Sl

Allan McRae allan at archlinux.org
Mon Jun 3 00:01:26 EDT 2013


On 03/06/13 13:45, Andrew Gregory wrote:
> Brings pacman -Sl behavior in line with other listing operations.
> 
> Signed-off-by: Andrew Gregory <andrew.gregory.8 at gmail.com>
> ---
>  src/pacman/sync.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/src/pacman/sync.c b/src/pacman/sync.c
> index 2093029..f8af176 100644
> --- a/src/pacman/sync.c
> +++ b/src/pacman/sync.c
> @@ -503,12 +503,15 @@ static int sync_list(alpm_list_t *syncs, alpm_list_t *targets)
>  			if(db == NULL) {
>  				pm_printf(ALPM_LOG_ERROR,
>  					_("repository \"%s\" was not found.\n"), repo);
> -				alpm_list_free(ls);
> -				return 1;
>  			}
>  
>  			ls = alpm_list_add(ls, db);
>  		}
> +
> +		if(!ls) {
> +			/* all of our targets were invalid */
> +			return 1;
> +		}
>  	} else {
>  		ls = syncs;
>  	}
> 

This needs a bit more.   "pacman -Ql afsljk glibc" returns 1.   So with
"pacman -Sl asjkladfjk core", pacman should print the error about the
unknown repo and then the list of core packages and return 1.

Allan



More information about the pacman-dev mailing list