Bug 1013221 - yum langavailable shows nothing
yum langavailable shows nothing
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: yum-langpacks (Show other bugs)
19
All Linux
unspecified Severity low
: ---
: ---
Assigned To: Parag Nemade
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-28 08:58 EDT by Fidel Leon
Modified: 2013-10-15 02:29 EDT (History)
5 users (show)

See Also:
Fixed In Version: yum-langpacks-0.4.2-1.fc20
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-10-15 02:29:14 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
revert back the postreposetup_hook function name (730 bytes, patch)
2013-09-28 11:12 EDT, Parag Nemade
no flags Details | Diff
Setup conditional pkgs. for lang commands. (2.81 KB, patch)
2013-09-30 11:38 EDT, James Antill
no flags Details | Diff
Setup conditional pkgs. for lang commands. (2.93 KB, patch)
2013-09-30 15:35 EDT, James Antill
no flags Details | Diff

  None (edit)
Description Fidel Leon 2013-09-28 08:58:56 EDT
Description of problem:

yum langavailable shows "Displaying all available language:-" and no languages are listed.

Version-Release number of selected component (if applicable):

# rpm -q yum-langpacks
yum-langpacks-0.4.1-2.fc19.noarch


How reproducible:


Steps to Reproduce:
# yum langavailable
Complementos cargados:fastestmirror, langpacks, refresh-packagekit
Loading mirror speeds from cached hostfile
 * fedora: mir01.syntis.net
 * rpmfusion-free: mir01.syntis.net
 * rpmfusion-free-updates: mir01.syntis.net
 * rpmfusion-free-updates-testing: mir01.syntis.net
 * rpmfusion-nonfree: mir01.syntis.net
 * rpmfusion-nonfree-updates: mir01.syntis.net
 * rpmfusion-nonfree-updates-testing: mir01.syntis.net
 * updates: mir01.syntis.net
 * updates-testing: mir01.syntis.net
Displaying all available language:-

# yum langinstall ca_CA
Loaded plugins: fastestmirror, langpacks, refresh-packagekit
Loading mirror speeds from cached hostfile
 * fedora: mir01.syntis.net
 * rpmfusion-free: mir01.syntis.net
 * rpmfusion-free-updates: mir01.syntis.net
 * rpmfusion-free-updates-testing: mir01.syntis.net
 * rpmfusion-nonfree: mir01.syntis.net
 * rpmfusion-nonfree-updates: mir01.syntis.net
 * rpmfusion-nonfree-updates-testing: mir01.syntis.net
 * updates: mir01.syntis.net
 * updates-testing: mir01.syntis.net
No langpacks to install for: ca_CA


Expected results:

Installation of language-related packages (KDE, LibreOffice, etc).
Comment 1 Parag Nemade 2013-09-28 10:27:06 EDT
oops! I was even not knowing this update got pushed to stable. Looks like people given karma to this update also did same testing of "time yum list yum"

I just realized that second patch applied in yum-langpacks-0.4.1-2 update made yum-langpacks commands to give blank output.

Please downgrade to previous update.
Comment 2 Fidel Leon 2013-09-28 10:50:17 EDT
Okay, since I can't find a RPM package for an older version:

# wget https://fedorahosted.org/releases/y/u/yum-langpacks/yum-langpacks-0.4.1.tar.gz
# tar xfz yum-langpacks-0.4.1.tar.gz
# cd yum-langpacks-0.4.1
# make
# cd dist/yum-langpacks-0.4.1
# cp langpacks.py /usr/lib/yum-plugins
# yum langavailable
Displaying all available language:-
Afrikaans [af]
Akan [ak]
Albanian [sq]
Amharic [am]
Ancient Greek [grc]
[.......]

So it's 0.4.1-2 which brought my bug :)
Comment 3 Parag Nemade 2013-09-28 11:12:58 EDT
Created attachment 804432 [details]
revert back the postreposetup_hook function name

Last update changed postreposetup_hook() function name to my_postreposetup_hook()
reverting this change will make commands to work
Comment 4 Parag Nemade 2013-09-28 11:31:22 EDT
you can downgrade any package using command "yum downgrade yum-langpacks"
Comment 5 Fidel Leon 2013-09-28 11:38:31 EDT
Thanks for the feedback. My F19 is a fresh install and yum downgrade goes to a 0.3.x version. Can I use yum to downgrade to a specific version?
Comment 6 Parag Nemade 2013-09-28 11:54:08 EDT
If you know any specific build is working for you previously then you can download it from http://koji.fedoraproject.org/koji/index

