aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bpkg/pkg-build.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/bpkg/pkg-build.cxx b/bpkg/pkg-build.cxx
index 6a9ad7d..c230463 100644
--- a/bpkg/pkg-build.cxx
+++ b/bpkg/pkg-build.cxx
@@ -9,6 +9,11 @@
#include <sstream>
#include <iostream> // cout
+#ifndef _WIN32
+# include <thread> // this_thread::sleep_for()
+# include <chrono>
+#endif
+
#include <libbutl/standard-version.hxx>
#include <bpkg/package.hxx>
@@ -7752,6 +7757,15 @@ namespace bpkg
assert (sys_pkg_mgr && *sys_pkg_mgr != nullptr);
(*sys_pkg_mgr)->install (ps);
+
+ // Note that installing packages on POSIX systems may end up with
+ // asynchronous restart of some system services which, in particular,
+ // may result in the network short-term unavailability. Thus, let's
+ // pause for a while before fetching the source packages.
+ //
+#ifndef _WIN32
+ this_thread::sleep_for (chrono::seconds (1));
+#endif
}
}