aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2017-07-29 13:49:51 +0100
committerPascal Terjan <pterjan@mageia.org>2017-10-02 22:58:14 +0100
commita1e34113fcb9538ad8a29eec80075dff04253068 (patch)
treecd3b1af2f7d74bc87af44106f0764849acc9ffcf
parent536be8dbb27733521e3cbb312fbcbf6adbd36362 (diff)
downloadiurt-a1e34113fcb9538ad8a29eec80075dff04253068.tar
iurt-a1e34113fcb9538ad8a29eec80075dff04253068.tar.gz
iurt-a1e34113fcb9538ad8a29eec80075dff04253068.tar.bz2
iurt-a1e34113fcb9538ad8a29eec80075dff04253068.tar.xz
iurt-a1e34113fcb9538ad8a29eec80075dff04253068.zip
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.
-rw-r--r--NEWS1
-rwxr-xr-xiurt3
-rw-r--r--lib/Iurt/Chroot.pm4
3 files changed, 7 insertions, 1 deletions
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)) {