FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 07-15-2012, 10:33 PM
Clemens Buchacher
 
Default squelch output of installed new optdeps

If an upgraded package version contains new optdeps, the user is
notified of that. If the new optdep is already installed, that
information is redundant.

Instead, do not output new optdeps if they are already installed.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
---
src/pacman/util.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)

diff --git a/src/pacman/util.c b/src/pacman/util.c
index 7f7f6a7..e774fa8 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -1192,6 +1192,20 @@ static int depend_cmp(const void *d1, const void *d2)
return ret;
}

+static alpm_list_t *filter_out_installed(alpm_list_t *list)
+{
+ alpm_list_t *i, *not_installed = NULL;
+ alpm_db_t *db_local = alpm_get_localdb(config->handle);
+
+ for(i = list; i; i = alpm_list_next(i)) {
+ if(!alpm_db_get_pkg(db_local, i->data))
+ not_installed = alpm_list_add(not_installed, i->data);
+ }
+ alpm_list_free(list);
+
+ return not_installed;
+}
+
void display_new_optdepends(alpm_pkg_t *oldpkg, alpm_pkg_t *newpkg)
{
alpm_list_t *i, *old, *new, *optdeps, *optstrings = NULL;
@@ -1206,6 +1220,8 @@ void display_new_optdepends(alpm_pkg_t *oldpkg, alpm_pkg_t *newpkg)
optstrings = alpm_list_add(optstrings, alpm_dep_compute_string(optdep));
}

+ optstrings = filter_out_installed(optstrings);
+
if(optstrings) {
printf(_("New optional dependencies for %s
"), alpm_pkg_get_name(newpkg));
unsigned short cols = getcols(fileno(stdout));
--
1.7.11.2
 
Old 07-16-2012, 12:17 AM
Allan McRae
 
Default squelch output of installed new optdeps

On 16/07/12 08:33, Clemens Buchacher wrote:
> If an upgraded package version contains new optdeps, the user is
> notified of that. If the new optdep is already installed, that
> information is redundant.
>
> Instead, do not output new optdeps if they are already installed.
>
> Signed-off-by: Clemens Buchacher <drizzd@aon.at>
> ---


FYI - there is a large patchset fo optdepends that needs tidied up with
includes this functionality:
https://github.com/moben/pacman/commit/bd6c1294

I would also like to see this filter out things that are about to be
installed...


> src/pacman/util.c | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/src/pacman/util.c b/src/pacman/util.c
> index 7f7f6a7..e774fa8 100644
> --- a/src/pacman/util.c
> +++ b/src/pacman/util.c
> @@ -1192,6 +1192,20 @@ static int depend_cmp(const void *d1, const void *d2)
> return ret;
> }
>
> +static alpm_list_t *filter_out_installed(alpm_list_t *list)
> +{
> + alpm_list_t *i, *not_installed = NULL;
> + alpm_db_t *db_local = alpm_get_localdb(config->handle);
> +
> + for(i = list; i; i = alpm_list_next(i)) {
> + if(!alpm_db_get_pkg(db_local, i->data))
> + not_installed = alpm_list_add(not_installed, i->data);
> + }
> + alpm_list_free(list);
> +
> + return not_installed;
> +}
> +
> void display_new_optdepends(alpm_pkg_t *oldpkg, alpm_pkg_t *newpkg)
> {
> alpm_list_t *i, *old, *new, *optdeps, *optstrings = NULL;
> @@ -1206,6 +1220,8 @@ void display_new_optdepends(alpm_pkg_t *oldpkg, alpm_pkg_t *newpkg)
> optstrings = alpm_list_add(optstrings, alpm_dep_compute_string(optdep));
> }
>
> + optstrings = filter_out_installed(optstrings);
> +
> if(optstrings) {
> printf(_("New optional dependencies for %s
"), alpm_pkg_get_name(newpkg));
> unsigned short cols = getcols(fileno(stdout));
>
 
Old 07-16-2012, 07:16 PM
Clemens Buchacher
 
Default squelch output of installed new optdeps

On Mon, Jul 16, 2012 at 10:17:03AM +1000, Allan McRae wrote:
>
> FYI - there is a large patchset fo optdepends that needs tidied up with
> includes this functionality:
> https://github.com/moben/pacman/commit/bd6c1294

Ok, from comparison with that I see that my version would not handle
optdeps with descriptions.

> I would also like to see this filter out things that are about to be
> installed...

True. Should be much less common, though.
 

Thread Tools




All times are GMT. The time now is 05:43 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org