__apt_backports: update index if required

This type now automatically calls the type __apt_update_index to update
the package index if something changed.
This commit is contained in:
matze 2020-12-12 10:00:23 +01:00
parent 49aec0b5e4
commit fafa3d9ea5
2 changed files with 11 additions and 7 deletions

View file

@ -9,8 +9,11 @@ cdist-type__apt_backports - Install backports
DESCRIPTION DESCRIPTION
----------- -----------
This singleton type installs backports for the current OS release. This singleton type installs backports for the current OS release.
It aborts if backports are not supported for the specified OS or no It aborts if backports are not supported for the specified OS or
version codename could be fetched (like Debian unstable). no version codename could be fetched (like Debian unstable).
The package index will be automatically updated by the type
:strong:`cdist-type__apt_update_index`\ (7) if required.
It supports backports from following OSes: It supports backports from following OSes:
@ -59,12 +62,9 @@ EXAMPLES
__apt_backports --state absent __apt_backports --state absent
__apt_backports --state present --mirror "http://ftp.de.debian.org/debian/" __apt_backports --state present --mirror "http://ftp.de.debian.org/debian/"
# update
require="__apt_backports" __apt_update_index
# install a backports package # install a backports package
# currently for the buster release backports # currently for the buster release backports
require="__apt_update_index" __package_apt wireguard \ require="__apt_backports" __package_apt wireguard \
--target-release buster-backports --target-release buster-backports
@ -90,6 +90,7 @@ SEE ALSO
`Official Debian Backports site <https://backports.debian.org/>`_ `Official Debian Backports site <https://backports.debian.org/>`_
:strong:`cdist-type__apt_source`\ (7) :strong:`cdist-type__apt_source`\ (7)
:strong:`cdist-type__apt_update_index`\ (7)
AUTHORS AUTHORS

View file

@ -19,7 +19,7 @@
# along with cdist. If not, see <http://www.gnu.org/licenses/>. # along with cdist. If not, see <http://www.gnu.org/licenses/>.
# #
# #
# Enables/disables backports repository. Utilies __apt_source for it. # Enables/disables backports repository. Utilises __apt_source for it.
# #
@ -79,3 +79,6 @@ __apt_source "${dist}-backports" \
--distribution "${dist}-backports" \ --distribution "${dist}-backports" \
--component "$components" \ --component "$components" \
--uri "$mirror" --uri "$mirror"
# update the index if the source changed
require="__apt_source/${dist}-backports" __apt_update_index