From ce5e976133389eae7d4142b1e8b8501a66c57bf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 14 Jun 2011 15:53:13 +0200 Subject: easy_e17.sh: add build_package_list function and real_packages variable --- easy_e17.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/easy_e17.sh b/easy_e17.sh index ef91428..08d92b9 100755 --- a/easy_e17.sh +++ b/easy_e17.sh @@ -116,6 +116,7 @@ function header () echo " Packages: $packages" if [ "$skip" ]; then echo " Skipping: $skip"; fi if [ "$only" ]; then echo " Only: $only"; fi + echo " Effective: $real_packages" echo if [ -z "$action" ]; then action="MISSING!"; fi echo " Script action: $action" @@ -459,6 +460,26 @@ function parse_args () } +function build_package_list () +{ + real_packages="" + if [ "$only" ]; then + pkgs=$only + else + pkgs=$packages + fi + for pkg in $pkgs; do + found=0 + for not in $skip; do + if [ "$not" == "$pkg" ]; then + found=1 + break + fi + done + [ $found -eq 0 ] && real_packages="$real_packages $pkg" + done +} + # SETUP ############################################################################# function check_script_version () @@ -1071,6 +1092,7 @@ set_title define_os_vars read_config_files parse_args +build_package_list # check for script updates if [ "$action" == "script" ]; then header -- cgit v1.1-2-g2b99