[Rpm-maint] Fix ordering with --nodeps

Panu Matilainen pmatilai at redhat.com
Thu Jun 14 11:11:39 UTC 2007


On Wed, 13 Jun 2007, Michael Schroeder wrote:

>
> Here's a small fix that was part of the patchrpm patch:
>
> --- rpminstall.c.orig	2007-02-09 16:28:40.000000000 +0100
> +++ rpminstall.c	2007-02-09 16:31:17.000000000 +0100
> @@ -679,6 +679,8 @@
>     }
>
>     if (eiu->numRPMS && !(ia->installInterfaceFlags & INSTALL_NOORDER)) {
> +	if (ia->installInterfaceFlags & INSTALL_NODEPS)
> +	    rpmalMakeIndex(ts->addedPackages);
> 	if (rpmtsOrder(ts)) {
> 	    eiu->numFailed = eiu->numPkgs;
> 	    stopInstall = 1;
>
> rpmalMakeIndex is normally called by rpmtsCheck(), which gets skipped
> if --nodeps is used.

Right, nice catch.

But calling rpmalMakeIndex() should really be done by rpmtsOrder(), 
requiring API users to know about such internal details is nasty. And 
actually there is a call to make the index in rpmtsOrder(), it's just 
ifdef'ed out ATM. Presumably to avoid needlessly recreating the index in 
the normal case where both rpmtsCheck() and rpmtsOrder() are called.

The proper fix I suppose would be to add rpmal internal tracking whether 
an index rebuild is necessary (set on rpmalAdd/Del etc) and if no changes 
have been done since last index creation, have rpmalMakeIndex() just 
return without doing unnecessary work.

 	- Panu -



More information about the Rpm-maint mailing list