From e1867522e888f861f1de321550aec3f8fc6d47a8 Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Mon, 7 Nov 2016 13:14:27 -0800 Subject: [PATCH] Replace rpath to remove if possible If the rpath to remove is available, replace it with an rpath that is to be added to the target file. This prevents errors as seen with the curl library where simply adding and removing rpaths would cause a command load error within the library. --- .../vagrant_substrate/manifests/staging/darwin_rpath.pp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/substrate/modules/vagrant_substrate/manifests/staging/darwin_rpath.pp b/substrate/modules/vagrant_substrate/manifests/staging/darwin_rpath.pp index 48a81855..e59d2bed 100644 --- a/substrate/modules/vagrant_substrate/manifests/staging/darwin_rpath.pp +++ b/substrate/modules/vagrant_substrate/manifests/staging/darwin_rpath.pp @@ -25,6 +25,11 @@ { target_file_path => $target_file_path } ) + exec { "change-${name}-rpath": + command => "install_name_tool -rpath ${remove_rpath} ${add_rpath[0]} ${target_file_path}", + onlyif => "otool -l ${target_file_path} | grep 'path ${remove_rpath}'" + } + $add_rpath_stringify = join($add_rpath, "<${target_file_path}>,") $hacky_add_rpath = split("${add_rpath_stringify}<${target_file_path}>", ",") vagrant_substrate::staging::darwin_add_rpath { $hacky_add_rpath: