| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
get_providing_file was always loading the rock_manifest from the
default repo.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add asserts to uses of `name` arguments to check that they
are not namespaced; rename namespace-able name arguments
to `ns_name` and avoid some unrelated uses of the `name`
argument that don't represent rock names (there are still
others around, to be fixed eventually).
This may cause some failures in some untested code paths
with namespaced packages, but we hope to catch them
with better testing. Better to be safe here than to
perform filesystem operations on incorrect paths.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For details of the new feature, see
https://github.com/luarocks/luarocks/wiki/Namespaces
This ended up being a huge commit because of some major refactoring
motivated by the new feature:
* new modules for some object types:
* `luarocks.queries` - all functions that look for rocks in local or
remote repositories now use objects constructed by this module:
query objects contain the name, namespace and query constraints.
Dependencies in a rockspec are also stored as query objects.
* `luarocks.results` - all individual results produces from queries
are returned in this format: result objects contain the name,
namespace, version, arch and repo.
* the `results` object was renamed to `result_tree`, to better
reflect that it is not an array of `result` objects.
* `luarocks.vers` was removed, its functionality was moved to better locations.
Specifically on namespaces:
* Commands that take a rock `name` can now take `namespace/name`
(and alternately `--flags=namespace` so that URLs can be
also installed with a nominal namespace).
* Rocks installed from a namespace now create a `rock_namespace`
file alongside `rock_manifest`, which is used when matching
namespaced dependencies against locally-installed rocks.
* Using namespaced dependencies in a rockspec, requires
`rockspec_format = "3.0"`.
* Tests under the `#namespaces` hashtag, all using a local repository.
|
|
|
|
|
|
|
|
|
|
|
| |
* For each `luarocks.core.x` module, make `luarocks.x` module
load the core module explicitly as `core`, and expose its
relevant methods explicitly as well (instead of using
`setmetatable`).
* Move all type checking out of the core, adjusting the manifest
modules accordingly.
* Create separate modules for the rockspec and manifest
schemas in the `luarocks.type` namespace.
|
|
|
|
|
| |
All functions that were in core only for get_versions are moved out as well.
Made possible by PR #654.
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Do not report missing dependencies on manifest update, which is now
done more often. Instead do it at the end of commands
that may alter manifest (install, build, make, remove - excluding
purge).
For reporting reuse format used when showing missing deps to be
installed. Do not report missing indirect dependencies,
only direct ones.
|
| |
| |
| |
| |
| |
| |
| | |
Rename `manif.update_manifest` to `manif.add_to_manifest`.
Add `manif.remove_from_manifest` that performs reverse action.
Use it in `repos.delete_version` to avoid rebuilding manifest
everytime a package is removed.
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
`repo` sometimes means root dir and sometimes means rock dir.
At least do not reuse the same variable for both.
|
| |
| |
| |
| |
| | |
Do not accept a hook function to call after storing results.
Simply call it on the outside after calling store_results.
|
| |
| |
| |
| |
| |
| | |
Instead of passing a function and its arguments to a helper
function for it to call it, make a copy of result, and return it,
call the function on the outer level and pass the result to helper.
|
|\| |
|
| | |
|
|\| |
|
| |
| |
| |
| |
| |
| |
| |
| | |
When deploying or deleting files, resolve conflicts purely
based on module names and command names, not file names.
Also, don't assume that in case of a conflict both packages have the
same file providing the module or command; it can be false due to binary
wrappers and `path_to_module("mod/init.lua")` == `path_to_module("mod.lua").
|
| |
| |
| |
| |
| |
| |
| | |
This is a naive implementation of the solution suggested by @mpeterv for #268.
I'm merging this since it does produce more correct behavior,
at the cost of a performance regression. We need a function akin to
update_manifest for removing packages from a manifest.
|
| | |
|
|\| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
`find_providers` function used by `manif.find_current_provider`
and `manif.find_next_provider` needs relative path from a directory
an installed file is deployed in (bin dir, lua dir, or lib dir) to the file.
It then uses that path as key in manifest, converting it to
module name beforehand for lua files and lib files.
It happened to leave a leading slash in this relative path for
lua and lib files. `path.path_to_module` has a workaround stripping
leading dots caused by leading slashes. However, if the file
doesn't have `.lua` extension, slashes are not converted to dots
and the workaround doesn't trigger.
The issue results in files falsely considered "untracked" and backed-up
when reinstalling a different version of a rock,
see sailorproject/sailor#138.
The fix is to use correct relative paths without leading slashes.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Isolate all modules used by luarocks.loader in a
luarocks.core.* namespace. Core modules can only require
other core modules, and they only use require() at the
top-level chunk. In other words, after luarocks.loader
is setup, package.path can be altered at will and it
should not affect the ability of luarocks.loader to run,
and the luarocks.loader modules should not interfere
with modules loaded later.
This was motivated by @robooo's GSoC work on porting
the LuaRocks test suite to Lua using Busted. Busted itself
runs using luarocks.loader, and we need to ensure that
the modules loaded by the tests do not conflict with
the ones used by luarocks.loader.
A circular dependency between luarocks.manif and
luarocks.search was removed by creating a separate
luarocks.manif.writer module.
Also, luarocks-admin commands were moved to a
luarocks.admin.* namespace.
|
| |
|
|
|
|
|
| |
Installation success message is enough and is more important
(what's a manifest and why users should care?)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Supporting changes:
* Change structure of manifest cache: map from repo_url to tables
mapping from lua versions to manifests.
* New manif_core cache_manifest and get_cached_manifest functions
to hide cache implementation.
* lua_version optional argument for functions between
search.find_suitable_rock and manifest loader.
Main changes:
* Add a helper function supported_lua_versions that checks which
Lua versions can satisfy a query.
* Use this helper function when a search for a rock failed,
in search.find_suitable_rock, if constraints can be satisfied
under a different Lua version mention that in the error message.
Examples of error messages:
* Constraint "sailor": "sailor supports only Lua 5.1 and
Lua 5.2 but not Lua 5.3."
* Constraint "sailor 0.5": "sailor 0.5 supports only Lua 5.1
and Lua 5.2 but not Lua 5.3."
* Constraint "sailor >= 0.5": "Matching sailor versions support
only Lua 5.1 and Lua 5.2 but not Lua 5.3."
|
|
|
|
|
|
|
| |
The logic for determining the default local repository can get complicated
(see luarocks/command_line.lua and luarocks/path.lua), so saying
cfg.root_dir wouldn't be quite precise either. So let's avoid the issue.
Closes #278.
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
lua52_compat
Conflicts:
src/bin/luarocks
src/luarocks/fs/unix/tools.lua
src/luarocks/path.lua
Fixed:
src/luarocks/path_cmd.lua: moved meta-data from path.lua
Makefile: added path_cmd.lua to the list of installed files
|
| |\ |
|
| | |
| | |
| | |
| | | |
have no .zip manifest in them.
|
| |/
|/|
| |
| |
| |
| | |
module table
Thanks to Metalua for the possibility to automate this.
|
|/ |
|
|
|
|
|
|
|
|
|
|
| |
On Buildroot, we call `luarocks make --deps-mode=none --keep foo.rockspec`
So, the message about missing dependency is confusing.
```
Warning: skipping dependency checks.
...
Missing dependency for cgilua 5.1.4-1: luafilesystem >= 1.5.0
```
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
check timestamp.
|
| |
|
|
|
|
|
|
| |
bootstrap' on both.
Thanks to Philipp Janda for the test case!
|
|
|
|
| |
dealing with the remote server.
|
|
|
|
| |
finds rocks according to the Lua version it is using.
|
| |
|
|
|
|
| |
an alias to --deps-mode=none
|
|\ |
|
| | |
|