From 34b43ac08fe34d5cf3a2e5ca8ba386b9b7447981afe91f931e70628ea3fceb67 Mon Sep 17 00:00:00 2001 From: Richard Brown Date: Thu, 23 May 2024 20:00:57 +0000 Subject: [PATCH] - Wait for network for all aeon-mig-firstboot tasks OBS-URL: https://build.opensuse.org/package/show/devel:microos:aeon/gnome-branding-Aeon?expand=0&rev=19 --- aeon-firstboot | 8 ++++++-- aeon-mig-firstboot | 9 +++++++-- gnome-branding-Aeon.changes | 5 +++++ 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/aeon-firstboot b/aeon-firstboot index 40f601e..8481e1a 100644 --- a/aeon-firstboot +++ b/aeon-firstboot @@ -23,6 +23,10 @@ installFlatpakPackage(){ fi } +waitforNet(){ +until /usr/bin/curl -s --max-time 5 https://flathub.org > /dev/null; do sleep 1; done +} + defaultOptions() { pkgs=("org.mozilla.firefox" "org.gnome.Calculator" "org.gnome.TextEditor") } @@ -100,7 +104,7 @@ show_progress() { ( sleep 1 echo "# Waiting for Internet connection" - until /usr/bin/curl -s --max-time 5 https://flathub.org > /dev/null; do sleep 1; done + waitforNet while /usr/bin/pgrep -f '/usr/bin/flatpak|/usr/sbin/transactional-update|/usr/bin/pkexec' >/dev/null; do echo "# Installing Packages" sleep 1 @@ -125,7 +129,7 @@ install_locale() { } run_tasks() { - until /usr/bin/curl -s --max-time 5 https://flathub.org > /dev/null; do sleep 1; done + waitforNet if [[ -n "${need_locale}" ]]; then install_locale & fi diff --git a/aeon-mig-firstboot b/aeon-mig-firstboot index 3f0c744..28df9cb 100644 --- a/aeon-mig-firstboot +++ b/aeon-mig-firstboot @@ -11,7 +11,7 @@ show_progress() { ( sleep 1 echo "# Waiting for Internet connection" - until /usr/bin/curl -s --max-time 5 https://flathub.org > /dev/null; do sleep 1; done + waitforNet while /usr/bin/pgrep -f '/usr/bin/flatpak|/usr/sbin/transactional-update|/usr/bin/pkexec' >/dev/null; do echo "# Tuning Installation" sleep 1 @@ -20,7 +20,7 @@ show_progress() { } installFlatpakRepo(){ - until /usr/bin/curl -s --max-time 5 https://flathub.org > /dev/null; do sleep 1; done + waitforNet /usr/bin/flatpak remote-add --user --if-not-exists flathub /usr/share/aeon/flathub.flatpakrepo if [ "$?" != 0 ] ; then zenity --error \ @@ -30,6 +30,7 @@ installFlatpakRepo(){ } install_locale() { + waitforNet pkexec sh -c "/usr/sbin/transactional-update -n run zypper -n aloc ${LANG} && /usr/sbin/transactional-update -n apply" if [ "$?" != 0 ] ; then zenity --error \ @@ -46,6 +47,10 @@ lastMSG() { rm ~/.config/autostart/aeon-mig-firstboot.desktop } +waitforNet(){ +until /usr/bin/curl -s --max-time 5 https://flathub.org > /dev/null; do sleep 1; done +} + firstMSG installFlatpakRepo & if [[ ! "${LANG}" =~ ^en_ ]]; then diff --git a/gnome-branding-Aeon.changes b/gnome-branding-Aeon.changes index 58eee0f..771793c 100644 --- a/gnome-branding-Aeon.changes +++ b/gnome-branding-Aeon.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu May 23 20:00:38 UTC 2024 - Richard Brown + +- Wait for network for all aeon-mig-firstboot tasks + ------------------------------------------------------------------- Thu May 23 16:05:53 UTC 2024 - Richard Brown