[type/__apt_norecommends] Use 00InstallRecommends file as debian-installer does

debian-installer can be preseeded with `base-installer/install-recommends` to
disable installation of recommended packages already during OS installation.
d-i will then create the file `/etc/apt/apt.conf.d/00InstallRecommends`
(cf. https://salsa.debian.org/installer-team/base-installer/-/blob/master/library.sh).

__apt_norecommends should use the same file to avoid having two config files
effectively doing the same thing.
This commit is contained in:
Dennis Camera 2020-10-29 10:39:42 +01:00
parent 2885c6a248
commit 82a9aa7902
2 changed files with 27 additions and 23 deletions

View file

@ -32,11 +32,12 @@ EXAMPLES
AUTHORS AUTHORS
------- -------
Steven Armstrong <steven-cdist--@--armstrong.cc> Steven Armstrong <steven-cdist--@--armstrong.cc>
Dennis Camera <dennis.camera--@--ssrq-sds-fds.ch>
COPYING COPYING
------- -------
Copyright \(C) 2014 Steven Armstrong. You can redistribute it Copyright \(C) 2014 Steven Armstrong, 2020 Dennis Camera.
and/or modify it under the terms of the GNU General Public License as You can redistribute it and/or modify it under the terms of the GNU General
published by the Free Software Foundation, either version 3 of the Public License as published by the Free Software Foundation, either version 3 of
License, or (at your option) any later version. the License, or (at your option) any later version.

View file

@ -1,6 +1,7 @@
#!/bin/sh -e #!/bin/sh -e
# #
# 2014 Steven Armstrong (steven-cdist at armstrong.cc) # 2014 Steven Armstrong (steven-cdist at armstrong.cc)
# 2020 Dennis Camera (dennis.camera at ssrq-sds-fds.ch)
# #
# This file is part of cdist. # This file is part of cdist.
# #
@ -19,26 +20,28 @@
# #
os=$(cat "$__global/explorer/os") os=$(cat "${__global:?}/explorer/os")
case "$os" in case ${os}
ubuntu|debian|devuan) in
# No stinking recommends thank you very much. (ubuntu|debian|devuan)
# If I want something installed I will do so myself. __file /etc/apt/apt.conf.d/00InstallRecommends --state present \
__file /etc/apt/apt.conf.d/99-no-recommends \ --owner root --group root --mode 0644 --source - <<-'EOF'
--owner root --group root --mode 644 \ APT::Install-Recommends "false";
--source - << DONE APT::Install-Suggests "false";
APT::Install-Recommends "0"; APT::AutoRemove::RecommendsImportant "false";
APT::Install-Suggests "0"; APT::AutoRemove::SuggestsImportant "false";
APT::AutoRemove::RecommendsImportant "0"; EOF
APT::AutoRemove::SuggestsImportant "0";
DONE # TODO: Remove the following object after some time
;; require=__file/etc/apt/apt.conf.d/00InstallRecommends \
*) __file /etc/apt/apt.conf.d/99-no-recommends --state absent
cat >&2 << DONE ;;
(*)
cat >&2 <<EOF
The developer of this type (${__type##*/}) did not think your operating system The developer of this type (${__type##*/}) did not think your operating system
($os) would have any use for it. If you think otherwise please submit a patch. ($os) would have any use for it. If you think otherwise please submit a patch.
DONE EOF
exit 1 exit 1
;; ;;
esac esac