| 1 | package Tapper::Action::Plugin::updategrub::OSRC; | ||||||||||||||||||||||||||||
| 2 | 1 | our $AUTHORITY = 'cpan:TAPPER'; | |||||||||||||||||||||||||||
| 3 | 1 | $Tapper::Action::Plugin::updategrub::OSRC::VERSION = '5.0.0'; | |||||||||||||||||||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use File::Copy; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 1 | ▶ | use Tapper::Config; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | sub execute | ||||||||||||||||||||||||||||
| 12 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
execute: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||||||||||||||||||||
| 13 | 0 | my ($action, $message, $options) = @_; | |||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 0 | ▶ | my $hostname = $message->{host} || $message->{hostname} or die "No hostname to update grub for in __PACKAGE__.\n"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$message->{'host'} || $message->{'hostname'}
MC/DC0%0/2
$message->{'host'} || $message->{'hostname'}
$message->{'host'}
$message->{'hostname'}
Truth table0%0/3
A || B
A= $message->{'host'}B= $message->{'hostname'}
| |||||||||||||||||||||||||||||
| 16 | 0 | ▶ | my $default_grubfile = Tapper::Config->subconfig->{files}{default_grubfile} // ''; | ||||||||||||||||||||||||||
|
Condition0%0/2
"Tapper::Config"->subconfig->{"files"}{"default_grubfile"} // ""
MC/DC0%0/1
"Tapper::Config"->subconfig->{"files"}{"default_grubfile"} // ""
"Tapper::Config"->subconfig->{"files"}{"default_grubfile"}
Truth table0%0/2
A
A= "Tapper::Config"->subconfig->{"files"}{"default_grubfile"}
| |||||||||||||||||||||||||||||
| 17 | 0 | ▶ | if (not -e $default_grubfile) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 18 | 0 | die "Default grubfile '$default_grubfile' does not exist\n"; | |||||||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||||||
| 20 | 0 | my $filename = Tapper::Config->subconfig->{paths}{grubpath}."/$hostname.lst"; | |||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | # use File::Copy to be as system independend as possible | ||||||||||||||||||||||||||||
| 23 | 0 | ▶ | File::Copy::copy($default_grubfile, $filename) or die "Can't update grub file for $hostname: $!\n"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 24 | 0 | return; | |||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 1 | 1; # End of Tapper::Action::Plugin::resume::OSRC | |||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | __END__ | ||||||||||||||||||||||||||||