From 5a47906e38ff728c9604a1fca4b9f8f71573c850 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Wed, 11 Sep 2019 15:15:42 +0200 Subject: [PATCH] handle shell variables in a package name --- bin/install_packages | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/bin/install_packages b/bin/install_packages index 1e72faf2a..70e49aae3 100755 --- a/bin/install_packages +++ b/bin/install_packages @@ -5,7 +5,7 @@ # install_packages -- read package config and install packages via apt-get # # This script is part of FAI (Fully Automatic Installation) -# (c) 2000-2018, Thomas Lange, lange@informatik.uni-koeln.de +# (c) 2000-2019, Thomas Lange, lange@informatik.uni-koeln.de # (c) 2003-2004, Henning Glawe, glaweh@physik.fu-berlin.de # (c) 2004 , Jonas Hoffmann, jhoffman@physik.fu-berlin.de # PRELOAD feature from Thomas Gebhardt @@ -526,6 +526,16 @@ sub clean_pkg_list { insert_pkg($n, $pack, 1, "$n using $pack found") && next; } + # handle $varname in package name + if ( $pack =~ s/\$\w+//) { + insert_pkg($n, $pack, 1, "$n using $pack found") && next; + } + + # handle ${varname} in package name + if ( $pack =~ s/\$\{\w+\}//) { + insert_pkg($n, $pack, 1, "$n using $pack found") && next; + } + # else package is unknown push @unknown, $n; }