libtracefs: Fix make install_libs updating of ldconfig
PATCH 1/1 libtracefs: Fix make install_libs updating of ldconfig
From: "Steven Rostedt (VMware)" <[email protected]>
The ldconfig file /etc/ld.conf.d/trace.conf was being updated when it did not need to be, and should not be updated if ldconfig is not in the patch when installing.
Add a check to see if ldconfig can successfully run before testing if conf file should be updated. Also fix the grep of the conf file that looks for the path such that the output is not displayed to the console.
Signed-off-by Steven Rostedt (VMware) <[email protected]>
--- Makefile | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
Makefile +10 -9
@@ -226,16 +226,17 @@ ifeq ("$(DESTDIR)", "") # and running ldconfig, if the library is visible by ld.so. # If not, add the path to /etc/ld.so.conf.d/trace.conf and run ldconfig again. define install_ld_config - $(LDCONFIG); \ - if ! grep "^$(libdir)$$" $(LD_SO_CONF_PATH)/* &> /dev/null ; then \ - $(CC) -o $(objtree)/test $(srctree)/test.c -I $(includedir_SQ) \ - -L $(libdir_SQ) -ltracefs &> /dev/null; \ - if ! $(objtree)/test &> /dev/null; then \ - $(call print_install, trace.conf, $(LD_SO_CONF_PATH)) \ - echo $(libdir_SQ) >> $(LD_SO_CONF_PATH)/trace.conf; \ - $(LDCONFIG); \ + if $(LDCONFIG); then \ + if ! grep -q "^$(libdir)$$" $(LD_SO_CONF_PATH)/* ; then \ + $(CC) -o $(objtree)/test $(srctree)/test.c -I $(includedir_SQ) \ + -L $(libdir_SQ) -ltracefs &> /dev/null; \ + if ! $(objtree)/test &> /dev/null; then \ + $(call print_install, trace.conf, $(LD_SO_CONF_PATH)) \ + echo $(libdir_SQ) >> $(LD_SO_CONF_PATH)/trace.conf; \ + $(LDCONFIG); \ + fi; \ + $(RM) $(objtree)/test; \ fi; \ - $(RM) $(objtree)/test; \ fi endef else
Signature · 1 line
2.29.2