lib/chef/provider/package.rb
# Helper to handle use_package_name_for_source to convert names into local packages to install.
#
# @return [Array] Array of sources with package_names converted to sources
Helper to handle use_package_name_for_source to convert names into local packages to install.
Helper to handle use_package_name_for_source to convert names into local packages to install .
def resolved_source_array
        @resolved_source_array ||=
          source_array.each_with_index.map do |source, i|
            package_name = package_name_array[i]
            if use_package_name_for_source? && source.nil? && package_name.match(/#{::File::SEPARATOR}/) && ::File.exist?(package_name)
              logger.trace("No package source specified, but #{package_name} exists on filesystem, using #{package_name} as source.")
              package_name
            else
              source
            end
          end
      end
def resolved_source_array @resolved_source_array ||= source_array . each_with_index . map do | source , i | package_name = package_name_array [ i ] if use_package_name_for_source? && source . nil? && package_name . match ( / #{ :: File :: SEPARATOR } / ) && :: File . exist? ( package_name ) logger . trace ( "No package source specified, but #{package_name} exists on filesystem, using #{package_name} as source." ) package_name else source end end end
Helper to handle use_package_name_for_source to convert names into local packages to install.
Helper to handle use_package_name_for_source to convert names into local packages to install .
# we require at least one '/' in the package_name to avoid [XXX_]package 'foo' breaking due to a random 'foo' file in cwd
Array of sources with package_names converted to sources
Array of sources with package_names converted to sources
Array