From dae15112df43f66055832f0c081c5d53c2bf222b Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Mon, 11 Jun 2007 11:59:09 +0300 Subject: [PATCH] Permit multiple versions of a package to be installed (-i) within a single transaction (rhbz#213399) --- lib/depends.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/depends.c b/lib/depends.c index dfffa9a03..395d657f5 100644 --- a/lib/depends.c +++ b/lib/depends.c @@ -201,9 +201,12 @@ int rpmtsAddInstallElement(rpmts ts, Header h, if ((this = rpmteDS(p, RPMTAG_NAME)) == NULL) continue; /* XXX can't happen */ - /* If newer NEVR was previously added, then skip adding older. */ + /* + * On upgrade, if newer NEVR was previously added, + * then skip adding older. + */ rc = rpmdsCompare(newChk, this); - if (rc != 0) { + if (upgrade && rc != 0) { const char * pkgNEVR = rpmdsDNEVR(this); const char * addNEVR = rpmdsDNEVR(oldChk); if (rpmIsVerbose()) @@ -215,9 +218,12 @@ int rpmtsAddInstallElement(rpmts ts, Header h, break; } - /* If older NEVR was previously added, then replace old with new. */ + /* + * On upgrade, if older NEVR was previously added, + * then replace old with new. + */ rc = rpmdsCompare(oldChk, this); - if (rc != 0) { + if (upgrade && rc != 0) { const char * pkgNEVR = rpmdsDNEVR(this); const char * addNEVR = rpmdsDNEVR(newChk); if (rpmIsVerbose())