diff options
author | morganamilo <morganamilo@gmail.com> | 2018-10-17 17:40:47 +0200 |
---|---|---|
committer | Andrew Gregory <andrew.gregory.8@gmail.com> | 2018-10-20 21:08:27 +0200 |
commit | 02255fd97e831854d1f29e6fac687a4a508f44fa (patch) | |
tree | 05a17bc775c644cfe63ed6ac53d7a15c70d187e1 /lib | |
parent | 8c9046e6042fd23bf6a1bb204062fc644c322689 (diff) | |
download | pacman-02255fd97e831854d1f29e6fac687a4a508f44fa.tar.gz pacman-02255fd97e831854d1f29e6fac687a4a508f44fa.tar.xz |
libalpm: process needed before group selection
When --needed is used, up to date packages are now filtered out
before showing the group select.
Fixes FS#22870.
Signed-off-by: morganamilo <morganamilo@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libalpm/sync.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index b6ae7b72..05f58fad 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -277,10 +277,21 @@ alpm_list_t SYMEXPORT *alpm_find_group_pkgs(alpm_list_t *dbs, for(j = grp->packages; j; j = j->next) { alpm_pkg_t *pkg = j->data; + alpm_trans_t *trans = db->handle->trans; if(alpm_pkg_find(ignorelist, pkg->name)) { continue; } + if(trans != NULL && trans->flags & ALPM_TRANS_FLAG_NEEDED) { + alpm_pkg_t *local = _alpm_db_get_pkgfromcache(db->handle->db_local, pkg->name); + if(local && _alpm_pkg_compare_versions(pkg, local) == 0) { + /* with the NEEDED flag, packages up to date are not reinstalled */ + _alpm_log(db->handle, ALPM_LOG_WARNING, _("%s-%s is up to date -- skipping\n"), + local->name, local->version); + ignorelist = alpm_list_add(ignorelist, pkg); + continue; + } + } if(alpm_pkg_should_ignore(db->handle, pkg)) { alpm_question_install_ignorepkg_t question = { .type = ALPM_QUESTION_INSTALL_IGNOREPKG, |