aboutsummaryrefslogtreecommitdiff
path: root/brep/handler/ci/ci.bash.in
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-08-31 21:41:53 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-09-01 18:36:07 +0300
commitb1888e516c9c9d750726318227bf69856ec91b8b (patch)
tree446fa1cdd1a9a9bf1827eba2a4f5bac7876f65ad /brep/handler/ci/ci.bash.in
parentd22f466823192963c22eb8f51ae930cb5af8fa9a (diff)
Add ci-load
Diffstat (limited to 'brep/handler/ci/ci.bash.in')
-rw-r--r--brep/handler/ci/ci.bash.in24
1 files changed, 24 insertions, 0 deletions
diff --git a/brep/handler/ci/ci.bash.in b/brep/handler/ci/ci.bash.in
index 023e98e..d5af34b 100644
--- a/brep/handler/ci/ci.bash.in
+++ b/brep/handler/ci/ci.bash.in
@@ -39,3 +39,27 @@ function exit_with_manifest () # <status> <message>
manifest_serializer_finish
run exit 0
}
+
+# Dump the repositories.manifest and packages.manifest files into the
+# specified directory by running bpkg-rep-info command for the specified
+# repository and using the specified fetch timeout (in seconds).
+#
+function dump_repository_manifests () # <repo-url> <dir> <timeout>
+{
+ local url="$1"
+ local dir="$2"
+ local tmo="$3"
+
+ if ! run_silent bpkg rep-info --fetch-timeout "$tmo" --manifest \
+--repositories --repositories-file "$dir/repositories.manifest" \
+--packages --packages-file "$dir/packages.manifest" "$url"; then
+
+ # Perform the sanity check to make sure that bpkg is runnable.
+ #
+ if ! run bpkg --version >/dev/null; then
+ error "unable to run bpkg"
+ fi
+
+ exit_with_manifest 422 "unable to fetch repository information (run 'bpkg rep-info $url' for details)"
+ fi
+}