TT#39401 Use List::Util in perl core instead of List::MoreUtils

We can replace the apply usage with map plus a returning s///.

This also fixes a hidden bug with the liblist-moreutils-perl dependency
missing from debian/control, being indirectly pulled by some other
dependency, while an implementation detail.

Change-Id: Ibfc7b362ad77c4b202d93cf71774c40623503f14
changes/09/22209/1
Guillem Jover 8 years ago
parent 61915c7d17
commit bcab88a09d

@ -5,7 +5,6 @@ use warnings;
use DateTime::TimeZone::OffsetOnly;
use File::Find::Rule;
use File::Slurp qw(read_file);
use List::MoreUtils qw(apply);
use POSIX;
use Time::Local;
@ -22,7 +21,7 @@ sub get_host_list {
->mindepth( 1 )
->maxdepth( 1 )
->in('/var/lib/collectd/rrd');
@hosts = sort {$a cmp $b} apply { s|.*/|| } @hosts;
@hosts = sort {$a cmp $b} map { s|.*/||r } @hosts;
return \@hosts;
}
@ -34,7 +33,7 @@ sub get_host_subdirs {
->mindepth( 1 )
->maxdepth( 1 )
->in('/var/lib/collectd/rrd/' . $host);
@dirs = sort {$a cmp $b} apply { s|.*/|| } @dirs;
@dirs = sort {$a cmp $b} map { s|.*/||r } @dirs;
return \@dirs;
}
@ -45,7 +44,7 @@ sub get_rrd_files {
->mindepth( 1 )
->maxdepth( 1 )
->in('/var/lib/collectd/rrd/' . $host . '/' . $folder);
@rrds = sort {$a cmp $b} apply { s|.*/|| } @rrds;
@rrds = sort {$a cmp $b} map { s|.*/||r } @rrds;
return \@rrds;
}

@ -39,7 +39,7 @@ RUN apt-get --assume-yes -f install
# this is a workaround until upstream released v1.21:
RUN wget https://deb.sipwise.com/files/libselenium-remote-driver-perl_1.20-0.1-git-16.orig.tar.xz
RUN tar xvf libselenium-remote-driver-perl_1.20-0.1-git-16.orig.tar.xz
RUN apt-get --assume-yes -f install libarchive-zip-perl libfile-which-perl libhttp-message-perl libio-string-perl libjson-perl liblist-moreutils-perl libmoo-perl libnamespace-clean-perl libsub-install-perl libtest-longstring-perl libtest-time-perl libtry-tiny-perl libwww-perl libxml-simple-perl
RUN apt-get --assume-yes -f install libarchive-zip-perl libfile-which-perl libhttp-message-perl libio-string-perl libjson-perl libmoo-perl libnamespace-clean-perl libsub-install-perl libtest-longstring-perl libtest-time-perl libtry-tiny-perl libwww-perl libxml-simple-perl
RUN wget https://deb.sipwise.com/files/geckodriver-v0.18.0-linux64.tar.gz
RUN tar xvf geckodriver-v0.18.0-linux64.tar.gz
RUN ln -s /home/selenium/geckodriver /usr/bin/geckodriver

Loading…
Cancel
Save