def plan
      ref = @dao.applied_patches
      @patches.select do |patch|
        signature = ref[patch.name]
        next false if signature == patch.signature
        next true if signature.nil? || patch.volatile?
        raise MismatchError, patch
      end
    end
def plan
      ref = @dao.applied_patches
      @patches.select do |patch|
        signature = ref[patch.name]
        next false if signature == patch.signature
        next true if signature.nil? || patch.volatile?
        raise MismatchError, patch
      end
    end
Produces an ordered list of patches that need to be applied.

 May raise MismatchError in case if signatures of any permanent
 patches that are present in the definition don't match
 ones of the patches applied to the database.