lib/chef/provider/package/dpkg.rb
def sources
          @sources ||=
            begin
              source_array.each_with_index.map do |source, i|
                package_name = package_name_array[i]
                # we require at least one '/' in the package_name to avoid dpkg_package 'foo' breaking due to a random 'foo' file in cwd
                if use_package_name_for_source? && source.nil? && package_name.match(/#{::File::SEPARATOR}/) && ::File.exist?(package_name)
                  Chef::Log.debug("No package source specified, but #{package_name} exists on filesystem, using #{package_name} as source.")
                  package_name
                else
                  source
                end
              end
            end
        end
# Helper to construct Array of sources.  If the new_resource.source is nil it
# will return an array filled will nil the same size as the package_name array
# For all the nil source values, if a file exists on the filesystem that
# matches the package name it will use that name as the source.
#
# @return [Array] Array of normalized sources with package_names converted to sources
Helper to construct Array of sources.  If the new_resource.source is nil it
will return an array filled will nil the same size as the package_name array
For all the nil source values, if a file exists on the filesystem that
matches the package name it will use that name as the source.
Helper to construct Array of sources . If the new_resource . source is nil it will return an array filled will nil the same size as the package_name array For all the nil source values if a file exists on the filesystem that matches the package name it will use that name as the source .
def sources
          @sources ||=
            begin
              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)
                  Chef::Log.debug("No package source specified, but #{package_name} exists on filesystem, using #{package_name} as source.")
                  package_name
                else
                  source
                end
              end
            end
        end
def sources @sources ||= begin 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 ) Chef :: Log . debug ( "No package source specified, but #{package_name} exists on filesystem, using #{package_name} as source." ) package_name else source end end end end
Helper to construct Array of sources.
Helper to construct Array of sources .
# we require at least one '/' in the package_name to avoid dpkg_package 'foo' breaking due to a random 'foo' file in cwd
Array of normalized sources with package_names converted to sources
Array of normalized sources with package_names converted to sources
Array