File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -381,11 +381,9 @@ def rpaths
381
381
# rpaths simultaneously.
382
382
# @return [void]
383
383
# @raise [RpathUnknownError] if no such old runtime path exists
384
- # @raise [RpathExistsError] if the new runtime path already exists
385
384
def change_rpath ( old_path , new_path , options = { } )
386
385
old_lc = command ( :LC_RPATH ) . find { |r | r . path . to_s == old_path }
387
386
raise RpathUnknownError , old_path if old_lc . nil?
388
- raise RpathExistsError , new_path if rpaths . include? ( new_path )
389
387
390
388
new_lc = LoadCommands ::LoadCommand . create ( :LC_RPATH , new_path )
391
389
Original file line number Diff line number Diff line change @@ -415,6 +415,14 @@ def test_change_rpath
415
415
# there should be at least one rpath in each binary
416
416
refute_empty rpaths
417
417
418
+ # We should ignore errors when changing to an existing rpath
419
+ # This is the same behaviour as `install_name_tool`
420
+ file . change_rpath ( rpaths . first , rpaths . first )
421
+ new_rpaths = file . rpaths
422
+
423
+ assert_equal new_rpaths . first , rpaths . first
424
+ refute_empty new_rpaths . first , rpaths . first
425
+
418
426
file . change_rpath ( rpaths . first , "/usr/lib" )
419
427
new_rpaths = file . rpaths
420
428
@@ -574,10 +582,6 @@ def test_rpath_exceptions
574
582
file . change_rpath ( "/this/rpath/doesn't/exist" , "/lib" )
575
583
end
576
584
577
- assert_raises MachO ::RpathExistsError do
578
- file . change_rpath ( file . rpaths . first , file . rpaths . first )
579
- end
580
-
581
585
assert_raises MachO ::RpathExistsError do
582
586
file . add_rpath ( file . rpaths . first )
583
587
end
You can’t perform that action at this time.
0 commit comments