From: Michael Schroeder Date: Wed, 14 Sep 2022 09:55:45 +0000 (+0200) Subject: Do not autouninstall suse ptf packages X-Git-Tag: 0.7.23~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1175431412799f944c31c7d40ebd3dae9ef1f528;p=thirdparty%2Flibsolv.git Do not autouninstall suse ptf packages --- diff --git a/src/problems.c b/src/problems.c index a228e455..72df03fa 100644 --- a/src/problems.c +++ b/src/problems.c @@ -220,6 +220,16 @@ solver_disableproblemset(Solver *solv, int start) solver_disableproblem(solv, solv->problems.elements[i]); } +#ifdef SUSE +static inline int +suse_isptf(Pool *pool, Solvable *s) +{ + if (!strncmp("ptf-", pool_id2str(pool, s->name), 4)) + return 1; + return 0; +} +#endif + /*------------------------------------------------------------------- * try to fix a problem by auto-uninstalling packages */ @@ -250,6 +260,10 @@ solver_autouninstall(Solver *solv, int start) Id p = solv->installed->start + (v - solv->updaterules); if (m && !MAPTST(m, v - solv->updaterules)) continue; +#ifdef SUSE + if (suse_isptf(pool, pool->solvables + p)) + continue; /* do not autouninstall ptf packages */ +#endif if (pool->considered && !MAPTST(pool->considered, p)) continue; /* do not uninstalled disabled packages */ if (solv->bestrules_info && solv->bestrules_end > solv->bestrules)