-(* Helper function to make a full 'info' object from a version
- * number.
- *)
-let vernames version =
- Scanf.sscanf version "%d.%d.%d" (
- fun major minor release ->
- let is_stable = minor mod 2 = 0 in
- let branch =
- if is_stable then
- sprintf "stable-%d.%d" major minor
- else
- sprintf "master" in
- let package_version = sprintf "%s-%d.%d.%d" package major minor release in
- let tarball = sprintf "%s.tar.gz" package_version in
- let urlpath =
- if is_stable then
- sprintf "download/%d.%d-stable/%s" major minor tarball
- else
- sprintf "download/%d.%d-development/%s" major minor tarball in
- let url = "http://libguestfs.org/" ^ urlpath in
- { version = version;
- major = major; minor = minor; release = release;
- is_stable = is_stable;
- branch = branch;
- package_version = package_version;
- tarball = tarball;
- urlpath = urlpath;
- url = url }
- )
+(* Goals for Python sdists. *)
+and python_website_checked_in version =
+ let key = sprintf "libguestfs_python_website_checked_in_%s" version.version in
+ target (memory_exists key);
+ onrun (fun () -> memory_set key "1");
+
+ require (python_tarball_created version);
+ require (python_tarball_tested version);
+
+ sh "
+ cd %s
+ cp %s/tarballs/%s %s
+ git add %s
+ git commit -m \"Python sdist version %s\"
+ " libguestfs_download_repo
+ buildtmp version.python_tarball version.python_urlpath
+ version.python_urlpath
+ version.version
+
+and python_tarball_tested version =
+ let key = sprintf "libguestfs_python_tarball_tested_%s" version.version in
+ target (memory_exists key);
+ onrun (fun () -> memory_set key "1");
+
+ require (python_tarball_created version);
+
+ sh "
+ virtualenv venv
+ source ./venv/bin/activate
+ pip install %s/tarballs/%s
+ " buildtmp version.python_tarball
+
+and python_tarball_created version =
+ let filename = sprintf "%s/tarballs/%s" buildtmp version.python_tarball in
+ target (file_exists filename);
+
+ require (tarball_created version);