Bug 585424 - Langpacks goes on crack in LANG=C, for "removals" _and_ "updated", removing everything
Langpacks goes on crack in LANG=C, for "removals" _and_ "updated", removing e...
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: yum-langpacks (Show other bugs)
13
All Linux
high Severity high
: ---
: ---
Assigned To: Jens Petersen
Fedora Extras Quality Assurance
:
: 584997 (view as bug list)
Depends On:
Blocks: F13Blocker/F13FinalBlocker
  Show dependency treegraph
 
Reported: 2010-04-23 19:35 EDT by James Antill
Modified: 2010-05-04 19:54 EDT (History)
5 users (show)

See Also:
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 19:54:34 EDT
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 10:42 EDT, James Antill
no flags Details | Diff

  None (edit)
Description James Antill 2010-04-23 19:35:01 EDT
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 19:37:02 EDT
 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 19:59:30 EDT
 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 01:36:59 EDT
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 01:38:59 EDT
(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 10:40:52 EDT
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 10:42:04 EDT
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 09:57:46 EDT
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 15:39:05 EDT
*** Bug 584997 has been marked as a duplicate of this bug. ***
Comment 9 Jens Petersen 2010-04-27 00:43:47 EDT
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 01:51:24 EDT
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 04:09:57 EDT
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 16:44:58 EDT
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 18:50:44 EDT
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 19:27:52 EDT
can the update please be submitted to stable ASAP? it has sufficient karma. thanks!
Comment 15 Fedora Update System 2010-05-04 19:54:30 EDT
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.