Bug 585424 - Langpacks goes on crack in LANG=C, for "removals" _and_ "updated", removing everything
Summary: Langpacks goes on crack in LANG=C, for "removals" _and_ "updated", removing e...
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: yum-langpacks   
(Show other bugs)
Version: 13
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Jens Petersen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Keywords:
: 584997 (view as bug list)
Depends On:
Blocks: F13Blocker, F13FinalBlocker
TreeView+ depends on / blocked
 
Reported: 2010-04-23 23:35 UTC by James Antill
Modified: 2010-05-04 23:54 UTC (History)
5 users (show)

Fixed In Version: yum-langpacks-0.1.5-2.fc13
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-05-04 23:54:34 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Fix the problems with langpacks deleting systems. (1.16 KB, patch)
2010-04-24 14:42 UTC, James Antill
no flags Details | Diff

Description James Antill 2010-04-23 23:35:01 UTC
Description of problem:

 There are two bugs, which can combine to make yum-langpacks rm most of the system (and, yes, I introduced both of them).

1. We catch obsoletes as well as removals with:

            elif member.ts_state in ('e', None):
                remove_deps_from_ts(conduit, po)

...but "None" is that state for "obsoleted" _and_ "updated". So any updated package can try and remove all it's languages.

2. remove_deps_from_ts() is done via:

     for pkg in yb.rpmdb.returnPackages(patterns=pkgmatches):
        yb.remove(pattern=pkg.name)

...except pkgmatches will == [] _if_ LANG=C, and due to weird back compat. behaviour rpmdb.returnPackages(patterns=[]) returns all the packages on the system.

 For F-13 just fix #1 by just checking for == 'e' again, and ignore obsoleted for now. Again, for F-13 #2 needs an:

  if not pkgmatches: return

Comment 1 James Antill 2010-04-23 23:37:02 UTC
 I haven't tested an F-13 box with langpacks yet (I can do that later tonight if nobody else gets around to it) ... but following the code, I'm pretty sure it can happen.

 Someone just try updating openoffice-core in F-13, with LANG=C.

Comment 2 James Antill 2010-04-23 23:59:30 UTC
 99.999% confirmed this on an F-13 box:

% sudo yum install yum-langpacks
[...]
% sudo yum downgrade openoffice.org --releasever=12
[...]
Dep fails.
% LANG=C sudo yum downgrade openoffice.org --releasever=12
[...]
Wants to erase glibc etc.

Comment 3 Jens Petersen 2010-04-24 05:36:59 UTC
Thanks James for the report.

I would really appreciate patch please, though if not I will try to grok
your comments as best I can.

Comment 4 Jens Petersen 2010-04-24 05:38:59 UTC
(I am not really convinced that this is a blocker though given
that yum-langpacks is not installed by default in F13, but sure
let's fix it.  You're also more than welcome to commit the fix.:)

Comment 5 James Antill 2010-04-24 14:40:52 UTC
Well I'm pretty sure this is what deleted Jim Meyering's box:

http://lists.fedoraproject.org/pipermail/devel/2010-April/135037.html

...so it seemed kind of important ;).

 I have F-13 changes ready to go, as soon as I get ACLs to commit.

Comment 6 James Antill 2010-04-24 14:42:04 UTC
Created attachment 408836 [details]
Fix the problems with langpacks deleting systems.

Here is the patch, in case you want to do it yourself.

Comment 7 Fedora Update System 2010-04-26 13:57:46 UTC
yum-langpacks-0.1.5-2.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/yum-langpacks-0.1.5-2.fc13

Comment 8 seth vidal 2010-04-26 19:39:05 UTC
*** Bug 584997 has been marked as a duplicate of this bug. ***

Comment 9 Jens Petersen 2010-04-27 04:43:47 UTC
Thank you very much, James.  Appreciate your assistance.

I didn't realise what a dangerous business I was getting into. :(

Comment 10 Fedora Update System 2010-04-27 05:51:24 UTC
yum-langpacks-0.1.5-2.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update yum-langpacks'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/yum-langpacks-0.1.5-2.fc13

Comment 11 Jim Meyering 2010-04-27 08:09:57 UTC
Thanks for the fix, James, and for the heads-up, Seth.
I confirm that LC_ALL=C is often set in my environment (in which case, LANG is not set at all).

Comment 12 Adam Williamson 2010-05-03 20:44:58 UTC
This needs to be tested ASAP to get in for final. I will try and test it later tonight using the reproduction steps listed above, but any help would obviously be appreciated :)



-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers

Comment 13 Adam Williamson 2010-05-03 22:50:44 UTC
Can't find a reproducer for the actual bug with the current package set, but the updated yum-langpacks installs correctly and does what it's meant to do.



-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers

Comment 14 Adam Williamson 2010-05-04 23:27:52 UTC
can the update please be submitted to stable ASAP? it has sufficient karma. thanks!

Comment 15 Fedora Update System 2010-05-04 23:54:30 UTC
yum-langpacks-0.1.5-2.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.


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