Provide --purge-if-absent
to __package_apt
Configuration files are not purged under Debian when the package is deinstalled. If this parameter is given, they are deleted upon package deinstallation.
This commit is contained in:
parent
950f00d1a4
commit
3545d0157f
3 changed files with 10 additions and 1 deletions
|
@ -35,6 +35,11 @@ else
|
||||||
target_release=""
|
target_release=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -f "$__object/parameter/purge-if-absent" ]; then
|
||||||
|
purgeparam="--purge"
|
||||||
|
else
|
||||||
|
purgeparam=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# FIXME: use grep directly, state is a list, not a line!
|
# FIXME: use grep directly, state is a list, not a line!
|
||||||
|
@ -57,7 +62,7 @@ case "$state_should" in
|
||||||
echo $aptget install $target_release \"$name\"
|
echo $aptget install $target_release \"$name\"
|
||||||
;;
|
;;
|
||||||
absent)
|
absent)
|
||||||
echo $aptget remove \"$name\"
|
echo $aptget remove $purgeparam \"$name\"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Unknown state: $state_should" >&2
|
echo "Unknown state: $state_should" >&2
|
||||||
|
|
|
@ -28,6 +28,9 @@ state
|
||||||
target-release
|
target-release
|
||||||
Passed on to apt-get install, see apt-get(8).
|
Passed on to apt-get install, see apt-get(8).
|
||||||
Essentially allows you to retrieve packages from a different release
|
Essentially allows you to retrieve packages from a different release
|
||||||
|
purge-if-absent
|
||||||
|
If this parameter is given when state is `absent`, the package is
|
||||||
|
purged from the system (using `--purge`).
|
||||||
|
|
||||||
EXAMPLES
|
EXAMPLES
|
||||||
--------
|
--------
|
||||||
|
|
1
cdist/conf/type/__package_apt/parameter/boolean
Normal file
1
cdist/conf/type/__package_apt/parameter/boolean
Normal file
|
@ -0,0 +1 @@
|
||||||
|
purge-if-absent
|
Loading…
Reference in a new issue