Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation of the pkg.available() returned table ? #2

Open
tst2005 opened this issue Nov 18, 2015 · 1 comment
Open

Documentation of the pkg.available() returned table ? #2

tst2005 opened this issue Nov 18, 2015 · 1 comment
Labels

Comments

@tst2005
Copy link

tst2005 commented Nov 18, 2015

Hello,

I searching for a while a better way to manage modules in lua (because the standard package/require does not manage version).

Your pkg module is really interesting.
I planned to follow the same API/format for my own implementation.
I'm only focused on information and managment, not on installation or update.

I don't found Specs about the format of the pkg.available() returned table.
I should discover it by seeking in the source code, but it will not tell me if field are Mandatory or Optional...

I see we have pkg.available to read and check ...
There is no way to add module information directly, I supposed it was done internaly by pkg.add
in my case, I planned to add a pkg.provide(...) to add new module information.

You are interested by writing Spec together ?

Best Regards

@stepelu
Copy link
Collaborator

stepelu commented Nov 18, 2015

First of all, apologies but the documentation on GitHub is outdated, I'll fix this soon.

For now, please refer to http://www.scilua.org/ulua.html and http://www.scilua.org/pkg.html.
The spec format is reported at http://www.scilua.org/ulua.html#specifications where I discuss about the __meta.lua file format.
The only essential fields are name and version, but it's best practice to include all of them, I think kept the required effort to a minimal level.

The meta information is managed by forcing the following the directory structure:

root_dir/package_name/package_version/__meta.lua

At startup time, the pkg module discovers all available modules by traversing the sub-folders of root_dir in search for __meta.lua files.

Also, pkg.available() does not return any table right now (it is a planned feature).

If you tell me exactly what you want to achieve maybe I can help you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants