summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2009-04-13 22:25:39 +0200
committerDieter Plaetinck <dieter@plaetinck.be>2009-04-13 22:25:39 +0200
commit5ebd3565e58ce30f91bbba9ce5f25871dddcd2e8 (patch)
tree3f09c36763ad76449ccf63073249f64022da00f9
parent46d707eb42974cd9c43af7301b801aa27491f30d (diff)
introduce (var_)TARGET_PACKAGES_EXCLUDE parameters + TARGET_GROUPS incorrect var fix
-rw-r--r--examples/generic-install-on-sda9
-rw-r--r--src/core/libs/lib-software.sh17
-rw-r--r--src/core/procedures/automatic1
3 files changed, 22 insertions, 5 deletions
diff --git a/examples/generic-install-on-sda b/examples/generic-install-on-sda
index 9d25776..9934e22 100644
--- a/examples/generic-install-on-sda
+++ b/examples/generic-install-on-sda
@@ -1,4 +1,6 @@
-# these variables are optional, here are the defaults (feel free to omit them)
+# this config explains the (all) available options.
+# the variables are optional and we define their defaults here (so you could omit the
+# definitions), unless otherwise specified.
SOURCE=cd
FILE_URL=file:///src/core/pkg
@@ -9,8 +11,9 @@ RUNTIME_REPOSITORIES=
RUNTIME_PACKAGES=
# packages to install
-TARGET_GROUPS=base #all packages in this group will be installed (defaults to base if no group and no packages are specified)
-TARGET_PACKAGES=openssh # you can also specify separate packages (this is empty by default)
+TARGET_GROUPS=base # all packages in this group will be installed (defaults to base if no group and no packages are specified)
+TARGET_PACKAGES_EXCLUDE= # Exclude these packages if they are member of one of the groups in TARGET_GROUPS. example: 'nano reiserfsprogs' (they are in base)
+TARGET_PACKAGES=openssh # you can also specify separate packages to install (this is empty by default)
# you can optionally also override some functions...
worker_intro () {
diff --git a/src/core/libs/lib-software.sh b/src/core/libs/lib-software.sh
index 384cab4..c378577 100644
--- a/src/core/libs/lib-software.sh
+++ b/src/core/libs/lib-software.sh
@@ -22,8 +22,21 @@ run_mkinitcpio()
# installpkg(). taken from setup. modified bigtime
# performs package installation to the target system
installpkg() {
- ALL_PACKAGES=$var_TARGET_PACKAGES
- [ -n "$TARGET_GROUPS" ] && ALL_PACKAGES="$ALL_PACKAGES "`list_packages group "$TARGET_GROUPS" | awk '{print $2}'`
+ ALL_PACKAGES=
+ [ -n "$var_TARGET_GROUPS" ] && ALL_PACKAGES=`list_packages group "$var_TARGET_GROUPS" | awk '{print $2}'`
+ if [ -n "$var_TARGET_PACKAGES_EXCLUDE" ]
+ then
+ for excl in $var_TARGET_PACKAGES_EXCLUDE
+ do
+ ALL_PACKAGES=${ALL_PACKAGES//$excl/}
+ done
+ fi
+
+ if [ -n "$var_TARGET_PACKAGES" ]
+ then
+ [ -n "$ALL_PACKAGES" ] && ALL_PACKAGES="$ALL_PACKAGES $var_TARGET_PACKAGES"
+ [ -z "$ALL_PACKAGES" ] && ALL_PACKAGES=$var_TARGET_PACKAGES
+ fi
ALL_PACKAGES=`echo $ALL_PACKAGES`
[ -z "$ALL_PACKAGES" ] && die_error "No packages/groups specified to install"
diff --git a/src/core/procedures/automatic b/src/core/procedures/automatic
index b0e327a..58911ff 100644
--- a/src/core/procedures/automatic
+++ b/src/core/procedures/automatic
@@ -99,6 +99,7 @@ worker_package_list ()
{
var_TARGET_PACKAGES=$TARGET_PACKAGES
var_TARGET_GROUPS=$TARGET_GROUPS
+ var_TARGET_PACKAGES_EXCLUDE=$TARGET_PACKAGES_EXCLUDE
[ -z "$var_TARGET_PACKAGES" -a -z "$var_TARGET_GROUPS" ] && var_TARGET_GROUPS=base
}