    # File lib/chef/provider/package/apt.rb, line 28
            def load_current_resource
              @current_resource = Chef::Resource::Package.new(@new_resource.name)
              @current_resource.package_name(@new_resource.package_name)

              Chef::Log.debug("#{@new_resource} checking apt-cache policy")
              status = popen4("apt-cache policy #{@new_resource.package_name}") do |pid, stdin, stdout, stderr|
                stdout.each do |line|
                  case line
                  when /^\s{2}Installed: (.+)$/
                    installed_version = $1
                    if installed_version == '(none)'
                      Chef::Log.debug("#{@new_resource} current version is nil")
                      @current_resource.version(nil)
                    else
                      Chef::Log.debug("#{@new_resource} current version is #{installed_version}")
                      @current_resource.version(installed_version)
                    end
                  when /^\s{2}Candidate: (.+)$/
                    Chef::Log.debug("#{@new_resource} candidate version is #{$1}")
                    @candidate_version = $1
                  end
                end
              end

              unless status.exitstatus == 0
                raise Chef::Exceptions::Package, "apt-cache failed - #{status.inspect}!"
              end

              if @candidate_version == "(none)"
                raise Chef::Exceptions::Package, "apt does not have a version of package #{@new_resource.package_name}"
              end

              @current_resource
            end