diff options
author | Michael Schroeder <mls@suse.de> | 2013-10-16 16:29:02 +0200 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2013-10-16 16:29:02 +0200 |
commit | ca11fec4bb48013ef602e5bec1b776c738c5075e (patch) | |
tree | a7455c5079f91dd78b14b22cd485e5be54c91863 /src/transaction.c | |
parent | 1bf740281a9d6ed93b0cc63bdd8bd67f543fb9ac (diff) | |
download | libsolv-ca11fec4bb48013ef602e5bec1b776c738c5075e.tar.gz libsolv-ca11fec4bb48013ef602e5bec1b776c738c5075e.tar.bz2 libsolv-ca11fec4bb48013ef602e5bec1b776c738c5075e.zip |
add is_noinst_pseudo_package(), use it for filtering installs
Diffstat (limited to 'src/transaction.c')
-rw-r--r-- | src/transaction.c | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/src/transaction.c b/src/transaction.c index 22496f2..a823abf 100644 --- a/src/transaction.c +++ b/src/transaction.c @@ -199,14 +199,44 @@ transaction_base_type(Transaction *trans, Id p) } } +/* these packages do not get installed by the package manager */ static inline int is_pseudo_package(Pool *pool, Solvable *s) { const char *n = pool_id2str(pool, s->name); + if (*n == 'p' && !strncmp(n, "patch:", 6)) + return 1; + if (*n == 'p' && !strncmp(n, "pattern:", 8)) + return 1; + if (*n == 'p' && !strncmp(n, "product:", 8)) + return 1; + if (*n == 'a' && !strncmp(n, "application:", 12)) + return 1; + return 0; +} + +/* these packages will never show up installed */ +static inline int +is_noinst_pseudo_package(Pool *pool, Solvable *s) +{ + const char *n = pool_id2str(pool, s->name); if (!strncmp(n, "patch:", 6)) return 1; if (!strncmp(n, "pattern:", 8)) - return 1; + { +#if defined(SUSE) && defined(ENABLE_LINKED_PKGS) + /* unlike normal patterns, autopatterns *can* be installed (via the package link), + so do not filter them */ + if (s->provides) + { + Id prv, *prvp = s->repo->idarraydata + s->provides; + while ((prv = *prvp++) != 0) + if (ISRELDEP(prv) && !strcmp(pool_id2str(pool, prv), "autopattern()")) + return 0; + } +#endif + return 1; + } return 0; } @@ -251,7 +281,7 @@ transaction_type(Transaction *trans, Id p, int mode) return SOLVER_TRANSACTION_IGNORE; /* XXX: SUSE only? */ - if (!(mode & SOLVER_TRANSACTION_KEEP_PSEUDO) && is_pseudo_package(pool, s)) + if (!(mode & SOLVER_TRANSACTION_KEEP_PSEUDO) && is_noinst_pseudo_package(pool, s)) return SOLVER_TRANSACTION_IGNORE; type = transaction_base_type(trans, p); |