diff options
author | Peter Melnichenko <mpeterval@gmail.com> | 2016-11-01 14:18:16 +0300 |
---|---|---|
committer | Peter Melnichenko <mpeterval@gmail.com> | 2016-11-01 23:00:51 +0300 |
commit | cee2d3abfc1c06f382787d7bf7d2110a52ca0e76 (patch) | |
tree | 5e68eab6d55f48687b2169a5b8a267f9682d163c /.busted | |
parent | 933386b16d944eac3f93100886b03c3ae745b802 (diff) | |
download | luarocks-cee2d3abfc1c06f382787d7bf7d2110a52ca0e76.tar.gz luarocks-cee2d3abfc1c06f382787d7bf7d2110a52ca0e76.tar.bz2 luarocks-cee2d3abfc1c06f382787d7bf7d2110a52ca0e76.zip |
Fix and refactor conflict resolution on deploy/delete
Refactor repos.deploy_files and repos.delete_version
to make relationships between properties of deployed
files clearer and to avoid converting back and forth
between related properties.
Location of each deployable file in its rock manifest is
pair deploy_type - the first subtree name ("bin", "lib", or "lua")
and file_path - remaining path from the subtree to the file. These
components determine where each file is physically located.
Conflicts are considered based on two other properties: type
and name of an item a file provides. Type can be "command" or "module".
For items deployed using non-versioned names pairs (type, name) should be
unique.
Conversion from (deploy_type, file_path) to (item_type, item_name)
is obvious, using path.path_to_module() for modules. Reversing this
conversion is necessary for moving files between versioned and
non-versioned locations on conflicts, and also for path.which
function used in luarocks.show. However,
rock tree manifest only allows to get file_path, which
is not enough for modules - deploy_type can be both "lua" and "lib".
Currently path.which infers deploy_type based on extension,
falling back to "lib" if it's unknown, causing luarocks.show
to display wrong paths (#424). This commit does not address that
but adds relevant funcionality.
Currently conflict resolution assumes that both files in conflict
have same deploy_type and errors on conflict between
a C module and a Lua module. This commit fixes that, inferring
deploy_type for files with unknown extension using rock manifest.
Diffstat (limited to '.busted')
0 files changed, 0 insertions, 0 deletions