aboutsummaryrefslogtreecommitdiff
path: root/brep/handler/ci/ci.bash.in
diff options
context:
space:
mode:
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
+}