unittests: Fix rpath tests no nixos

Which insert a bunch of rpath entries we strip, but then don't check if
they're empty and fail anyway.
This commit is contained in:
Dylan Baker 2022-03-15 13:52:34 -07:00 committed by Jussi Pakkanen
parent 9ee0de427c
commit 6c5a0f8332
1 changed files with 3 additions and 0 deletions

View File

@ -171,6 +171,9 @@ def get_rpath(fname: str) -> T.Optional[str]:
# nix/nixos adds a bunch of stuff to the rpath out of necessity that we
# don't check for, so clear those
final = ':'.join([e for e in raw.split(':') if not e.startswith('/nix')])
# If we didn't end up anything but nix paths, return None here
if not final:
return None
return final
def get_path_without_cmd(cmd: str, path: str) -> str: