From be341d3e10b976c8a8724c4b220331fbaf1c4b35 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Sat, 25 Jun 2022 18:12:21 +0200 Subject: [PATCH] contrib/debian: rework package install Apt is run for each package separately and errors are ignored. This is not great -- it's slow and ignores errors. Therefore we sometimes end up without packages we need. Let's tolerate errors only for packages that we are know can fail to install safely. --- contrib/debian/REQUIRED_PACKAGES | 47 ++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/contrib/debian/REQUIRED_PACKAGES b/contrib/debian/REQUIRED_PACKAGES index eb38a3fa7d..9c5f294cd3 100755 --- a/contrib/debian/REQUIRED_PACKAGES +++ b/contrib/debian/REQUIRED_PACKAGES @@ -1,5 +1,7 @@ #!/bin/bash +set -xe + # A list of packages useful/needed to build and develop # NetworkManager on Debian and Ubuntu. # @@ -11,15 +13,20 @@ # This is a generous list of related packages. install() { - for p in "$@"; do - if [ "$NM_INSTALL" != "" ]; then - $NM_INSTALL "$p" || : - else - sudo apt-get install -y "$p" || : - fi + if [ "$NM_INSTALL" != "" ]; then + $NM_INSTALL "$@" + else + sudo apt-get install -y "$@" + fi +} + +install_ignore_missing() { + for p; do + install "$p" || : done } + install \ \ autoconf \ @@ -38,11 +45,9 @@ install \ libaudit-dev \ libcurl4-gnutls-dev \ libdbus-1-dev \ - libgcrypt11-dev \ libgirepository1.0-dev \ libglib2.0-dev \ libglib2.0-doc \ - libgnutls-dev \ libgnutls28-dev \ libiw-dev \ libjansson-dev \ @@ -65,10 +70,7 @@ install \ policykit-1 \ ppp \ ppp-dev \ - python-dbus \ - python-gi \ python-setuptools \ - python-software-properties \ python3-dbus \ python3-gi \ python3-pip \ @@ -78,3 +80,26 @@ install \ valgrind \ \ #end + +# Old. Present in Ubuntu 20.04, not in Ubuntu 22.04 +# software-properties-common +install_ignore_missing \ + python-dbus \ + python-gi \ + \ + #end + +# Old. Present in Ubuntu 18.04, not in Ubuntu 20.04 +# software-properties-common +install_ignore_missing \ + libgcrypt11-dev \ + \ + #end + +# Old. Present in Ubuntu 16.04, not in Ubuntu 18.04 +# software-properties-common +install_ignore_missing \ + libgnutls-dev \ + python-software-properties \ + \ + #end