Count of Perl modules in devel:languages:perl

Is there a known way to count number of perl packages in devel:languages:perl repo? Apologize if this is a stupid question, but I consider myself a newbie to opensuse.

abhishekisnot wrote:
> Is there a known way to count number of perl packages in
> devel:languages:perl repo? Apologize if this is a stupid question, but I
> consider myself a newbie to opensuse.

Sorry, I don’t know the answer to your question but can I ask why you
want the answer? Just because to me it doesn’t seem a terribly useful
number, and if you’re a newbie it’s possible you may think it will tell
you something that it won’t.

On Mon, 14 May 2012 16:16:02 +0000, abhishekisnot wrote:

> Is there a known way to count number of perl packages in
> devel:languages:perl repo?

If you’ve added the repo, the easiest way would be to drop to a command-
line and use:

zypper se perl | grep -i module

That’ll list all the modules available in the repos you’re currently
using (assuming the short description always says “module”, which seems a
reasonable assumption, but isn’t one I’ve checked)

You can limit this with the -r command-line switch. See zypper --help or
man zypper for details on how to use this.

once you have a list, you can pipe that through “wc -l” to count the
number of lines, and that’ll give you a count.

Jim

Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

On Mon, 14 May 2012 16:30:19 +0000, Jim Henderson wrote:

> On Mon, 14 May 2012 16:16:02 +0000, abhishekisnot wrote:
>
>> Is there a known way to count number of perl packages in
>> devel:languages:perl repo?
>
> If you’ve added the repo, the easiest way would be to drop to a command-
> line and use:
>
> zypper se perl | grep -i module
>
> That’ll list all the modules available in the repos you’re currently
> using (assuming the short description always says “module”, which seems
> a reasonable assumption, but isn’t one I’ve checked)
>
> You can limit this with the -r command-line switch. See zypper --help
> or man zypper for details on how to use this.
>
> once you have a list, you can pipe that through “wc -l” to count the
> number of lines, and that’ll give you a count.

Something else I noticed is that each package is listed twice - once for
the package, and once for the source package. You can filter this by
grepping for srcpackage as well.

I do have to agree with Dave, though, that this number doesn’t seem
terribly useful, especially since you can always use CPAN to install
modules that aren’t listed in the repo (something I do regularly - since
the RPMs sometimes lag behind the latest releases from CPAN).

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

Hi
Or just go to the project page, it tells you how many packages…
https://build.opensuse.org/project/list?searchtext=perl&excludefilter=home%3A

You can use cpan2spec to build an installable rpm as well for any
modules…


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 12.1 (x86_64) Kernel 3.1.10-1.9-desktop
up 2 days 20:59, 4 users, load average: 0.00, 0.25, 0.28
CPU Intel i5 CPU M520@2.40GHz | Intel Arrandale GPU

On Mon, 14 May 2012 16:38:48 +0000, malcolmlewis wrote:

> You can use cpan2spec to build an installable rpm as well for any
> modules…

That’s cool, I didn’t know that. :slight_smile:

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

We are considering migrating from deb to opensuse for our app which is heavily perl based. Hence Perl offerings from the distro (we think) is a factor we might need to consider. At this point we are not sure if this numbers matters considering cpan/cpanplus/cpanminus ways to install perl modules, but this will surely help us being prepared in advance if the numbers vary too much.

I did

zypper se perl  | grep -v srcpackage | grep package | wc -l

on one of the suse machine we have and figured that there are 1933 modules available in repo. But this may not be reliable number considering that this command lists apps as well (superlu for example). But I think I can surely say that there are maximum of 1933 modules available on our opensuse install.

Note that, the current deb distro reports approximately 2770 modules based on similar grep, grep -v approach (again which may not be realiable).

Hmmm it’s cpanspec
http://software.opensuse.org/package/cpanspec


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 12.1 (x86_64) Kernel 3.1.10-1.9-desktop
up 2 days 21:49, 4 users, load average: 0.03, 0.03, 0.05
CPU Intel i5 CPU M520@2.40GHz | Intel Arrandale GPU

On Mon, 14 May 2012 17:36:02 +0000, abhishekisnot wrote:

> At this point we are not sure if this numbers matters considering
> cpan/cpanplus/cpanminus ways to install perl modules, but this will
> surely help us being prepared in advance if the numbers vary too much.

Yeah, it really shouldn’t matter much, because CPAN is available, so
anything that isn’t available as an RPM can be installed from CPAN (or as
Malcolm suggested, an RPM package can be easily built if you want to do
that).

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

abhishekisnot wrote:
> We are considering migrating from deb to opensuse for our app which is
> heavily perl based. Hence Perl offerings from the distro (we think) is a
> factor we might need to consider. At this point we are not sure if this
> numbers matters considering cpan/cpanplus/cpanminus ways to install perl
> modules, but this will surely help us being prepared in advance if the
> numbers vary too much.

It’s going to depend on your change management policies. You have a
fundamental decision to make about how you control what versions of Perl
modules your application uses.

The Perl modules packaged by a distro start with the core modules plus
those used by any distro-supplied applications that use perl (e.g. YaST,
IIRC). So the versions of the distro-supplied modules are linked to
whatever those applications need. Then the distro will also prepackage
whatever other modules it thinks useful.

If your application is of any size, however, it will probably use many
modules with two results:
(1) there will be some that are not packaged by the distro
(2) you may well find version conflicts, because you depend on some new
feature or particular bug fix in a module that requires you to upgrade a
distro-packaged module.

Probelm #1 can be fixed by packaging CPAN modules as RPMs (or debs) and
installing them using the distro’s software management processes.

But problem #2 can’t be fixed in that way. You can’t upgrade the
distro-supplied modules in place, because you may break other
applications. So you need to move to alternative paths for your modules,
perhaps by direct installation from CPAN, or by use of facilities such
as local::lib.

Many professional shops just take control of the whole Perl ecosystem,
compiling and installing everything separately from the distro-supplied
code. There’s a lot of literature about how to do that. Personally, I
just muddle along with direct CPAN installations and the occasional
fudge, but I’m not serving millions of pages or responsible for other
peoples’ dollars or anything, so I can tolerate the odd embarrassing
mistake.

HTH, Dave