Skip to content

Commit

Permalink
work on #208; change way we figure out the distribution name
Browse files Browse the repository at this point in the history
  • Loading branch information
stevieb9 committed May 5, 2017
1 parent 698f4d1 commit edb15a0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
4 changes: 4 additions & 0 deletions Changes
Expand Up @@ -8,6 +8,10 @@ Revision history for Test-BrewBuild
- added a section to Tutorial that covers using Plugins
- for RPi LCD mode, changed commit csum to 7 chars as opposed to 8,
which is typical/common across the board
- major changes on how we figure out which module is the distribution
name. Instead of taking the first module name found, we check each one
with MetaCPAN::Client, and use the first one found that is a legit
distribution (work on #208)

2.17 2017-04-27
- troubleshooting issue where this current commit is causing the LCD
Expand Down
34 changes: 21 additions & 13 deletions lib/Test/BrewBuild.pm
Expand Up @@ -409,34 +409,42 @@ sub log {
sub revdeps {
my $self = shift;

load 'MetaCPAN::Client';
my $mcpan = MetaCPAN::Client->new;

my $log = $log->child('revdeps');
$log->_6('running --revdep');

my @modules;
my $dist;

find({
wanted => sub {
return if ref $dist;

if (-f && $_ =~ /\.pm$/){
$log->_7("located module: $_");
push @modules, $_;

$log->_6("processing module '$_'");

s|lib/||;
s|/|-|g;
s|\.pm||;

$log->_6("module file converted to '$_'");

eval {
$dist = $mcpan->distribution($_);
};

}
},
no_chdir => 1,
},
'lib/'
);

my $mod = $modules[0];

$log->_7("using '$mod' as the project we're working on");

$mod =~ s|lib/||;
$mod =~ s|/|-|g;
$mod =~ s|\.pm||;

$log->_7("working module translated to $mod");
$log->_7("using '$dist' as the project we're working on");

my @revdeps = $self->_get_revdeps($mod);
my @revdeps = $self->_get_revdeps($dist);
return @revdeps;
}
sub legacy {
Expand Down

0 comments on commit edb15a0

Please sign in to comment.