Merge 0.9->0.10
authorKim Alvefur <zash@zash.se>
Fri, 9 May 2014 21:28:09 +0000 (23:28 +0200)
committerKim Alvefur <zash@zash.se>
Fri, 9 May 2014 21:28:09 +0000 (23:28 +0200)
1  2 
core/configmanager.lua

index 96c2517cf8d9ee47b4941390f6c5c134326125d0,d175b54b3efd9feaaaf5e57b27a5dd382fe5498f..1f7342b2e3f9b9efd7cdee394f55840a0c6ca8b3
@@@ -14,9 -14,7 +14,9 @@@ local format, math_max = string.format
  local fire_event = prosody and prosody.events.fire_event or function () end;
  
  local envload = require"util.envload".envload;
- local lfs = require "lfs";
+ local deps = require"util.dependencies";
 +local resolve_relative_path = require"util.paths".resolve_relative_path;
 +local glob_to_pattern = require"util.paths".glob_to_pattern;
  local path_sep = package.config:sub(1,1);
  
  module "configmanager"
                                end
                end
                env.component = env.Component;
 -              
 +
                function env.Include(file)
                        if file:match("[*?]") then
+                               local lfs = deps.softreq "lfs";
+                               if not lfs then
+                                       error(format("Error expanding wildcard pattern in Include %q - LuaFileSystem not available", file));
+                               end
                                local path_pos, glob = file:match("()([^"..path_sep.."]+)$");
                                local path = file:sub(1, math_max(path_pos-2,0));
                                local config_path = config_file:gsub("[^"..path_sep.."]+$", "");