e.g. to download working build of yum-langpacks you will go to http://koji.fedoraproject.org/koji/packageinfo?packageID=9679

and then click on yum-langpacks-0.4.1-1.fc19 link -> http://koji.fedoraproject.org/koji/buildinfo?buildID=464213

and download the required binary rpm -> here you will download http://kojipkgs.fedoraproject.org//packages/yum-langpacks/0.4.1/1.fc19/noarch/yum-langpacks-0.4.1-1.fc19.noarch.rpm

and to install this downloaded rpm, you will go to directory where you downloaded this rpm and use command as root user
yum localinstall yum-langpacks-0.4.1-1.fc19.noarch.rpm
Comment 7 Fidel Leon 2013-09-28 11:58:22 EDT
Thanks for your feedback! I knew about installing packages by hand but didn't know anything about koji, very appreciated!!
Comment 8 Fedora Update System 2013-09-30 05:29:09 EDT
yum-langpacks-0.4.1-3.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/yum-langpacks-0.4.1-3.fc20
Comment 9 Fedora Update System 2013-09-30 05:29:56 EDT
yum-langpacks-0.4.1-3.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/yum-langpacks-0.4.1-3.fc19
Comment 10 Fidel Leon 2013-09-30 07:38:14 EDT
# yum langavailable
Loaded plugins: fastestmirror, langpacks, refresh-packagekit

Displaying all available language:-
Afrikaans [af]
Akan [ak]
Albanian [sq]
Amharic [am]
Ancient Greek [grc]
Arabic [ar]
[... snipped ...]

b)
# yum langinfo ja
Language-Id=ja
  autocorr-ja
  kde-l10n-Japanese
  eclipse-nls-ja
  libreoffice-langpack-ja
  man-pages-ja

c)
# yum langlist
Loaded plugins: fastestmirror, langpacks, refresh-packagekit
Installed languages:

[empty]

Since I messed my config up a little bit trying to sole this issue before reporting a bug, I don't know where the langpacks plugin stores its list of installed languages. I have installed a new language package (pt_PT) to check if it updates something, but I still get an empty list. 

I'm not too Python savvy, but I see:

conffile = yb.conf.persistdir + '/plugins/langpacks/installed_langpacks'

in the init_hook function, but /etc/yum/pluginconf.d/langpacks.conf says:

# What langpacks to install is all of:
# - any previously installed langpacks (stored in /var/lib/yum/plugins/langpacks)

As a matter of fact, I don't have a /var/lib/yum/plugins directory (and of course, no langpacks or installed_langpacks file inside it).

If I try to install a language package I know I already have (for example, ca_CA):
No langpacks to install for: ca_CA

If I try a langinstall ca_CA:

# yum langinfo ca_CA | grep ^\ \ | xargs yum install
Loaded plugins: fastestmirror, langpacks, refresh-packagekit
Loading mirror speeds from cached hostfile

Package eclipse-nls-ca-4.2.0.v20121120043402-2.fc19.noarch already installed and latest version
Package 1:hyphen-ca-0.9.3-5.fc19.noarch already installed and latest version
Package 1:autocorr-ca-4.1.2.2-1.fc19.noarch already installed and latest version
Package hunspell-ca-2.3-3.fc19.noarch already installed and latest version
Package 1:libreoffice-langpack-ca-4.1.2.2-1.fc19.i686 already installed and latest version
Package calligra-l10n-ca-2.7.2-1.fc19.noarch already installed and latest version
Package mythes-ca-1.5.0-8.fc19.noarch already installed and latest version
Package kde-l10n-Catalan-4.11.1-1.fc19.noarch already installed and latest version
Nothing to do

Confirming I already installed such language.

Anyway, it's way better than 1.4.1-2 :)
Comment 11 James Antill 2013-09-30 11:38:57 EDT
Created attachment 805271 [details]
Setup conditional pkgs. for lang commands.

