line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# (c) 2019 Leah Neukirchen |
3
|
|
|
|
|
|
|
# based on Rex::Pkg::Arch |
4
|
|
|
|
|
|
|
# (c) Harm Müller |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
package Rex::Pkg::VoidLinux; |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
14
|
use v5.12.5; |
|
1
|
|
|
|
|
4
|
|
10
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
52
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '1.14.3'; # VERSION |
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
1
|
|
6
|
use Rex::Helper::Run; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
63
|
|
15
|
1
|
|
|
1
|
|
9
|
use Rex::Commands::File; |
|
1
|
|
|
|
|
15
|
|
|
1
|
|
|
|
|
8
|
|
16
|
1
|
|
|
1
|
|
7
|
use Rex::Commands::Fs; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
6
|
|
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
1
|
|
12
|
use Rex::Pkg::Base; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
19
|
1
|
|
|
1
|
|
28
|
use base qw(Rex::Pkg::Base); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
464
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub new { |
22
|
0
|
|
|
0
|
0
|
|
my $that = shift; |
23
|
0
|
|
0
|
|
|
|
my $proto = ref($that) || $that; |
24
|
0
|
|
|
|
|
|
my $self = $proto->SUPER::new(@_); |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
bless( $self, $proto ); |
27
|
|
|
|
|
|
|
|
28
|
0
|
0
|
|
|
|
|
if ( Rex::has_feature_version('1.5') ) { |
29
|
|
|
|
|
|
|
$self->{commands} = { |
30
|
0
|
|
|
|
|
|
install => 'xbps-install -y %s', |
31
|
|
|
|
|
|
|
install_version => 'xbps-install -y %s', # makes no sense to specify the package version |
32
|
|
|
|
|
|
|
update_system => 'xbps-install -yu', |
33
|
|
|
|
|
|
|
dist_update_system => 'xbps-install -yu', |
34
|
|
|
|
|
|
|
remove => 'xbps-remove -Ry %s', |
35
|
|
|
|
|
|
|
update_package_db => 'xbps-install -S', |
36
|
|
|
|
|
|
|
}; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
else { |
39
|
|
|
|
|
|
|
$self->{commands} = { |
40
|
0
|
|
|
|
|
|
install => 'xbps-install -y %s', |
41
|
|
|
|
|
|
|
install_version => 'xbps-install -y %s', # makes no sense to specify the package version |
42
|
|
|
|
|
|
|
update_system => 'xbps-install -Syu', |
43
|
|
|
|
|
|
|
dist_update_system => 'xbps-install -Syu', |
44
|
|
|
|
|
|
|
remove => 'xbps-remove -Ry %s', |
45
|
|
|
|
|
|
|
update_package_db => 'xbps-install -S', |
46
|
|
|
|
|
|
|
}; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
0
|
|
|
|
|
|
return $self; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub bulk_install { |
53
|
0
|
|
|
0
|
0
|
|
my ( $self, $packages_aref, $option ) = @_; |
54
|
|
|
|
|
|
|
|
55
|
0
|
|
|
|
|
|
delete $option->{version}; # makes no sense to specify the same version for several packages |
56
|
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
$self->update( "@{$packages_aref}", $option ); |
|
0
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
59
|
0
|
|
|
|
|
|
return 1; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub get_installed { |
63
|
0
|
|
|
0
|
0
|
|
my ( $self, $pkg ) = @_; |
64
|
0
|
|
|
|
|
|
my ( @pkgs, $name, $version, $release, $arch ); |
65
|
0
|
|
|
|
|
|
my $pkg_query = 'xbps-query --search='; |
66
|
0
|
0
|
|
|
|
|
if ( defined($pkg) ) { |
67
|
0
|
|
|
|
|
|
$pkg_query .= $pkg; |
68
|
|
|
|
|
|
|
} |
69
|
0
|
|
|
|
|
|
my @installed_packages = i_run $pkg_query; |
70
|
0
|
|
|
|
|
|
for my $line (@installed_packages) { |
71
|
0
|
0
|
|
|
|
|
if ( $line =~ /^\[\*\] ([^ ]*)-([^- ]*)_(\d+)/ ) { |
72
|
0
|
|
|
|
|
|
$name = $1; |
73
|
0
|
|
|
|
|
|
$version = $2; |
74
|
0
|
|
|
|
|
|
$release = $3; |
75
|
0
|
|
|
|
|
|
push( |
76
|
|
|
|
|
|
|
@pkgs, |
77
|
|
|
|
|
|
|
{ |
78
|
|
|
|
|
|
|
name => $name, |
79
|
|
|
|
|
|
|
version => $version, |
80
|
|
|
|
|
|
|
release => $release, |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
); |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
0
|
|
|
|
|
|
return @pkgs; |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
1; |