Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ Revision history for {{$dist->name}}

{{$NEXT}}
- Added CPU arch detection support for illumos (Marcel Telka++ gh#427)
- Add Alien::Build::Meta->has_requires (gh#431)
- Fix false warning in Download::Negotiate by detecting Download::GitHub (gh#431)

2.84 2024-10-28 18:51:39 -0600
- Added is_system_install and is_share_install methods to
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,15 @@ Add the requirement to the given phase. Phase should be one of:
- share
- system
## has\_requires
```
if (Alien::Build->meta->has_requires($phase, $module_pat, ...)) {...}
```
Tests to see if the given phase has any of the given substrings as
a requirement. Phase as ["add\_requires"](#add_requires).
## interpolator
```perl
Expand Down
22 changes: 22 additions & 0 deletions lib/Alien/Build.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2132,6 +2132,28 @@ sub add_requires
$self;
}

=head2 has_requires

if (Alien::Build->meta->has_requires($phase, $module_pat, ...)) {...}

Tests to see if the given phase has any of the given substrings as
a requirement. Phase as L</add_requires>.

=cut

sub has_requires
{
my $self = shift;
my $phase = shift;
my @has = keys %{ $self->{require}->{$phase} };
while(@_)
{
my $pattern = shift;
for (@has) { return 1 if index($_, $pattern) != -1; }
}
return ();
}

=head2 interpolator

my $interpolator = $build->meta->interpolator;
Expand Down
2 changes: 1 addition & 1 deletion lib/Alien/Build/Plugin/Download/Negotiate.pm
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ sub init
}
}

if($self->url =~ /^http.*github.com.*releases$/)
if($self->url =~ /^http.*github.com.*releases$/ && !$meta->has_requires('configure', 'Download::GitHub'))
{
Alien::Build->log('!! WARNING !! WARNING !!');
Alien::Build->log('!! WARNING !! It looks like this alien is using the regular download negotiator');
Expand Down
Loading