Update apt to 7.3.0

It now includes unattended-upgrades support
This commit is contained in:
Greg Karékinian
2020-06-19 16:21:35 +02:00
parent 1b84009958
commit e7edb5a464
13 changed files with 108 additions and 30 deletions

View File

@@ -2,7 +2,7 @@
# Cookbook:: apt
# Library:: helpers
#
# Copyright:: 2013-2017, Chef Software, Inc.
# Copyright:: 2013-2019, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -24,13 +24,13 @@ module Apt
#
# @return [Boolean]
def apt_installed?
!which('apt-get').nil?
!apt_which('apt-get').nil?
end
# Finds a command in $PATH
#
# @return [String, nil]
def which(cmd)
def apt_which(cmd)
ENV['PATH'] = '' if ENV['PATH'].nil?
paths = (ENV['PATH'].split(::File::PATH_SEPARATOR) + %w(/bin /usr/bin /sbin /usr/sbin))
@@ -44,6 +44,6 @@ module Apt
end
end
Chef::Recipe.send(:include, ::Apt::Helpers)
Chef::Resource.send(:include, ::Apt::Helpers)
Chef::Provider.send(:include, ::Apt::Helpers)
Chef::Recipe.include ::Apt::Helpers
Chef::Resource.include ::Apt::Helpers
Chef::Provider.include ::Apt::Helpers