aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bpkg/system-package-manager-debian.cxx9
-rw-r--r--bpkg/system-package-manager-fedora.cxx12
2 files changed, 21 insertions, 0 deletions
diff --git a/bpkg/system-package-manager-debian.cxx b/bpkg/system-package-manager-debian.cxx
index 8b27e37..b772352 100644
--- a/bpkg/system-package-manager-debian.cxx
+++ b/bpkg/system-package-manager-debian.cxx
@@ -4,6 +4,8 @@
#include <bpkg/system-package-manager-debian.hxx>
#include <locale>
+#include <thread> // this_thread::sleep_for()
+#include <chrono>
#include <libbutl/timestamp.hxx>
#include <libbutl/filesystem.hxx> // permissions
@@ -1487,6 +1489,13 @@ namespace bpkg
}
apt_get_install (specs);
+
+ // Note that installing packages on Debian and Debian-like distributions
+ // may end up with asynchronous restart of some system services. That,
+ // in particular, may result in the network short-term unavailability.
+ // Thus, let's pause for a while before fetching the source packages.
+ //
+ std::this_thread::sleep_for (std::chrono::seconds (1));
}
// Verify that versions we have promised in status() match what actually
diff --git a/bpkg/system-package-manager-fedora.cxx b/bpkg/system-package-manager-fedora.cxx
index 3b79c50..78d1739 100644
--- a/bpkg/system-package-manager-fedora.cxx
+++ b/bpkg/system-package-manager-fedora.cxx
@@ -4,6 +4,8 @@
#include <bpkg/system-package-manager-fedora.hxx>
#include <locale>
+#include <thread> // this_thread::sleep_for()
+#include <chrono>
#include <bpkg/diagnostics.hxx>
@@ -1810,8 +1812,18 @@ namespace bpkg
// Install.
//
if (install)
+ {
dnf_install (specs);
+ // Note that installing packages on Fedora and Fedora-like distributions
+ // may end up with asynchronous restart of some system services (see the
+ // %systemd_postun_with_restart RPM macro for details). That, in
+ // particular, may result in the network short-term unavailability.
+ // Thus, let's pause for a while before fetching the source packages.
+ //
+ std::this_thread::sleep_for (std::chrono::seconds (1));
+ }
+
// Mark as installed by the user.
//
dnf_mark_install (specs);