diff options
author | Nicolas Williams <nico@cryptonector.com> | 2014-11-24 17:58:34 -0600 |
---|---|---|
committer | Nicolas Williams <nico@cryptonector.com> | 2014-12-24 02:31:51 -0600 |
commit | 56ae88d9d55582e8d0036601e3186d88861bf105 (patch) | |
tree | e701832a92c25e21c7ed970f14181a5c5528b347 /execute.c | |
parent | 1cdcff1c01ff4681f8d73ec4ba9689a702c4c17a (diff) |
Module search revamp for pkg managers
The search path listed in an import directive can now be an array. The
top-level search path is appended. Null and empty strings in the path
terminate any search. The "." in "." and "./*" is replaced with the
directory containing the file doing the import (for command-line
programs this is the current directory, though that may be a bad idea).
No version numbers or anything of the sort are gratuitously added to the
search paths.
All this makes external package managers possible by allowing
dependencies to be installed local to dependents.
Diffstat (limited to 'execute.c')
-rw-r--r-- | execute.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -1004,12 +1004,16 @@ int jq_compile(jq_state *jq, const char* str) { return jq_compile_args(jq, str, jv_array()); } -jv jq_get_lib_origin(jq_state *jq) { - return jq_get_attr(jq, jv_string("ORIGIN")); +jv jq_get_jq_origin(jq_state *jq) { + return jq_get_attr(jq, jv_string("JQ_ORIGIN")); +} + +jv jq_get_prog_origin(jq_state *jq) { + return jq_get_attr(jq, jv_string("PROGRAM_ORIGIN")); } jv jq_get_lib_dirs(jq_state *jq) { - return jq_get_attr(jq, jv_string("LIB_DIRS")); + return jq_get_attr(jq, jv_string("JQ_LIBRARY_PATH")); } void jq_set_attrs(jq_state *jq, jv attrs) { |