Bug 1370923 - RFE: Add a package for perl's "Locale::Language"
Summary: RFE: Add a package for perl's "Locale::Language"
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: perl-Locale-Codes
Version: 24
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Petr Pisar
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-28 13:05 UTC by David Tonhofer
Modified: 2016-09-03 10:46 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-08-29 12:25:41 UTC
Type: Bug


Attachments (Terms of Use)

Description David Tonhofer 2016-08-28 13:05:18 UTC
Description of problem:
=======================

The Module "Locale::Language" seems to have no RPM package and doesn't come with the Perl distribution.

It might be useful to have it. 

(It is easy to install over CPAN of course.)
(One may also need Locale::Currency for this, not sure)

Who uses it: FosWiki

Docs:

http://search.cpan.org/~sbeck/Locale-Codes-3.39/lib/Locale/Language.pod
http://perldoc.perl.org/5.8.8/index-modules-L.html

Try:

# perl -e 'use Locale::Language;'
Can't locate Locale/Language.pm ...

# dnf search perl-Locale
perl-Locale-PO.noarch : Perl module for manipulating .po entries from GNU gettext
perl-Locale-US.noarch : Two letter codes for state identification in the United States and vice versa
perl-Locale-Codes.noarch : Distribution of modules to handle locale codes
perl-Locale-Msgfmt.noarch : Compile .po files to .mo files
perl-Locale-gettext.x86_64 : Interface to gettext family of functions
perl-Locale-Maketext.noarch : Framework for localization
perl-Locale-SubCountry.noarch : ISO 3166-2 two letter subcountry codes
perl-Locale-Maketext-Fuzzy.noarch : Maketext from already interpolated strings
perl-Locale-Currency-Format.noarch : Perl functions for formatting monetary values
perl-Locale-Maketext-Simple.noarch : Simple interface to Locale::Maketext::Lexicon
perl-Locale-Maketext-Gettext.noarch : Joins the gettext and Maketext frameworks
perl-Locale-Maketext-Lexicon.noarch : Extract translatable strings from source

Comment 1 Emmanuel Seyman 2016-08-29 12:00:59 UTC
Locale::Language is a module shipped in the Locale-Codes perl dist and is contained in the perl-Locale-Codes package. I have no issues installing it.

dnf install "perl(Locale::Language)"
Last metadata expiration check: 1:06:56 ago on Mon Aug 29 12:51:13 2016.
Package perl-Locale-Codes-3.39-1.fc24.noarch is already installed, skipping.
Dependencies resolved.

Comment 2 Petr Pisar 2016-08-29 12:25:41 UTC
It's as Emmanuel says. The Locale::Language module is delivered by perl-Locale-Codes package. See <http://search.cpan.org/~sbeck/Locale-Codes/>.

Comment 3 David Tonhofer 2016-09-01 08:24:16 UTC
Great. 

Thanks, I missed that one. Sorry about that.

But... what is that package syntax with parentheses?

dnf install "perl(Locale::Language)"

...where does that come from? It doesn't seem to be described in the dnf manpage "SPECIFYING PACKAGES" part.

Comment 4 Ralf Corsepius 2016-09-01 08:40:32 UTC
(In reply to David Tonhofer from comment #3)
> But... what is that package syntax with parentheses?
> 
> dnf install "perl(Locale::Language)"

This is ordinary shell quoting. It is needed to prevent the shell from
interpreting the program argument string (Here: perl(Locale::Language)),
when passing the argument down to the program (Here: dnf).

Comment 5 Petr Pisar 2016-09-01 08:51:18 UTC
It is and isn't. There is:

       Failing  to  match the input argument to an existing package name based
       on the patterns above, DNF tries to see  if  the  argument  matches  an
       existing provide.

And the syntax with parentheses falls into "provide" category. But because dnf does not consider syntax of "provide", it's not documented in the dnf manual. From RPM perspective the "provide" does not have any syntax, it's just a string.

There are many "provide" symbols in Fedora packages. Just try "dnf repoquery --provides PACKAGE" for a PACKAGE. It's not only about perl.

The perl syntax is documented in "perl" package description (rpm -qi perl) and in the Perl packaging guide lines (https://fedoraproject.org/wiki/Packaging:Perl#Perl_Requires_and_Provides).

Comment 6 Emmanuel Seyman 2016-09-01 09:10:58 UTC
(In reply to David Tonhofer from comment #3)
> 
> But... what is that package syntax with parentheses?

RPM generates autoprovides for all perl modules in a package and these look like perl(Foo) (where Foo is the packaged module). So you can ask dnf/yum to install perl(Foo) and it will install the package that contains that module.

Because you don't want the shell to interpret the parentheses, you either need to quote the provide or espace the parentheses.

dnf install "perl(Locale::Language)"
dnf install perl\(Locale::Language\)

Comment 7 Ralf Corsepius 2016-09-01 10:42:23 UTC
(In reply to Petr Pisar from comment #5)
> It is and isn't. There is:

Wrong. Without the quotes, the shell interprets the '()', which cause dnf not to receive the correct arguments:

Proof:
# cat test.sh 
#!/bin/sh
for x in ${*}; do
echo "$x";
done


# ./test.sh 1 2 3
1
2
3

# ./test.sh 1 2 3 a(b)
bash: syntax error near unexpected token `('

# ./test.sh 1 2 3 'ab(b)'
1
2
3
ab(b)

# dnf install perl(foo)
bash: syntax error near unexpected token `('

Comment 8 David Tonhofer 2016-09-03 10:46:12 UTC
A hearty thanks to everybody. Yes, the part with the quotes is clear, but I missed the idea of specifying a "provide" to "dnf" (It's the first time I see someone do this, truly, and I have installed Red Hat since 1998 I think ... so long ago, time to prepare riding into the sunset)


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