From 1fb6f706566008f58bf8c14d687e8a60e2916fbe Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Fri, 3 Apr 2020 20:49:20 +0300 Subject: [PATCH] Extract a common class/struct. This is Refactoring / code cleanup. See: * https://en.wikipedia.org/wiki/God_object * https://en.wikipedia.org/wiki/Extract_class * https://en.wikipedia.org/wiki/Code_refactoring * https://www.refactoring.com/ * https://www.joelonsoftware.com/2002/01/23/rub-a-dub-dub/ Some small optimisations may have slipped in as well. --- scripts/debian-packaging/docker-test.pl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/debian-packaging/docker-test.pl b/scripts/debian-packaging/docker-test.pl index d0fc516..55e195a 100644 --- a/scripts/debian-packaging/docker-test.pl +++ b/scripts/debian-packaging/docker-test.pl @@ -12,14 +12,13 @@ use 5.014; use autodie; use Path::Tiny qw/ path tempdir tempfile cwd /; -use Docker::CLI::Wrapper::Base (); +use Docker::CLI::Wrapper::Container (); -my $obj = Docker::CLI::Wrapper::Base->new(); +my $obj = Docker::CLI::Wrapper::Container->new( { sys => "debian:sid", } ); my @deps; #= map { /^BuildRequires:\s*(\S+)/ ? ("'$1'") : () } # path("freecell-solver.spec.in")->lines_utf8; -my $SYS = "debian:sid"; my $CONTAINER = "fortune-mod--deb--test-build"; my $USER = "mygbp"; my $HOMEDIR = "/home/$USER"; @@ -31,8 +30,9 @@ sub _clean_up_containers eval { $obj->docker( { cmd => [ 'rm', $CONTAINER, ] } ); }; } _clean_up_containers(); -$obj->docker( { cmd => [ 'pull', $SYS ] } ); -$obj->docker( { cmd => [ 'run', "-t", "-d", "--name", $CONTAINER, $SYS, ] } ); +$obj->docker( { cmd => [ 'pull', $obj->sys() ] } ); +$obj->docker( + { cmd => [ 'run', "-t", "-d", "--name", $CONTAINER, $obj->sys(), ] } ); my $REPO = 'fortune-mod'; my $URL = "https://salsa.debian.org/shlomif-guest/$REPO"; -- 2.40.0