aboutsummaryrefslogtreecommitdiff
path: root/src/luarocks/manif.lua (follow)
Commit message (Collapse)AuthorAgeFilesLines
* forward error messages from fs.unzipHisham Muhammad2018-07-181-2/+2
|
* manif: fix loading rock manifest from the correct repoHisham Muhammad2018-07-011-1/+1
| | | | | get_providing_file was always loading the rock_manifest from the default repo.
* deps: add fulfill_dependency for resolving a single dependencyHisham Muhammad2018-05-071-4/+4
|
* Use a single load_manifest function throughout the programHisham Muhammad2018-04-131-12/+25
|
* Try to isolate uses of namespaced name stringsHisham Muhammad2018-04-111-1/+1
| | | | | | | | | | | | | 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.
* Add support for namespaces.Hisham Muhammad2018-04-111-3/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Reorganize luarocks.core requires and type checking tablesHisham Muhammad2017-10-081-5/+32
| | | | | | | | | | | * 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.
* Move get_versions from luarocks.core.manif to luarocks.manif.Hisham2016-11-141-0/+27
| | | | | All functions that were in core only for get_versions are moved out as well. Made possible by PR #654.
* Merge branch 'master' into luarocks-3Peter Melnichenko2016-11-041-65/+68
|\
| * Fix and refactor conflict resolution on deploy/deletePeter Melnichenko2016-11-011-64/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Get rid of repeated missing deps checksPeter Melnichenko2016-10-301-12/+31
| | | | | | | | | | | | | | | | | | | | | | 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.
| * Update manifest after removal without rebuildingPeter Melnichenko2016-10-281-7/+82
| | | | | | | | | | | | | | 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.
| * manif.update_manifest: do not update manifest if rebuiltPeter Melnichenko2016-10-281-8/+4
| |
| * manif.update_manifest: load manifest as localPeter Melnichenko2016-10-281-1/+1
| |
| * Rename a variable in manif.update_manifestPeter Melnichenko2016-10-281-6/+6
| | | | | | | | | | `repo` sometimes means root dir and sometimes means rock dir. At least do not reuse the same variable for both.
| * Refactor store_results in luarocks.manif (2)Peter Melnichenko2016-10-281-21/+8
| | | | | | | | | | Do not accept a hook function to call after storing results. Simply call it on the outside after calling store_results.
| * Refactor store_results in luarocks.manifPeter Melnichenko2016-10-281-22/+22
| | | | | | | | | | | | 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.
* | Merge branch 'master' into luarocks-3Hisham2016-10-271-0/+1
|\|
| * Remove some unused locals and importsPeter Melnichenko2016-10-201-2/+1
| |
* | Merge branch 'master' into luarocks-3Hisham2016-10-201-16/+38
|\|
| * Fix conflict resolution on deploy/deletePeter Melnichenko2016-10-191-16/+38
| | | | | | | | | | | | | | | | 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").
| * Regenerate manifest every time we delete a version.Hisham2016-10-181-1/+1
| | | | | | | | | | | | | | 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.
* | Refactor error message and add extra checks.Hisham2016-10-191-1/+3
| |
* | Merge branch 'master' into luarocks-3Hisham2016-10-151-3/+8
|\|
| * Fix manif.find_{current,next}_provider returning "untracked" incorrectlyPeter Melnichenko2016-10-121-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `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.
* | Core modules reorganization.Hisham2016-06-301-362/+5
|/ | | | | | | | | | | | | | | | | | | | | | | | 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.
* Remove commented module() callsPeter Melnichenko2016-05-311-1/+0
|
* Don't spam 'Updating manifest for...'Peter Melnichenko2016-05-101-2/+0
| | | | | Installation success message is enough and is more important (what's a manifest and why users should care?)
* Show if rock is supported on other Lua versions on search failmpeterv2016-04-191-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | 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."
* Correct inaccuracy in documentation.Hisham Muhammad2014-08-111-1/+1
| | | | | | | 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.
* Merge branch 'master' of https://github.com/keplerproject/luarocks into ↵mpeterv2014-03-211-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Merge branch 'master' of github.com:keplerproject/luarocksHisham Muhammad2014-03-141-1/+1
| |\
| * | Revert change that broke rocks.moonscript.org — it would skip servers that ↵Hisham Muhammad2014-03-031-1/+1
| | | | | | | | | | | | have no .zip manifest in them.
* | | Unmoduled core modules with package.loaded trick + fixed locals shadowing ↵mpeterv2014-03-201-18/+22
| |/ |/| | | | | | | | | module table Thanks to Metalua for the possibility to automate this.
* | Removed some unused variablesmpeterv2014-03-131-1/+1
|/
* filter message when deps_mode="none"François Perrad2014-03-011-2/+1
| | | | | | | | | | 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 ```
* When a server times out, stop using it and move down the mirrors list.Hisham Muhammad2014-02-081-4/+4
|
* Check if unzip failedHisham Muhammad2014-01-101-1/+7
|
* Performance improvementsHisham Muhammad2014-01-091-27/+52
|
* Propagate failure of MD5 correctly. Closes #184.Hisham Muhammad2013-12-131-1/+5
|
* Make sure manifest unzips properly, to avoid stale manifests.Hisham Muhammad2013-11-171-1/+3
|
* Cache remote manifest files locally and hit server with a HEAD request to ↵Hisham Muhammad2013-10-201-1/+6
| | | | check timestamp.
* Use zipped manifests. Makes LR a bit faster!Hisham Muhammad2013-09-201-15/+38
|
* Should fix installation of parallel LuaRocks versions when using 'make ↵Hisham Muhammad2013-08-281-1/+1
| | | | | | bootstrap' on both. Thanks to Philipp Janda for the test case!
* Make sure manifest-5.1 and manifest-5.2 are generated and used only when ↵Hisham Muhammad2013-06-241-17/+32
| | | | dealing with the remote server.
* Add versioned manifest files for Lua 5.1 and 5.2. Make sure LuaRocks only ↵Hisham Muhammad2013-06-201-12/+63
| | | | finds rocks according to the Lua version it is using.
* More documentation on deps_modesHisham Muhammad2013-06-191-0/+12
|
* Clean up and make use of deps-mode / deps_mode consistent. --nodeps is now ↵Hisham Muhammad2012-10-311-11/+17
| | | | an alias to --deps-mode=none
* Merge branch 'master' into multitreeHisham Muhammad2012-10-161-1/+1
|\
| * On Windows, we can't "os.rename" over an existing file. Closes #104.Hisham Muhammad2012-10-161-1/+1
| |