diff options
| author | hisham <hisham@9ca3f7c1-7366-0410-b1a3-b5c78f85698c> | 2009-10-15 17:43:32 +0000 |
|---|---|---|
| committer | hisham <hisham@9ca3f7c1-7366-0410-b1a3-b5c78f85698c> | 2009-10-15 17:43:32 +0000 |
| commit | 56afb5b09c47eeeb9e29580f4e51e015b766a1dc (patch) | |
| tree | 8e8fbc61ba4b4b1fa7723662506e583ea2a96948 /src | |
| parent | 73eb0c1f54e17f28155cf43a3ff092f97b51ba0f (diff) | |
| download | luarocks-56afb5b09c47eeeb9e29580f4e51e015b766a1dc.tar.gz luarocks-56afb5b09c47eeeb9e29580f4e51e015b766a1dc.tar.bz2 luarocks-56afb5b09c47eeeb9e29580f4e51e015b766a1dc.zip | |
fix implementation of which()
git-svn-id: http://luarocks.org/svn/luarocks/trunk@101 9ca3f7c1-7366-0410-b1a3-b5c78f85698c
Diffstat (limited to 'src')
| -rw-r--r-- | src/luarocks/loader.lua | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/luarocks/loader.lua b/src/luarocks/loader.lua index 74f8c426..22a5a8df 100644 --- a/src/luarocks/loader.lua +++ b/src/luarocks/loader.lua | |||
| @@ -144,13 +144,16 @@ end | |||
| 144 | function which(module) | 144 | function which(module) |
| 145 | local name, version, module_name = | 145 | local name, version, module_name = |
| 146 | select_module(module, function(module_name, name, version, tree, i) | 146 | select_module(module, function(module_name, name, version, tree, i) |
| 147 | local deploy_dir | ||
| 147 | if module_name:match("%.lua$") then | 148 | if module_name:match("%.lua$") then |
| 148 | module_name = path.deploy_lua_dir(tree).."/"..module_name | 149 | deploy_dir = path.deploy_lua_dir(tree) |
| 150 | module_name = deploy_dir.."/"..module_name | ||
| 149 | else | 151 | else |
| 150 | module_name = path.deploy_lib_dir(tree).."/"..module_name | 152 | deploy_dir = path.deploy_lib_dir(tree) |
| 153 | module_name = deploy_dir.."/"..module_name | ||
| 151 | end | 154 | end |
| 152 | if i > 1 then | 155 | if i > 1 then |
| 153 | module_name = path.versioned_name(module_name, tree, name, version) | 156 | module_name = path.versioned_name(module_name, deploy_dir, name, version) |
| 154 | end | 157 | end |
| 155 | return module_name | 158 | return module_name |
| 156 | end) | 159 | end) |
