-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
Bug Description
The warning added in #388/#390 triggers a false positive when using the Download::GitHub plugin correctly.
Steps to Reproduce
- Create an alienfile using
Download::GitHub:
use alienfile;
plugin 'PkgConfig' => 'libnghttp2';
share {
requires 'Alien::Build::Plugin::Download::GitHub' => '0.10';
plugin 'Download::GitHub' => (
github_user => 'nghttp2',
github_repo => 'nghttp2',
);
# ...
};-
Run
perl Makefile.PL -
Warning appears:
Alien::Build::Plugin::Download::Negotiate> !! WARNING !! WARNING !!
Alien::Build::Plugin::Download::Negotiate> !! WARNING !! It looks like this alien is using the regular download negotiator
Alien::Build::Plugin::Download::Negotiate> plugin on a GitHub release page...
Root Cause
The warning regex in Download::Negotiate line 216:
if($self->url =~ /^http.*github.com.*releases$/)Matches both:
- ❌
https://github.com/user/repo/releases(web page - correct to warn) - ✅
https://api.github.com/repos/user/repo/releases(API - false positive)
When Download::GitHub sets start_url to the API endpoint, then applies the Download plugin, the warning incorrectly fires.
Impact
This affects all Alien distributions using Download::GitHub. Tested with:
- Alien::xz (same warning)
- Alien::Ninja (same warning)
The warning is cosmetic - everything works correctly. But it's confusing for users who are already using the recommended plugin.
Suggested Fix
Change the regex to exclude API URLs:
if($self->url =~ /^https?:\/\/github\.com\/[^\/]+\/[^\/]+\/releases$/)Or use a negative lookbehind:
if($self->url =~ /^http.*(?<!api\.)github\.com.*releases$/)Environment
- Alien::Build 2.84
- Alien::Build::Plugin::Download::GitHub 0.10
- perl 5.40.0
Metadata
Metadata
Assignees
Labels
No labels