File updater_common.lua
Gives an iterator over the lines of a given string.
Functions
| check_if_updatable (module, reqversion, newversion, oldvers) | Gives the can/should/why triple. |
| common_usage (cmd, stuff, errors) | Prints to stderr the comand line syntax of updater. |
| get_local_version (module) | Gives the local version of a moule. |
| lines (s) | Gives an iterator over the lines of a given string. |
| print_err (s) | prints to stderr |
| replace_module (module, newlua, path) | Installs the module. |
| update_path_for (name) | Gives the path of the module. |
Functions
- check_if_updatable (module, reqversion, newversion, oldvers)
-
Gives the can/should/why triple.
Parameters
- module: string the name of the module.
- reqversion: string the version of the core required .
- newversion: string the new version of the module.
- oldvers: string the old version of the modue.
Return value:
bool bool string The can,should,why triple. - common_usage (cmd, stuff, errors)
-
Prints to stderr the comand line syntax of updater.
Parameters
- cmd:
- stuff:
- errors:
- get_local_version (module)
-
Gives the local version of a moule.
Parameters
- module: string The module name.
Return value:
string The version if available, 0.0.0 if not; and the path of the file or nil if not present. - lines (s)
-
Gives an iterator over the lines of a given string.
Parameters
- s: string the data to split in lines.
Return value:
function. - print_err (s)
-
prints to stderr
Parameters
- s:
- replace_module (module, newlua, path)
-
Installs the module.
Parameters
- module: string The name of the module.
- newlua: string The boty of the module.
- path: string Where to put it.
Return value:
bool true if ok, false plus an err message oherwise. - update_path_for (name)
-
Gives the path of the module. Notice that this is not the path where the module is, but where it should be placed (i.e. /var under unix, LUA_UPDATES/ under win.
Parameters
- name: string the name of the module.
Return value:
string The path.