From d7f33a794b02055adaa8692f8504623f75ce41c3 Mon Sep 17 00:00:00 2001 From: Daniel Drake Date: Wed, 18 Jul 2012 20:09:14 +0000 Subject: custom_packages: allow multiple settings to be specified Useful when you wish to use the custom_packages module in two ini files in the same build. --- diff --git a/modules/custom_packages/README b/modules/custom_packages/README index d7feb96..f32be42 100644 --- a/modules/custom_packages/README +++ b/modules/custom_packages/README @@ -1,9 +1,15 @@ This module allows you to specify a comma-separated list of packages to add -to the build, from the repositories already configured (usually through the -repos module). +or remove from the build, from the repositories already configured (usually +through the repos module). + +Options must be named "add_packages" or "del_packages", or you may also +use option names prefixed with "add_packages_" and "del_packages_". + Example: [custom_packages] -add_packages=tomboy,gnucash,pidgin +add_packages=tomboy,gnucash +add_packages_extras=pidgin +del_packages=totem diff --git a/modules/custom_packages/kspkglist.70.extras.sh b/modules/custom_packages/kspkglist.70.extras.sh index a804e09..921fc1f 100644 --- a/modules/custom_packages/kspkglist.70.extras.sh +++ b/modules/custom_packages/kspkglist.70.extras.sh @@ -3,24 +3,26 @@ . $OOB__shlib -add=$(read_config custom_packages add_packages) -del=$(read_config custom_packages del_packages) - -if [[ -n "$add" ]]; then - oIFS=$IFS +oIFS=$IFS +IFS=$'\n' +for line in $(env); do + [[ "${line:0:34}" == "CFG_custom_packages__add_packages_" || "${line}" == "CFG_custom_packages__add_packages" ]] || continue + pkgs=${line#*=} + oIFS2=$IFS IFS=$'\n\t, ' - for pkg in $add; do + for pkg in $pkgs; do echo "$pkg" done - IFS=$oIFS -fi + IFS=$oIFS2 +done -if [[ -n "$del" ]]; then - oIFS=$IFS +for line in $(env); do + [[ "${line:0:34}" == "CFG_custom_packages__add_packages_" || "${line}" == "CFG_custom_packages__add_packages" ]] || continue + pkgs=${line#*=} + oIFS2=$IFS IFS=$'\n\t, ' - for pkg in $del; do - echo "-$pkg" + for pkg in $pkgs; do + echo "$pkg" done - IFS=$oIFS -fi - + IFS=$oIFS2 +done -- cgit v0.9.1