From 2a9eaa0aa4a046bb2dfd4c2aeb1ebbdcff0770b9 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Sat, 7 Mar 2020 01:45:07 -0500 Subject: 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 --- src/internal_cmd.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/internal_cmd.c') 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; } -- cgit