__file now supports --preseed (including the documentation)

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-03-21 10:07:38 +01:00
parent 3927da66b6
commit 4ff794b11a
2 changed files with 13 additions and 1 deletions

View File

@ -27,8 +27,14 @@ else
name="$__object_id"
fi
state="$(cat "$__object/parameter/state")"
# Check for preseeding and add preseed as here document
if [ -f "$__object/parameter/preseed" ]; then
echo "debconf-set-selections << __file-eof"
cat "$(cat "$__object/parameter/preseed")"
echo "__file-eof"
fi
state="$(cat "$__object/parameter/state")"
is_installed="$(grep "^Status: install ok installed" "$__object/explorer/pkg_status" || true)"
case "$state" in

View File

@ -25,6 +25,9 @@ OPTIONAL PARAMETERS
name::
If supplied, use the name and not the object id as the package name.
preseed::
If supplied, use the given filename as input for debconf-set-selections(1)
EXAMPLES
--------
@ -36,6 +39,9 @@ __package_apt zsh --state installed
# In case you only want *a* webserver, but don't care which one
__package_apt webserver --state installed --name nginx
# Install package with defaults (from a type)
__package_apt postfix --state installed --preseed "$__type/files/postfix-seed"
# Remove obsolete package
__package_apt puppet --state deinstalled
--------------------------------------------------------------------------------