From a1e34113fcb9538ad8a29eec80075dff04253068 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Sat, 29 Jul 2017 13:49:51 +0100 Subject: Allow not checking chroot freshness This is useful to improve performance for for autobuild where we build all packages on a snapshot of the distribution. --- lib/Iurt/Chroot.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/Iurt/Chroot.pm') diff --git a/lib/Iurt/Chroot.pm b/lib/Iurt/Chroot.pm index 0e5eccf..362c7e7 100644 --- a/lib/Iurt/Chroot.pm +++ b/lib/Iurt/Chroot.pm @@ -270,6 +270,7 @@ sub check_mounted { sub check_chroot_need_update { my ($tmp_chroot, $run) = @_; + return 0; my $tmp_urpmi = mktemp("$tmp_chroot/tmp.XXXXXX"); mkdir_p("$tmp_urpmi/tmp"); my @installed_pkgs = grep { !/^gpg-pubkey/ } chomp_(cat_("$tmp_chroot/var/log/qa")); @@ -331,7 +332,7 @@ sub create_build_chroot_tar { if (!-f $chroot_tar) { plog("rebuild chroot tarball"); $rebuild = 1; - } else { + } elsif (!$run->{fixed_media}) { plog('DEBUG', "decompressing /var/log/qa from $chroot_tar in $tmp_chroot"); sudo($config, '--untar', $chroot_tar, $tmp_chroot, "./var/log/qa"); $rebuild = check_chroot_need_update($tmp_chroot, $run); @@ -368,6 +369,7 @@ sub create_build_chroot_btrfs { plog('NOTIFY', "creating btrfs chroot"); + # TODO: Handle $run{fixed_media} if (check_chroot_need_update($chroot_ref, $run)) { sudo($config, '--btrfs_delete', $chroot_ref); if (!sudo($config, '--btrfs_create', $chroot_ref)) { -- cgit v1.2.1