gnuboot-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v1 05/18] dependencies: trisquel: obtimize apt calls.


From: Denis 'GNUtoo' Carikli
Subject: [PATCH v1 05/18] dependencies: trisquel: obtimize apt calls.
Date: Fri, 29 Nov 2024 20:14:19 +0100

This makes sure that there is only one apt command that is called.

Since this change results in the some package names (like 'git') being
passed twice to apt install, this situation was tested with 'apt
install sl sl' on Trisquel 10 (nabia), Trisquel 11 (aramo) and also
PureOS 10 (byzantium) in case the trisquel and pureos dependencies are
merged later on, and it worked fine.

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
---
 resources/dependencies/trisquel | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/resources/dependencies/trisquel b/resources/dependencies/trisquel
index 784889e9..588832af 100755
--- a/resources/dependencies/trisquel
+++ b/resources/dependencies/trisquel
@@ -26,10 +26,9 @@
 [ "x${DEBUG+set}" = 'xset' ] && set -v
 set -u -e
 
+to_install=""
 install_packages()
 {
-    to_install=""
-
     for package in $@ ; do
         if dpkg -l "${package}" | grep "^ii" 2>&1>/dev/null ; then
             continue
@@ -37,10 +36,6 @@ install_packages()
             to_install="${to_install} ${package}"
         fi
     done
-
-    if [ -n "${to_install}" ] ; then
-        apt install -y ${to_install}
-    fi
 }
 
 if [ $EUID -ne 0 ]; then
@@ -137,3 +132,7 @@ install_packages gawk git grep lzip make sed tar xz-utils # 
u-boot-libre
 install_packages \
     pandoc \
     graphviz
+
+if [ -n "${to_install}" ] ; then
+    apt install -y ${to_install}
+fi
-- 
2.46.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]