(In reply to Parag from comment #3)
> Created attachment 804432 [details]
> revert back the postreposetup_hook function name
> 
> Last update changed postreposetup_hook() function name to
> my_postreposetup_hook()
> reverting this change will make commands to work

 If you want to revert this you can just remove the patch, but instead I think you can add the setup to the lang. commands too (not super tested).
Comment 12 Parag Nemade 2013-09-30 11:54:01 EDT
(In reply to James Antill from comment #11)
> Created attachment 805271 [details]
> Setup conditional pkgs. for lang commands.
> 
> (In reply to Parag from comment #3)
> > Created attachment 804432 [details]
> > revert back the postreposetup_hook function name
> > 
> > Last update changed postreposetup_hook() function name to
> > my_postreposetup_hook()
> > reverting this change will make commands to work
> 
>  If you want to revert this you can just remove the patch, but instead I
> think you can add the setup to the lang. commands too (not super tested).

I better wait for some more testing on 4.1-3 build and check on your patch. Continuous building package updates is not a good idea.

I am not the original developer of yum-langpacks but I saw that postreposetup_hook is standard hook written as part of yum plugin as per http://yum.baseurl.org/wiki/WritingYumPlugins

You added again my_postreposetup_hook function. Can you elaborate more on your new patch?

I see first patch already improved timings for command execution "yum list yum"
Comment 13 Parag Nemade 2013-09-30 12:05:20 EDT
Fidel,
  Thank you very much for your testing and karma for yum-langpacks-4.1-3 build. 

Have you checked as a root user if you have file /var/lib/yum/plugins/langpacks/installed_langpacks ?
Comment 14 Fidel Leon 2013-09-30 12:26:01 EDT
No, unfortunately, I didn't even had a /var/lib/yum/plugins directory... which is funny, since it should be created by yum :-/

BTW is there anything I can do with the new attached patch? I'm not used at patch/git internals :( and anyway it doesn't apply to langpacks.py (0.4.1-3)
Comment 15 Fidel Leon 2013-09-30 12:33:10 EDT
I have just created /var/lib/yum/plugins/langpacks and installed a new language.

# yum langinstall bs
Loaded plugins: fastestmirror, langpacks, refresh-packagekit
Loading mirror speeds from cached hostfile
 * fedora: mir01.syntis.net
 * rpmfusion-free: mir01.syntis.net
 * rpmfusion-free-updates: mir01.syntis.net
 * rpmfusion-free-updates-testing: mir01.syntis.net
 * rpmfusion-nonfree: mir01.syntis.net
 * rpmfusion-nonfree-updates: mir01.syntis.net
 * rpmfusion-nonfree-updates-testing: mir01.syntis.net
 * updates: mir01.syntis.net
 * updates-testing: mir01.syntis.net
--> Running transaction check
---> Package calligra-l10n-bs.noarch 0:2.7.2-1.fc19 will be installed
---> Package kde-l10n-Bosnian.noarch 0:4.11.1-1.fc19 will be installed

Proceeded and checked wether the folder is populated:

# cat /var/lib/yum/plugins/langpacks/installed_langpacks 
bs

# yum langlist
Loaded plugins: fastestmirror, langpacks, refresh-packagekit
Installed languages:
	Bosnian

So once the folder exists, the file "installed_langpacks" is populated, hence making yum-langpacks working.

Anyway, from the files pulled by yum-langpacks:
/etc/yum/pluginconf.d/langpacks.conf
/usr/lib/python2.7/site-packages/yum_langpacks-0.4.1-py2.7.egg-info
/usr/lib/python2.7/site-packages/yum_langpacks-0.4.1-py2.7.egg-info/PKG-INFO
/usr/lib/python2.7/site-packages/yum_langpacks-0.4.1-py2.7.egg-info/SOURCES.txt
/usr/lib/python2.7/site-packages/yum_langpacks-0.4.1-py2.7.egg-info/dependency_links.txt
/usr/lib/python2.7/site-packages/yum_langpacks-0.4.1-py2.7.egg-info/top_level.txt
/usr/lib/yum-plugins/langpacks.py
/usr/lib/yum-plugins/langpacks.pyc
/usr/lib/yum-plugins/langpacks.pyo
/usr/share/doc/yum-langpacks-0.4.1
/usr/share/doc/yum-langpacks-0.4.1/COPYING
/usr/share/doc/yum-langpacks-0.4.1/README
/usr/share/man/man8/yum-langpacks.8.gz

the /var/lib/yum/plugins/langpacks is not created by package installation...
Comment 16 James Antill 2013-09-30 15:35:25 EDT
Created attachment 805493 [details]
Setup conditional pkgs. for lang commands.

 Fix missing part of patch, also tested a bit more and everything seems good to me (incl. speed savings).
Comment 17 Fedora Update System 2013-09-30 22:03:56 EDT
Package yum-langpacks-0.4.1-3.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing yum-langpacks-0.4.1-3.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-17989/yum-langpacks-0.4.1-3.fc20
then log in and leave karma (feedback).
Comment 18 Parag Nemade 2013-10-02 04:37:34 EDT
patch is not cleanly applied. Please, Provide new patch to yum-langpacks-0.4.1-3
Comment 19 James Antill 2013-10-02 10:13:58 EDT
 Patch was against upstream yum-langpacks, in my git repo. I have:

commit 3ea02c4ff2bb7e751fc6981d0cfcafe4c4954fda
Author: James Antill <james@and.org>
Date:   Mon Sep 30 11:36:16 2013 -0400

    Setup conditional pkgs. for lang commands. BZ 1013221.

commit 7babcc4f89afbf4234325d2da84d4b37be560661
Author: James Antill <james@and.org>
Date:   Tue Sep 24 15:02:33 2013 -0400

    Don't download groups and setup conditional_pkgs unless we need to.

commit c716e9c15762945817c487c2f43ec319760dd8b1
Author: James Antill <james@and.org>
Date:   Tue Sep 24 15:02:07 2013 -0400

    Don't load langtable unless we need it, it takes ages to load.

commit 7f75694ffffadfa5b67df62b903ba311eb4baa7d
Author: Parag Nemade <pnemade@redhat.com>
Date:   Thu Sep 12 09:59:51 2013 +0530

    update Changelog


...so it should apply cleanly (or git would complain), and 3ea02c4ff2b appears to be what I've uploaded. So I'm not sure what you want the diff against :(.

 Here is the full .py file:

http://james.fedorapeople.org/yum/plugins/langpacks.py
Comment 20 Parag Nemade 2013-10-02 10:19:36 EDT
Okay. Fine. I will check on it.
Comment 21 Fedora Update System 2013-10-02 21:13:48 EDT
yum-langpacks-0.4.1-3.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 22 Parag Nemade 2013-10-03 23:59:12 EDT
I will change my_postreposetup_hook() to postreposetup_hook() in the given patch and build a new package soon.
Comment 23 James Antill 2013-10-04 14:22:53 EDT
(In reply to Parag from comment #22)
> I will change my_postreposetup_hook() to postreposetup_hook() in the given
> patch and build a new package soon.

 So you want to revert the initial patch? Is there anything I can help you with to get the optimization into the plugin?

 When you have a function called postreposetup_hook() that will be called everytime the repos. are setup ... which means it'll run when the user does "yum version" or "yum list yum" etc. etc.
 Given that the hook force loaded/parsed groups, that was a significant overhead. Renaming the function and calling it explicitly when needed was the optimization.
Comment 24 Parag Nemade 2013-10-05 00:02:28 EDT
The only thing I wanted to know here is why we removed function named postreposetup_hook() and added new function my_postreposetup_hook(). Your above reply explains that this change actually brought some optimization. I thought that function is essential for yum-plugins but looks not. 

Thank you. I will commit your patch without modification.
Comment 25 Fedora Update System 2013-10-08 06:27:27 EDT
yum-langpacks-0.4.2-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/yum-langpacks-0.4.2-1.fc20
Comment 26 Fedora Update System 2013-10-09 10:28:02 EDT
yum-langpacks-0.4.1-3.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 27 Fedora Update System 2013-10-09 10:32:04 EDT
Package yum-langpacks-0.4.2-1.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing yum-langpacks-0.4.2-1.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-18553/yum-langpacks-0.4.2-1.fc20
then log in and leave karma (feedback).
Comment 28 Fedora Update System 2013-10-15 02:29:14 EDT
yum-langpacks-0.4.2-1.fc20 has been pushed to the Fedora 20 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.