    # File lib/chef/provider/package.rb, line 43
          def define_resource_requirements
            requirements.assert(:install) do |a|
              a.assertion { ((@new_resource.version != nil) && !(target_version_already_installed?)) \
                || !(@current_resource.version.nil? && candidate_version.nil?)  }
              a.failure_message(Chef::Exceptions::Package, "No version specified, and no candidate version available for #{@new_resource.package_name}")
              a.whyrun("Assuming a repository that offers #{@new_resource.package_name} would have been configured")
            end

            requirements.assert(:upgrade) do |a|
              # Can't upgrade what we don't have
              a.assertion  { !(@current_resource.version.nil? && candidate_version.nil?) }
              a.failure_message(Chef::Exceptions::Package, "No candidate version available for #{@new_resource.package_name}")
              a.whyrun("Assuming a repository that offers #{@new_resource.package_name} would have been configured")
            end
          end