Bug 1164041 - Erasing one version of duplicate autocorr-en tries to erase the others
Summary: Erasing one version of duplicate autocorr-en tries to erase the others
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: yum-langpacks
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Parag Nemade
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-11-14 00:43 UTC by Matt McCutchen
Modified: 2015-06-29 23:18 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-06-29 23:18:14 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Matt McCutchen 2014-11-14 00:43:44 UTC
Description of problem:
My machine crashed in the middle of a yum transaction that included an update of the autocorr-en package and was left with two versions (really, releases) installed:

autocorr-en-4.2.7.2-1.fc20.noarch
autocorr-en-4.2.7.2-4.fc20.noarch

When I ran yum-complete-transaction, it tried to do the erase of autocorr-en-4.2.7.2-1.fc20.noarch.  Since autocorr-en is configured as a conditional package on itself, the code path at https://git.fedorahosted.org/cgit/yum-langpacks.git/tree/langpacks.py#n489 tried to erase _all_ versions of autocorr-en.  In my case, this led to broken dependencies and the transaction failed; it's conceivable that in other cases, the dependent packages would simply be automatically erased.

AFAIK, the only way this could happen to a normal user is via a system crash, but I was able to reproduce it by manually reinstalling the old version with "rpm -i --oldpackage --replacefiles autocorr-en-4.2.7.2-1.fc20.noarch.rpm" and then running "yum erase autocorr-en-4.2.7.2-1.fc20.noarch".

Note, not all pairs of autocorr-en versions reproduce the problem.  For instance, I tried autocorr-en-4.1.3.2-9.fc20 in combination with autocorr-en-4.2.7.2-4.fc20.noarch and did not reproduce the problem.  This appears to be because:
- First the package we originally wanted to erase is added to the transaction set.
- Then the langpacks plugin calls yb.remove(pattern='autocorr-en') ( https://git.fedorahosted.org/cgit/yum-langpacks.git/tree/langpacks.py#n390 ), multiple times in fact.  This method uses matchPackageNames, which returns the matching RPMInstalledPackage objects in Python set iteration order via misc.unique.  The calls to yb.remove(pattern='autocorr-en') get into a cycle in which each time the originally requested package is processed, the code at http://yum.baseurl.org/gitweb?p=yum.git;a=blob;f=yum/__init__.py;h=6d2c07861499840c214ab7444a480f33b3e97cae;hb=HEAD#l5419 clears the transaction set and then adds back that package.  Other packages are simply added to the transaction set when they are processed.
 - So at the end, the originally requested package and any that came _after_ it in the iteration order are the ones that are left in the transaction set to be erased.

Version-Release number of selected component (if applicable):
yum-langpacks-0.4.3-1.fc20.noarch

How reproducible:
Always

Steps to Reproduce:
1. Have autocorr-en-4.2.7.2-4.fc20.noarch installed.
2. wget https://kojipkgs.fedoraproject.org//packages/libreoffice/4.2.7.2/1.fc20/noarch/autocorr-en-4.2.7.2-1.fc20.noarch.rpm
3. rpm -ivh --oldpackage --replacefiles autocorr-en-4.2.7.2-1.fc20.noarch.rpm 
4. yum erase autocorr-en-4.2.7.2-1.fc20.noarch

Actual results:
Yum wants to erase all versions of autocorr-en and dependent packages.

Expected results:
Only the specified version is erased.

Comment 1 Fedora End Of Life 2015-05-29 13:17:59 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '20'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 2 Fedora End Of Life 2015-06-29 23:18:14 UTC
Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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