/usr/share/perl5/Genome/Model/Tools/Install/AptGet.pm is in libgenome-perl 0.06-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | package Genome::Model::Tools::Install::AptGet;
use strict;
use warnings;
use Genome;
use IPC::Cmd qw/can_run/;
class Genome::Model::Tools::Install::AptGet {
is => 'Command',
has => [
name => { is => 'Text', is_optional => 1, shell_args_position => 1, doc => 'tool name', },
],
doc => 'install modules via APT'
};
sub execute {
my $self = shift;
my $module = $self->name;
unless ($module) {
$self->error_message("Please specify the name of a tool to install.");
return;
}
my $path = can_run('apt-get');
chomp $path;
unless ($path) {
unless (can_run('apt-get')) {
$self->error_message("Your system does not have apt-get installed!");
return;
}
}
$self->status_message("searching for $module...");
my $cmd = "$path -q update && $path search \'^$module\$\'";
my $info = `$cmd`;
unless ($info) {
$self->status_message("Failed to find module $module!");
return;
}
my $rv = system "$path install $module";
$rv /= 256;
if ($rv) {
$self->error_message("Errors installing $module!");
return;
}
return 1;
}
sub sub_command_sort_position { 9999 }
1;
|