open Goaljobs
open Config
+open Git
open Fedora
let branch = "master"
let blocked = [
"ocaml-libvirt"; (* RHBZ#1009701 *)
"ocaml-lwt"; "ocaml-react"; (* loganjerry is handling *)
+ "ocaml-xmlrpc-light"; (* temporary, can remove after 2013-09-19 *)
]
(* List of OCaml-related source package names. *)
(* Wait for the build state to reach a conclusion. *)
let rec loop () =
match koji_build_state (fedora_verrel pkg branch) with
+ | `No_such_build ->
+ failwith (sprintf "rebuild of package %s: no build found" pkg)
| `Building ->
- sleep 30;
+ sleep 60;
loop ()
| `Complete ->
()
target (file_contains_string specfile rebuild_name &&
(match koji_build_state (fedora_verrel pkg branch) with
| `Building | `Complete -> true
- | `Deleted | `Failed | `Canceled -> false));
+ | `Deleted | `Failed | `Canceled | `No_such_build -> false));
(* All dependent packages must have been fully rebuilt and in the
* repo first.
(* A local test build must succeed. *)
require (local_build_succeeded pkg);
- (* Rebuild the package in Koji, but don't wait. *)
- koji_build ~wait:false pkg branch
+ (* Rebuild the package in Koji. Don't wait ... *)
+ koji_build ~wait:false pkg branch;
+
+ (* ... but the build doesn't appear in Koji (eg. in 'koji
+ * buildinfo') until the SRPM has been built. This can take quite
+ * some time. Loop here until the build appears.
+ *)
+ let rec loop () =
+ match koji_build_state (fedora_verrel pkg branch) with
+ | `No_such_build ->
+ sleep 60;
+ loop ();
+ | `Building | `Complete ->
+ ()
+ | `Deleted ->
+ failwith (sprintf "rebuild of package %s: deleted" pkg)
+ | `Failed ->
+ failwith (sprintf "rebuild of package %s: failed" pkg)
+ | `Canceled ->
+ failwith (sprintf "rebuild of package %s: canceled" pkg)
+ in
+ loop ()
and local_build_succeeded pkg =
(* The specfile must have been updated. *)
(* Do a local test build to ensure the Koji build will work. *)
sh "
cd %s
- sudo yum-builddep %s
+ sudo yum-builddep -y %s
fedpkg local
" (fedora_repo pkg branch)
(fedora_specfile pkg branch);
let repodir = fedora_repo pkg branch in
let specfile = fedora_specfile pkg branch in
- (* XXX Automate common changes. *)
- let title = rebuild_name ^ " rebuild." in
sh "
cd %s
- git pull --rebase
- rm -rf x86_64 noarch *.src.rpm
- rpmdev-bumpspec -c %s %s
+ rm -rf x86_64 noarch *.src.rpm .build* clog
+ git fetch
+ " repodir;
+
+ if not (git_has_local_changes repodir) then
+ sh "
+ cd %s
+ git pull --rebase
+ " repodir;
+
+ sh "sudo yum-builddep -y %s" specfile;
+
+ (* For rationale behind always bumping the spec file, see comment
+ * in 'fedora.ml'.
+ *)
+ let title =
+ if not (file_contains_string specfile rebuild_name) then
+ rebuild_name ^ " rebuild."
+ else
+ "Bump release and rebuild." in
+ sh "rpmdev-bumpspec -c %s %s" (quote title) specfile;
+
+ (* XXX Automate common specfile fixes. *)
+
+ sh "
+ cd %s
echo 'Please make further changes as required to the spec file %s.spec'
echo '(Press return key)'
read
read
fedpkg push
" repodir
- (quote title) specfile
pkg
specfile