From e7d8789cb4106fb6ec9e3713cd71a209027ed8ff Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 26 Jun 2024 16:38:17 +0300 Subject: Sleep for 1 second after installing system/distribution packages in bpkg-build --- bpkg/pkg-build.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 #include // cout +#ifndef _WIN32 +# include // this_thread::sleep_for() +# include +#endif + #include #include @@ -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 } } -- cgit v1.1