FS#75457 - [cowsay] many cows depend on Acme::Cow

Attached to Project: Arch Linux
Opened by Emanuele Torre (emanuele6) - Saturday, 30 July 2022, 10:56 GMT
Last edited by Toolybird (Toolybird) - Saturday, 30 July 2022, 21:48 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
Some of the cows installed with this package depend on the Acme::Cow
package which is not installed as a dependency for this package (also
I don't think it is available on the arch linux repositories).

This causes problems for the community/cowfortune package. That
installs a `cowfortune' program that runs randomly either cowsay(1) or
cowthink(1), with a random cow from `/usr/share/cows', with a random
fortune message.

If the randomly picked cow depends on Acme::Cow, instead of seeing a
"cow" saying/thinking a fortune message, you will see this error
message from cowthink/cowsay:

bash-5.1$ cowfortune
cowthink: Can't locate Acme/Cow.pm in @INC (you may need to install the Acme::Cow module) (@INC contains: /home/emanuele6/perl5/lib/perl5 /home/emanuele6/perl5/lib/perl5 /usr/lib/perl5/5.36/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/5.36/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/5.36/core_perl /usr/share/perl5/core_perl) at /usr/share/cows/DragonAndCow.pm line 3, <STDIN> line 2.
BEGIN failed--compilation aborted at /usr/share/cows/DragonAndCow.pm line 3, <STDIN> line 2.


Additional info:
* community/cowsay package version: 3.04-2
* community/cowfortune package version: 0.1.2-7
* number of cow files that don't depend on Acme::Cow:
bash-5.1$ grep -vlZr Acme::Cow | gawk -vRS='\0' 'END{print NR}'
54
* cows that depend on Acme::Cow:
bash-5.1$ grep -lr Acme::Cow | nl
1 Example.pm
2 Frogs.pm
3 TextBalloon.pm
4 Stegosaurus.pm
5 MechAndCow.pm
6 DragonAndCow.pm
7 TuxStab.pm
* percentage of cows that depend on Acme::Cow: ~11.5%

Steps to reproduce:
1. First method:
* Run `echo hello | cowsay -f Frogs.pm`

2. Second method:
* Install `cowfortune`
* Run it a couple of times, you are likely to hit the error

Fix:
The best and preferred fix is:
* package Acme::Cow (if it is not already packaged)
* make the package that provides Acme::Cow a dependency of this
package

An alternative temporary/worse solution could be to add something
like this to the package file for community/cowsay:

grep -lZr 'Acme::Cow' /usr/share/cows/ | xargs -0r rm --

To delete all the cow files that contain Acme::Cow.

Cheers
emanuele6
This task depends upon

Closed by  Toolybird (Toolybird)
Saturday, 30 July 2022, 21:48 GMT
Reason for closing:  Duplicate
Additional comments about closing:   FS#68682 
Comment by Emanuele Torre (emanuele6) - Saturday, 30 July 2022, 11:06 GMT
Oops, I thought I forgot to tag the task as [cowsay] and I didn't see
there was another task for this issue because I was looking at the
cowfortune reports.

Loading...