[Yum-devel] [PATCH 3/3] Fully drop the rpmdb cache if the transaction failed, or was a test.

seth vidal skvidal at fedoraproject.org
Tue Jan 25 17:11:52 UTC 2011


On Tue, 2011-01-25 at 10:43 -0500, James Antill wrote:
> ---
>  yum/__init__.py |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)
> 
> diff --git a/yum/__init__.py b/yum/__init__.py
> index 2d9385e..f6c8403 100644
> --- a/yum/__init__.py
> +++ b/yum/__init__.py
> @@ -1486,7 +1486,12 @@ class YumBase(depsolve.Depsolve):
>  
>          
>          # drop out the rpm cache so we don't step on bad hdr indexes
> -        self.rpmdb.dropCachedDataPostTransaction(list(self.tsInfo))
> +        if (self.ts.isTsFlagSet(rpm.RPMTRANS_FLAG_TEST) or
> +            resultobject.return_code):
> +            self.rpmdb.dropCachedData()
> +        else:
> +            self.rpmdb.dropCachedDataPostTransaction(list(self.tsInfo))
> +
>          self.plugins.run('posttrans')
>          # sync up what just happened versus what is in the rpmdb
>          if not self.ts.isTsFlagSet(rpm.RPMTRANS_FLAG_TEST):

ACK (and <sigh>)

-sv




More information about the Yum-devel mailing list