From 12593a159ae10ba8779deb076b83e7b2dcf6e202 Mon Sep 17 00:00:00 2001 From: Tyson Whitehead Date: Fri, 31 Jul 2020 11:40:17 -0400 Subject: [PATCH] opengl: VirtualGL trailing deliminator issue causing rpath skippage Bash read returns false if trailing deliminator is not found causing the while read -d ':' loop to not process the last rpath entry. --- pkgs/opengl/insert-virtualgl.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgs/opengl/insert-virtualgl.sh b/pkgs/opengl/insert-virtualgl.sh index 993bb0f..b411c02 100755 --- a/pkgs/opengl/insert-virtualgl.sh +++ b/pkgs/opengl/insert-virtualgl.sh @@ -7,13 +7,13 @@ VGL_quote() { # Stream producers # -# These produce a stream of escaped new-line separated items +# These produce a stream of escaped new-line terminated items # # Stream the given arguments # VGL_sourceS() { - printf '%q\n' "$@" + (( $# == 0 )) || printf '%q\n' "$@" } # Stream the results of find (correctly escapes all filenames) @@ -61,15 +61,16 @@ VGL_elfRPathS() { declare file=$1 entry patchelf --print-rpath "$file" | while read -d ':' -r entry; do - VGL_sourceS "$entry" + [[ -z $entry ]] || VGL_sourceS "$entry" done + [[ -z $entry ]] || VGL_sourceS "$entry" } # Stream transformers # -# Take in a set of options and transform a stream of new-line separated items +# Take in a set of options and transform to a stream of new-line terminated items # # Remove all items for which the given command returns false @@ -111,7 +112,7 @@ VGL_testSuffixNoneS() { # Stream consumers # -# These consume a stream of escaped new-line separated items +# These consume a stream of escaped new-line terminated items (termination is required for processing) # # Return true iff given command returns true for some item