Bug 35828 - rpmtrans interface doesn't check for duplicate removals
rpmtrans interface doesn't check for duplicate removals
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
7.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
David Lawrence
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-04-12 16:23 EDT by Greg Hudson
Modified: 2007-04-18 12:32 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-04-12 16:23:04 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Greg Hudson 2001-04-12 16:23:00 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.2.17-14 i686)


I have a home-grown program which attempts to migrate a system from one
list of
RPMs to another list (perhaps preserving locally added or removed or
upgraded RPMs if the machine is marked as privately owned).  It uses
rpmtransAddPackage() and
rpmtransRemovePackage(), then does a dependency check and ordering, and
then
calls rpmRunTransactions().

Sometimes one of the packages to be added has an "Obsoletes" declaration
for one of the packages which was to be removed.  In this case,
rpmtransAddPackage() removes the package, and then I wind up removing it
myself with rpmtransRemovePackage(), so there are now two removal
operations for the same package.  When rpmRunTransactions() tries to
execute the second removal, it fails to find the db offset in the
interface, increments the error count, and eventually returns an error
status (without ever having printed an error message, so I had to pull out
the debugger to diagnose the error return).

It would seem prudent for rmplib to check internally for duplicate package
removals.  Barring that, it would be nice (to say the least) if rpmlib had
a mechanism for the application to avert duplicate removals.  Internally,
rpmlib references the transaction's removedPackages array, but that
mechanism is not available to the application since transaction sets are an
opaque type.

Reproducible: Always
Steps to Reproduce:
Write a program which adds and removes packages using the rpmtrans
interface, and try to use it.
Comment 1 Jeff Johnson 2001-05-16 15:19:18 EDT
Hmmm, the problem is much worse than obsoletes, as this is the ximian
destroying databases problem AFAICT. FIxed in rpm-4.0.3-0.22, thanks
for another astute call.

Note You need to log in before you can comment on or make changes to this bug.