Do 'yum clean all' before yum-builddep.
authorRichard W.M. Jones <rjones@redhat.com>
Fri, 1 Aug 2014 17:01:24 +0000 (18:01 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Fri, 1 Aug 2014 17:49:22 +0000 (18:49 +0100)
Since the Koji repo changes frequently.

fedora_ocaml_rebuild.ml

index 027344d..717572e 100644 (file)
@@ -73,6 +73,13 @@ let () =
   printf "final list of source packages = %s\n%!"
     (String.concat " " source_packages)
 
+(* We could make this a goal, but it's cheap enough to run it unconditionally. *)
+let install_build_dependencies pkg =
+  sh "sudo yum clean all --disablerepo=\\* --enablerepo=%s"
+    (quote yum_repo);
+  sh "sudo yum-builddep -y --disablerepo=\\* --enablerepo=%s %s"
+    (quote yum_repo) (fedora_specfile pkg branch)
+
 (* Goal: rebuild all packages. *)
 let rec goal all () =
   List.iter (fun pkg -> require (rebuild_started pkg)) source_packages
@@ -182,14 +189,13 @@ and local_build_succeeded pkg =
 
   target (memory_exists key);
 
-  (* Do a local test build to ensure the Koji build will work. *)
+  install_build_dependencies pkg;
+
+ (* Do a local test build to ensure the Koji build will work. *)
   sh "
     cd %s
-    sudo yum-builddep -y --disablerepo=\\* --enablerepo=%s %s
-    fedpkg local
-  " (fedora_repo pkg branch)
-    (quote yum_repo)
-    (fedora_specfile pkg branch);
+     fedpkg local
+  " (fedora_repo pkg branch);
 
   memory_set key "1"
 
@@ -209,8 +215,7 @@ and specfile_updated pkg =
       git pull --rebase
     " repodir;
 
-  sh "sudo yum-builddep -y --disablerepo=\\* --enablerepo=%s %s"
-    (quote yum_repo) specfile;
+  install_build_dependencies pkg;
 
   (* For rationale behind always bumping the spec file, see comment
    * in 'fedora.ml'.