diff options
-rw-r--r-- | examples/generic-install-on-sda | 9 | ||||
-rw-r--r-- | src/core/libs/lib-software.sh | 17 | ||||
-rw-r--r-- | src/core/procedures/automatic | 1 |
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 } |