Skip to content

Instantly share code, notes, and snippets.

@avar
Created March 7, 2010 19:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avar/324560 to your computer and use it in GitHub Desktop.
Save avar/324560 to your computer and use it in GitHub Desktop.
sub register_prereqs {
my $self = shift;
my $arg = ref($_[0]) ? shift(@_) : {};
my %prereq = @_;
confess "too late to register a prereq" if $self->is_finalized;
my $phase = $arg->{phase} || 'runtime';
my $type = $arg->{type} || 'requires';
$phase = 'build' if $phase eq 'test';
my $prereq = ($self->_guts->{$phase}{$type} ||= Version::Requirements->new);
while (my ($package, $version) = each %prereq) {
$prereq->add_minimum($package, $version);
}
return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment