diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2020-03-07 01:45:07 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2020-03-07 01:45:07 -0500 |
commit | 2a9eaa0aa4a046bb2dfd4c2aeb1ebbdcff0770b9 (patch) | |
tree | 374904f82f827222746c8a4ca40664eba6641d7f /src/internal_cmd.c | |
parent | e6d43d723b75ffc489f436238459175eab49d895 (diff) | |
download | spmc-2a9eaa0aa4a046bb2dfd4c2aeb1ebbdcff0770b9.tar.gz |
Refactor RPATH creation:
* Decreased complexity
* Most rpath_* functions accept a FSTree structure now
* Fewer calls to chdir() overall
* Deeply nested libraries are detected
* Libraries are no longer confined to lib/ and /lib64
Diffstat (limited to 'src/internal_cmd.c')
-rw-r--r-- | src/internal_cmd.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/internal_cmd.c b/src/internal_cmd.c index 558116d..ef828c8 100644 --- a/src/internal_cmd.c +++ b/src/internal_cmd.c @@ -270,15 +270,19 @@ void rpath_autoset_interface_usage(void) { * @return return value of `rpath_autoset` */ int rpath_autoset_interface(int argc, char **argv) { - if (argc < 2) { + if (argc < 3) { rpath_autoset_interface_usage(); return -1; } char *filename = argv[1]; - int result = rpath_autoset(filename); + const char *topdir = argv[2]; + FSTree *libs = rpath_libraries_available(topdir); + int result = rpath_autoset(filename, libs); + if (result < 0) { fprintf(SYSERROR); } + return result; } |