Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.94k stars 553 forks source link

Check Perl integrity with -e #22400

Open hongjinghao opened 3 months ago

hongjinghao commented 3 months ago

Validating Perl integrity should only be related to file existence. It should not fail due to other errors in ls.Therefore, use -e as a replacement for ls. fix:https://github.com/Perl/perl5/issues/22398

jkeenan commented 3 months ago

@Tux, @doughera88, can you take a look at this ticket (and the one cited herein)? Thanks.

doughera88 commented 3 months ago

On Sat, Jul 13, 2024 at 04:56:31AM -0700, James E Keenan wrote:

@Tux, @doughera88, can you take a look at this ticket (and the one cited herein)? Thanks.

-- Reply to this email directly or view it on GitHub: https://github.com/Perl/perl5/pull/22400#issuecomment-2226875219 You are receiving this because you were mentioned.

Message ID: @.***>

I no longer have login access to the github repository to comment there.

That specific error is likely a local configuration issue. There is no call to 'grep' in that command, but without knowing exact details of the user's environment and the relevant directories involved, it's not obvious what is going on.

In any case, the proposal to replace the current 136 calls to 'ls' with 6770 calls to 'test -e' probably won't make a meaningful difference on a modern system.
In much older systems, 'test' was not built-in and would have added a noticeable extra delay.

The proposed change from cd "$rsrc" to cd "$tmppwd/$rsrc"

looks wrong to me for the cases where the user is building outside the source tree (with -Dmksymlinks). More simply, if you are not going to be using 'ls' then I think the directory change is unnecessary and simply looking for

if [ ! -e "$rsrc/$file" ]; then

would be sufficient.

-- Andy Dougherty @.***

tonycoz commented 2 months ago

looks wrong to me for the cases where the user is building outside the source tree (with -Dmksymlinks). More simply, if you are not going to be using 'ls' then I think the directory change is unnecessary and simply looking for

if [ ! -e "$rsrc/$file" ]; then 

would be sufficient.

It looks like he's done that change, and a build with -Dmksymlinks only failed the AUTHORS check.

I am curious about which errors from ls this fixes.