[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [OSSTEST PATCH 39/49] ts-xen-install: Move some_extradebs to Debian.pm
Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx> --- Osstest/Debian.pm | 38 ++++++++++++++++++++++++++++++++++++++ ts-xen-install | 36 ------------------------------------ 2 files changed, 38 insertions(+), 36 deletions(-) diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm index 49d94b9b..d51ac493 100644 --- a/Osstest/Debian.pm +++ b/Osstest/Debian.pm @@ -24,6 +24,7 @@ use POSIX; use IO::File; use File::Copy; +use File::Basename; use Osstest; use Osstest::TestSupport; @@ -50,6 +51,7 @@ BEGIN { di_vg_name debian_dhcp_rofs_fix debian_write_random_seed_command + some_extradebs ); %EXPORT_TAGS = ( ); @@ -1646,4 +1648,40 @@ sub debian_write_random_seed_command ($) { END } +sub some_extradebs ($$) { + my ($ho, $items) = @_; + my $cfgvar = join('_', @$items); + my $specs = $c{$cfgvar}; + if (!length $specs) { + logm("$cfgvar: no extra debs"); + return; + } + my $counter = 0; + my $rsync_installed; + foreach my $spec (split /\s+/, $specs) { + my $path = $spec; + $path = "$c{Images}/$path" unless $path =~ m{^/|^\./}; + my ($ontarget, $dpkgopts); + if ($path =~ m{/$}) { + $ontarget = "extrapackages-$cfgvar-$counter"; $counter++; + $dpkgopts = '-iGROEB'; + logm("$cfgvar: updating packages from directory $path"); + target_install_packages($ho, qw(rsync)) unless $rsync_installed++; + target_putfile_root($ho,300, "$path/.", $ontarget, '-r'); + } elsif ($path =~ m{\.deb$}) { + $path =~ s{_\.deb}{ "_$ho->{Arch}.deb" }e; + logm("$cfgvar: installing $path"); + $ontarget = basename($path); + $dpkgopts = '-iB'; + target_putfile_root($ho,300, $path, $ontarget); + } else { + die "no / or . deb in $spec ?"; + } + target_cmd_root($ho, + "dpkg --force-confold $dpkgopts $ontarget </dev/null", + 300); + target_run_pkgmanager_install($ho, [], 0,1); + } +} + 1; diff --git a/ts-xen-install b/ts-xen-install index 6196a890..d67cd121 100755 --- a/ts-xen-install +++ b/ts-xen-install @@ -71,42 +71,6 @@ sub packages () { if toolstack($ho)->{ExtraPackages}; } -sub some_extradebs ($$) { - my ($ho, $items) = @_; - my $cfgvar = join('_', @$items); - my $specs = $c{$cfgvar}; - if (!length $specs) { - logm("$cfgvar: no extra debs"); - return; - } - my $counter = 0; - my $rsync_installed; - foreach my $spec (split /\s+/, $specs) { - my $path = $spec; - $path = "$c{Images}/$path" unless $path =~ m{^/|^\./}; - my ($ontarget, $dpkgopts); - if ($path =~ m{/$}) { - $ontarget = "extrapackages-$cfgvar-$counter"; $counter++; - $dpkgopts = '-iGROEB'; - logm("$cfgvar: updating packages from directory $path"); - target_install_packages($ho, qw(rsync)) unless $rsync_installed++; - target_putfile_root($ho,300, "$path/.", $ontarget, '-r'); - } elsif ($path =~ m{\.deb$}) { - $path =~ s{_\.deb}{ "_$ho->{Arch}.deb" }e; - logm("$cfgvar: installing $path"); - $ontarget = basename($path); - $dpkgopts = '-iB'; - target_putfile_root($ho,300, $path, $ontarget); - } else { - die "no / or . deb in $spec ?"; - } - target_cmd_root($ho, - "dpkg --force-confold $dpkgopts $ontarget </dev/null", - 300); - target_run_pkgmanager_install($ho, [], 0,1); - } -} - sub extradebs () { my $suite = $ho->{Suite}; -- 2.20.1
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |