diff options
| author | hisham <hisham@9ca3f7c1-7366-0410-b1a3-b5c78f85698c> | 2009-10-08 18:57:41 +0000 |
|---|---|---|
| committer | hisham <hisham@9ca3f7c1-7366-0410-b1a3-b5c78f85698c> | 2009-10-08 18:57:41 +0000 |
| commit | bffc3eece0c655fca3f6bdf5f4de578d31c9434a (patch) | |
| tree | f06daceea142f09ea704f0a72c787cc3f2492c50 | |
| parent | 18e8087302dc031cd551f16f7e1b0e36bd1fd77a (diff) | |
| download | luarocks-bffc3eece0c655fca3f6bdf5f4de578d31c9434a.tar.gz luarocks-bffc3eece0c655fca3f6bdf5f4de578d31c9434a.tar.bz2 luarocks-bffc3eece0c655fca3f6bdf5f4de578d31c9434a.zip | |
improve compatibility with LR1 .rock files
git-svn-id: http://luarocks.org/svn/luarocks/trunk@74 9ca3f7c1-7366-0410-b1a3-b5c78f85698c
| -rw-r--r-- | src/luarocks/install.lua | 6 | ||||
| -rw-r--r-- | src/luarocks/manif.lua | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/luarocks/install.lua b/src/luarocks/install.lua index 15e905e1..3b399ebc 100644 --- a/src/luarocks/install.lua +++ b/src/luarocks/install.lua | |||
| @@ -58,6 +58,12 @@ function install_binary_rock(rock_file) | |||
| 58 | ok, err, errcode = deps.fulfill_dependencies(rockspec) | 58 | ok, err, errcode = deps.fulfill_dependencies(rockspec) |
| 59 | if err then return nil, err, errcode end | 59 | if err then return nil, err, errcode end |
| 60 | 60 | ||
| 61 | -- For compatibility with .rock files built with LuaRocks 1 | ||
| 62 | if not fs.exists(path.rock_manifest_file(name, version)) then | ||
| 63 | ok, err = manif.make_rock_manifest(name, version) | ||
| 64 | if err then return nil, err end | ||
| 65 | end | ||
| 66 | |||
| 61 | ok, err = rep.run_hook(rockspec, "post_install") | 67 | ok, err = rep.run_hook(rockspec, "post_install") |
| 62 | if err then return nil, err end | 68 | if err then return nil, err end |
| 63 | 69 | ||
diff --git a/src/luarocks/manif.lua b/src/luarocks/manif.lua index 63ba4a17..bdb691ab 100644 --- a/src/luarocks/manif.lua +++ b/src/luarocks/manif.lua | |||
| @@ -38,8 +38,7 @@ function load_rock_manifest(name, version) | |||
| 38 | if rock_manifest_cache[name_version] then | 38 | if rock_manifest_cache[name_version] then |
| 39 | return rock_manifest_cache[name_version].rock_manifest | 39 | return rock_manifest_cache[name_version].rock_manifest |
| 40 | end | 40 | end |
| 41 | local install_dir = path.install_dir(name, version) | 41 | local pathname = dir.rock_manifest_file(name, version) |
| 42 | local pathname = dir.path(install_dir, "rock_manifest") | ||
| 43 | local rock_manifest = persist.load_into_table(pathname) | 42 | local rock_manifest = persist.load_into_table(pathname) |
| 44 | if not rock_manifest then return nil end | 43 | if not rock_manifest then return nil end |
| 45 | rock_manifest_cache[name_version] = rock_manifest | 44 | rock_manifest_cache[name_version] = rock_manifest |
| @@ -48,7 +47,7 @@ end | |||
| 48 | 47 | ||
| 49 | function make_rock_manifest(name, version) | 48 | function make_rock_manifest(name, version) |
| 50 | local install_dir = path.install_dir(name, version) | 49 | local install_dir = path.install_dir(name, version) |
| 51 | local rock_manifest = dir.path(install_dir, "rock_manifest") | 50 | local rock_manifest = path.rock_manifest_file(name, version) |
| 52 | local tree = {} | 51 | local tree = {} |
| 53 | for _, file in ipairs(fs.find(install_dir)) do | 52 | for _, file in ipairs(fs.find(install_dir)) do |
| 54 | local full_path = dir.path(install_dir, file) | 53 | local full_path = dir.path(install_dir, file) |
