target_run_pkgmanager_install
target_install_packages target_install_packages_norec
target_install_packages_nonfree_nonconcurrent
+ target_install_packages_backport
target_jobdir target_extract_jobdistpath_subdir
target_extract_jobdistpath target_extract_distpart
target_tftp_prefix
tputfileex('root', @_);
}
-sub target_run_pkgmanager_install ($$;$$) {
- my ($ho, $packagelist, $norec, $force) = @_;
+sub target_run_pkgmanager_install ($$;$$$) {
+ my ($ho, $packagelist, $norec, $force, $backport) = @_;
my @cmd;
if ($ho->{OS} eq "freebsd") {
push @cmd, qw(lockf /var/run/osstest-pkg-lock pkg-static install);
with-lock-ex -w /var/lock/osstest-apt apt-get);
push @cmd, qw(-f) if $force;
push @cmd, qw(--no-install-recommends) if $norec;
+ push @cmd, "-t", "$ho->{Suite}-backports" if $backport;
push @cmd, qw(-y install);
}
push @cmd, @$packagelist;
apt-get update
END
}
+sub target_install_packages_backport ($@) {
+ my ($ho, @packages) = @_;
+ my $had_backport_repo = 0;
+ target_editfile_root($ho, '/etc/apt/sources.list', sub {
+ my $suite = $ho->{Suite};
+ my $bp_url = Osstest::Debian::debian_mirror_url($ho);
+ while (<::EI>) {
+ if (m/^# $suite backports/) {
+ $had_backport_repo = 1;
+ }
+ print ::EO;
+ }
+ print ::EO <<EOF unless $had_backport_repo;
+
+# $suite backports
+deb $bp_url $suite-backports main
+EOF
+ });
+ target_cmd_root($ho, "apt-get update", 300) unless $had_backport_repo;
+ target_run_pkgmanager_install($ho,\@packages,0,0,1);
+}
sub tpfcs_core {
my ($tputfilef,$ho,$timeout,$filedata, $rdest,$lleaf) = @_;