From 03e00e5c1f6bffa5c111489fc64c72cf2fe5affa Mon Sep 17 00:00:00 2001 From: Daniel Drake Date: Sun, 22 Jul 2012 12:40:25 +0000 Subject: custom_packages: fix package list generation Fix some copy/paste errors in the last commit, and fix for the case when newlines are present in the option value. --- diff --git a/modules/custom_packages/kspkglist.70.extras.sh b/modules/custom_packages/kspkglist.70.extras.sh index 921fc1f..03be524 100644 --- a/modules/custom_packages/kspkglist.70.extras.sh +++ b/modules/custom_packages/kspkglist.70.extras.sh @@ -3,26 +3,24 @@ . $OOB__shlib -oIFS=$IFS -IFS=$'\n' -for line in $(env); do - [[ "${line:0:34}" == "CFG_custom_packages__add_packages_" || "${line}" == "CFG_custom_packages__add_packages" ]] || continue +while IFS= read -r -d '' line; do + [[ "${line:0:34}" == "CFG_custom_packages__add_packages_" || "${line:0:34}" == "CFG_custom_packages__add_packages=" ]] || continue pkgs=${line#*=} - oIFS2=$IFS + oIFS=$IFS IFS=$'\n\t, ' for pkg in $pkgs; do echo "$pkg" done - IFS=$oIFS2 -done + IFS=$oIFS +done < <(env --null) -for line in $(env); do - [[ "${line:0:34}" == "CFG_custom_packages__add_packages_" || "${line}" == "CFG_custom_packages__add_packages" ]] || continue +while IFS= read -r -d '' line; do + [[ "${line:0:34}" == "CFG_custom_packages__del_packages_" || "${line:0:34}" == "CFG_custom_packages__del_packages=" ]] || continue pkgs=${line#*=} - oIFS2=$IFS + oIFS=$IFS IFS=$'\n\t, ' for pkg in $pkgs; do - echo "$pkg" + echo "-$pkg" done - IFS=$oIFS2 -done + IFS=$oIFS +done < <(env --null) -- cgit v0.9.1