Open Bug 1345926 Opened 8 years ago Updated 6 years ago

Provide a more informative error message when cpanm is not installed

Categories

(Bugzilla :: Bugzilla-General, defect)

defect
Not set
normal

Tracking

()

UNCONFIRMED

People

(Reporter: h2014313059, Unassigned, Mentored)

Details

Attachments

(2 files)

Trying to set up Bugzilla, here I typed: perl checksetup.pl --cpanm and I see a weird error message! Later on asking Dylan (My Mentor), he found that cpanm is not install. so I googled and typed "sudo apt-get install cpanminus". Yay installed. If it is feasible to provide information on the error messages then the next person won't struggle with the installation. With this patch, a person will know that cpanm is not installed and the command to install. Without cpanm, the installation fails.So I feel that, it is a useful patch.
Comment on attachment 8845503 [details] [diff] [review] Provides information on the cpanm error i.e., cpanm not installed Review of attachment 8845503 [details] [diff] [review]: ----------------------------------------------------------------- r- with some changes requested. I'll be available during the week if you have questions. ::: checksetup.pl @@ +90,3 @@ > } > print "cpanm @cpanm_args \".\"\n" if !$silent; > my $rv = system('cpanm', @cpanm_args, '.'); add if ($rv != 0) { here @@ +92,5 @@ > my $rv = system('cpanm', @cpanm_args, '.'); > + my $found_cpanm = 0; > + foreach my $path (split(/:/, $ENV{PATH})) { > + if (-x "$path/cpanm") { > + warn "cpanm installed\n"; remove this (debbung?) warning, it is confusing. Also note this section is indented too much. Use four spaces for every level of { } block. @@ +98,5 @@ > + last; > + } > + } > + if (!$found_cpanm) { > + warn "Please install cpanm: sudo apt-get install cpanminus\n"; suggestion: "you must install cpanminus (also known as cpanm) to use the --cpanm option\n" @@ +105,1 @@ > exit 1 if $rv != 0; replace this line with }
Attachment #8845503 - Flags: review?(dylan) → review-
Attached file Changes made
Attachment #8849162 - Flags: review?(dylan)
Hello, I'm an absolute beginner and would like to work on this.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: