From 05d2973479c97a20d28ccb5e16105ab832bc7fe8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Petr=20P=C3=ADsa=C5=99?= Date: Fri, 20 Apr 2012 11:50:54 +0200 Subject: [PATCH] Create repository from built package in mock mode --- lib/Fedora/Rebuild/Package.pm | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/lib/Fedora/Rebuild/Package.pm b/lib/Fedora/Rebuild/Package.pm index 27e5ec9..cfea598 100644 --- a/lib/Fedora/Rebuild/Package.pm +++ b/lib/Fedora/Rebuild/Package.pm @@ -764,10 +764,12 @@ sub build { } -# Waits for Koji build root rotation. Just built package will be available for +# Waits for build root rotation. Just built package will be available for # other packages at build time after returning from this fuction. -# If first argument is not "koji", build is local and this function is void, -# otherwise waits for the Koji rotation. +# If first argument is "koji", it will wait for the Koji rotation. +# If first argument is "mock", it will create yum repository in directory with +# binary packages. +# If first argument is "local", this function is void, # Requires `update'. Sould be called after `build'. # Return true on success. sub dowaitforbuildroot { @@ -789,10 +791,19 @@ sub dowaitforbuildroot { "' build target yet.\n"); return $lock->mark_failed; } + } elsif ($mode eq 'mock') { + $lock->log("`" . $nevra . + "' built in mock, creating yum repository...\n"); + if (!$lock->do($self->rpmdir, 'createrepo', '.')) { + $lock->log("Could not create yum repository for `" . $nevra . + "' package.\n"); + return $lock->mark_failed; + } + $lock->log("`" . $nevra . + "' yum repository created successfully.\n"); } else { $lock->log("`" . $nevra . "' built locally, not waiting on Koji rotation.\n"); - return $lock->mark_done; } return $lock->mark_done; -- 2.11.4.GIT