Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Drake <dsd@laptop.org>2012-07-18 20:09:14 (GMT)
committer Daniel Drake <dsd@laptop.org>2012-07-18 20:29:50 (GMT)
commitd7f33a794b02055adaa8692f8504623f75ce41c3 (patch)
treea17c57cb907e6979653ca6e035852cec2f63ee4b
parentc0ab46b3d6e7d9367fd6c9edfd6bf1303cc20cdd (diff)
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.
-rw-r--r--modules/custom_packages/README12
-rw-r--r--modules/custom_packages/kspkglist.70.extras.sh32
2 files changed, 26 insertions, 18 deletions
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