Permit multiple versions of a package to be installed (-i)

within a single transaction (rhbz#213399)
This commit is contained in:
Panu Matilainen 2007-06-11 11:59:09 +03:00
parent cb55ab4c35
commit dae15112df
1 changed files with 10 additions and 4 deletions

View File

@ -201,9 +201,12 @@ int rpmtsAddInstallElement(rpmts ts, Header h,
if ((this = rpmteDS(p, RPMTAG_NAME)) == NULL) if ((this = rpmteDS(p, RPMTAG_NAME)) == NULL)
continue; /* XXX can't happen */ 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); rc = rpmdsCompare(newChk, this);
if (rc != 0) { if (upgrade && rc != 0) {
const char * pkgNEVR = rpmdsDNEVR(this); const char * pkgNEVR = rpmdsDNEVR(this);
const char * addNEVR = rpmdsDNEVR(oldChk); const char * addNEVR = rpmdsDNEVR(oldChk);
if (rpmIsVerbose()) if (rpmIsVerbose())
@ -215,9 +218,12 @@ int rpmtsAddInstallElement(rpmts ts, Header h,
break; 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); rc = rpmdsCompare(oldChk, this);
if (rc != 0) { if (upgrade && rc != 0) {
const char * pkgNEVR = rpmdsDNEVR(this); const char * pkgNEVR = rpmdsDNEVR(this);
const char * addNEVR = rpmdsDNEVR(newChk); const char * addNEVR = rpmdsDNEVR(newChk);
if (rpmIsVerbose()) if (rpmIsVerbose())