Skip to content

Commit 347e328

Browse files
authored
Merge branch 'RexOps:master' into load_rexfile_test_and_fix
2 parents 5b80cc5 + 36b9d62 commit 347e328

File tree

6 files changed

+14
-5
lines changed

6 files changed

+14
-5
lines changed

ChangeLog

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Revision history for Rex
88

99
[DOCUMENTATION]
1010
- Clarify optional arguments of file commands
11+
- Clarify optional arguments of the pkg command
12+
- Correct example for file_read command
1113

1214
[ENHANCEMENTS]
1315
- Use $SIG{__WARN__} when loading Rexfile instead stderr redirection

lib/Rex/Commands/File.pm

+1-1
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ On failure it will die.
840840
841841
my $fh;
842842
eval {
843-
$fh = read("/etc/groups");
843+
$fh = file_read("/etc/groups");
844844
};
845845
846846
# catch an error

lib/Rex/Commands/Pkg.pm

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ use vars qw(@EXPORT);
6060
@EXPORT =
6161
qw(install update remove update_system installed_packages is_installed update_package_db repository package_provider_for pkg);
6262

63-
=head2 pkg($package, %options)
63+
=head2 pkg($package [, %options])
6464
6565
Since: 0.45
6666

lib/Rex/Pkg/Base.pm

+3-1
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,9 @@ OLD_PKG:
273273
push @modifications, map { $_->{action} = 'installed'; $_ }
274274
grep { !exists $_->{found} } @new_installed;
275275

276-
map { delete $_->{found} } @modifications;
276+
for (@modifications) {
277+
delete $_->{found};
278+
}
277279

278280
return @modifications;
279281
}

lib/Rex/Pkg/Debian.pm

+3-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ OLD_PKG:
118118
push @modifications, map { $_->{action} = 'installed'; $_ }
119119
grep { !exists $_->{found} } @new_installed;
120120

121-
map { delete $_->{found} } @modifications;
121+
for (@modifications) {
122+
delete $_->{found};
123+
}
122124

123125
return @modifications;
124126
}

t/package.t

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use strict;
22
use warnings;
33

4-
use Test::More tests => 4;
4+
use Test::More tests => 5;
55

66
use Rex::Pkg::Base;
77

@@ -33,4 +33,7 @@ is( $found_libssh2->{action}, "installed", "libssh2-1 was installed" );
3333
my ($found_mc) = grep { $_->{name} eq "mc" } @mods;
3434
is( $found_mc->{action}, "removed", "mc was removed" );
3535

36+
my $leftover_found = scalar grep { defined $_->{found} } @mods;
37+
is( $leftover_found, 0, 'no internal found marker left' );
38+
3639
1;

0 commit comments

Comments
 (0)