ci: only remove libunwind-14-dev if installed
authorVincent Fu <vincent.fu@samsung.com>
Mon, 23 Sep 2024 16:50:31 +0000 (16:50 +0000)
committerVincent Fu <vincent.fu@samsung.com>
Thu, 26 Sep 2024 17:29:45 +0000 (13:29 -0400)
Some containers no longer have libunwind-14-dev in their repositories.
Remove this package only if it is installed.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
ci/actions-install.sh

index e7ba8443c889c2c8dd8a6866b5347116cfb7ddc2..a2d0922c35eb4d3fba85d6d8abf4a45295a9347f 100755 (executable)
@@ -60,8 +60,10 @@ DPKGCFG
                 librdmacm-dev
                pkg-config
             )
-           echo "Removing libunwind-14-dev because of conflicts with libunwind-dev"
-           sudo apt remove -y libunwind-14-dev
+           if apt list --installed | grep -c "libunwind-14-dev"; then
+                   echo "Removing libunwind-14-dev because of conflicts with libunwind-dev"
+                   sudo apt remove -y libunwind-14-dev
+           fi
            if [ "${CI_TARGET_OS}" == "linux" ] || [ "${CI_TARGET_OS}" == "ubuntu" ]; then
                # Only for Ubuntu
                pkgs+=(