Prepping to add job restarting to the system
This commit is contained in:
parent
9f8f6586df
commit
d532aba267
3 changed files with 7 additions and 52 deletions
|
@ -16,6 +16,5 @@ while (my $l = <$fh>) {
|
||||||
$mod_to_dist{$module} = $dist;
|
$mod_to_dist{$module} = $dist;
|
||||||
}
|
}
|
||||||
|
|
||||||
print Dumper(\%dist_to_mod);
|
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
|
@ -27,9 +27,10 @@ if (-e 'modcache.stor') {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
END {
|
sub __save_cache {
|
||||||
store \%cache, 'modcache.stor';
|
store \%cache, 'modcache.stor';
|
||||||
};
|
};
|
||||||
|
END {__save_cache};
|
||||||
|
|
||||||
sub new_module {
|
sub new_module {
|
||||||
my $class = shift;
|
my $class = shift;
|
||||||
|
@ -52,21 +53,6 @@ sub _is_core {
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub get_dist {
|
|
||||||
my $self=shift;
|
|
||||||
my $module = $self->name;
|
|
||||||
|
|
||||||
# skip perl, or core modules
|
|
||||||
return 'perl' if _is_core($module);
|
|
||||||
|
|
||||||
my @cmd = (qw|cpanm --quiet --mirror http://cpan.simcop2387.info/ --info|, $module);
|
|
||||||
my $out;
|
|
||||||
run \@cmd, '>&', \$out;
|
|
||||||
|
|
||||||
chomp $out;
|
|
||||||
return $out;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub get_deps {
|
sub get_deps {
|
||||||
my $self=shift;
|
my $self=shift;
|
||||||
my $module = $self->name;
|
my $module = $self->name;
|
||||||
|
@ -79,7 +65,9 @@ sub get_deps {
|
||||||
my $out;
|
my $out;
|
||||||
run \@cmd, '>&', \$out;
|
run \@cmd, '>&', \$out;
|
||||||
|
|
||||||
return [map {Module->new_module($_)} grep {!_is_core($_)} split($/, $out)];
|
my $deps = [map {Module->new_module($_)} grep {!_is_core($_)} split($/, $out)];
|
||||||
|
__save_cache;
|
||||||
|
return $deps;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub print_deps {
|
sub print_deps {
|
||||||
|
@ -92,36 +80,4 @@ sub print_deps {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
package cpanfile;
|
|
||||||
# HACK since cpan files are valid perl, i'm just using do/require
|
|
||||||
|
|
||||||
our @mods;
|
|
||||||
|
|
||||||
sub __parse_file {
|
|
||||||
my $file = shift;
|
|
||||||
|
|
||||||
require $file;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub requires {
|
|
||||||
push @mods, $_[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
sub recommends {
|
|
||||||
push @mods, $_[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
sub conflicts {} # IGNORE These
|
|
||||||
|
|
||||||
# we expect all types
|
|
||||||
sub on {
|
|
||||||
my ($env, $code) = @_;
|
|
||||||
$code->();
|
|
||||||
}
|
|
||||||
|
|
||||||
sub feature {
|
|
||||||
my ($feat, $desc, $code) = @_;
|
|
||||||
$code->();
|
|
||||||
}
|
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
|
@ -48,12 +48,12 @@ sub test_module {
|
||||||
|
|
||||||
if (!$ret2) {
|
if (!$ret2) {
|
||||||
print ">>>>Module $module failed to build without UNSAFE INC\n";
|
print ">>>>Module $module failed to build without UNSAFE INC\n";
|
||||||
open(my $fh, ">", "logs/${$}_${module}_incfailure.log");
|
open(my $fh, ">", "logs/${module}_incfailure.log");
|
||||||
print $fh $noincout;
|
print $fh $noincout;
|
||||||
} else {
|
} else {
|
||||||
print "<<<<Module $module fails to build entirely\n";
|
print "<<<<Module $module fails to build entirely\n";
|
||||||
|
|
||||||
open(my $fh, ">", "logs/${$}_${module}_genfailure.log");
|
open(my $fh, ">", "logs/${module}_genfailure.log");
|
||||||
print $fh $incout;
|
print $fh $incout;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue