# File lib/chef/provider.rb, line 84
      def build_from_file(cookbook_name, filename)
        pname = filename_to_qualified_string(cookbook_name, filename)
        
        # Add log entry if we override an existing light-weight provider.
        class_name = convert_to_class_name(pname)
        overriding = Chef::Provider.const_defined?(class_name)
        Chef::Log.info("#{class_name} light-weight provider already initialized -- overriding!") if overriding
        
        new_provider_class = Class.new self do |cls|
          
          def load_current_resource
            # silence Chef::Exceptions::Override exception
          end
          
          class << cls
            include Chef::Mixin::FromFile
            
            # setup DSL's shortcut methods
            def action(name, &block)
              define_method("action_#{name.to_s}") do
                instance_eval(&block)
              end
            end
          end
          
          # load provider definition from file
          cls.class_from_file(filename)
        end
        
        # register new class as a Chef::Provider
        pname = filename_to_qualified_string(cookbook_name, filename)
        class_name = convert_to_class_name(pname)
        Chef::Provider.const_set(class_name, new_provider_class)
        Chef::Log.debug("Loaded contents of #{filename} into a provider named #{pname} defined in Chef::Provider::#{class_name}")
        
        new_provider_class
      end