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. --- NEWS | 1 + iurt | 3 +++ lib/Iurt/Chroot.pm | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 9845d05..46b1239 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ - ulri: improve handling of build failures - iurt: fix stale command detection when log is not created quickly enough - iurt: use urpm to parse synthesis (fixes support for xz) +- iurt: add fixed_media option to make autobuild faster 0.6.29 - iurt: support chroot tarballs with non gz compression diff --git a/iurt b/iurt index 9f27e52..6b077dd 100755 --- a/iurt +++ b/iurt @@ -185,6 +185,9 @@ $run{todo} = []; [ "", "resume", 0, "", "Only build packages not yet done during previous build-all run", sub { $run{resume} = 1 }, "Setting the resume flag" ], + [ "", "fixed_media", 0, "", + "Assume media do not change between build (useful for full rebuild of a snapshot of the distro)", + sub { $run{fixed_media} = 1 }, "Setting the fixed_media flag" ], [ "n", "no", 0, "", "Perform all the check but do not compile anything", sub { ($run{no_compile}) = 1 }, "Setting the no compilation flag" ], 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