summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-11-12 19:33:12 +0200
committerPanu Matilainen <pmatilai@redhat.com>2008-11-12 19:33:12 +0200
commitc11c97b67cda698486cee26f0621231731c6ebcf (patch)
tree2289b0aee9bd941da6f0e05ec094affd0f6ddd94 /lib
parent3cfac308be04a96a192afa8be8f6a7c08bfbdfba (diff)
downloadlibrpm-tizen-c11c97b67cda698486cee26f0621231731c6ebcf.tar.gz
librpm-tizen-c11c97b67cda698486cee26f0621231731c6ebcf.tar.bz2
librpm-tizen-c11c97b67cda698486cee26f0621231731c6ebcf.zip
Take advantage of headerGetInstance() in removePackage()
- avoids an extra argument, making dboffset argument to rpmtsAddEraseElement() unused
Diffstat (limited to 'lib')
-rw-r--r--lib/depends.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/depends.c b/lib/depends.c
index 746c8fc7e..d33a3a42b 100644
--- a/lib/depends.c
+++ b/lib/depends.c
@@ -61,14 +61,13 @@ static int intcmp(const void * a, const void * b)
* Add removed package instance to ordered transaction set.
* @param ts transaction set
* @param h header
- * @param dboffset rpm database instance
* @param depends installed package of pair (or RPMAL_NOMATCH on erase)
* @return 0 on success
*/
-static int removePackage(rpmts ts, Header h, int dboffset,
- rpmalKey depends)
+static int removePackage(rpmts ts, Header h, rpmalKey depends)
{
rpmte p;
+ unsigned int dboffset = headerGetInstance(h);
/* Filter out duplicate erasures. */
if (ts->numRemovedPackages > 0 && ts->removedPackages != NULL) {
@@ -295,7 +294,7 @@ addheader:
if (rpmVersionCompare(h, oh) == 0)
continue;
- xx = removePackage(ts, oh, rpmdbGetIteratorOffset(mi), pkgKey);
+ xx = removePackage(ts, oh, pkgKey);
}
mi = rpmdbFreeIterator(mi);
@@ -348,7 +347,7 @@ addheader:
#ifdef DYING /* XXX see http://bugzilla.redhat.com #134497 */
if (rpmVersionCompare(h, oh))
#endif
- xx = removePackage(ts, oh, rpmdbGetIteratorOffset(mi), pkgKey);
+ xx = removePackage(ts, oh, pkgKey);
rpmlog(RPMLOG_DEBUG, " Obsoletes: %s\t\terases %s\n",
rpmdsDNEVR(obsoletes)+2, ohNEVRA);
ohNEVRA = _free(ohNEVRA);
@@ -370,7 +369,7 @@ exit:
int rpmtsAddEraseElement(rpmts ts, Header h, int dboffset)
{
- return removePackage(ts, h, dboffset, RPMAL_NOMATCH);
+ return removePackage(ts, h, RPMAL_NOMATCH);
}
/**