opengl: Disable pipefail to allow early out

Prior operator || and putting builtins subshells workaround didn't
work with in all build shells.
This commit is contained in:
Tyson Whitehead
2018-07-14 10:39:25 -04:00
parent 53b358b6d5
commit 04de2db1d1
2 changed files with 9 additions and 15 deletions

View File

@@ -1,6 +1,3 @@
#!/bin/bash
# Stream producers # Stream producers
# #
# These produce a stream of escaped new-line separated items # These produce a stream of escaped new-line separated items
@@ -9,22 +6,14 @@
# Stream the given arguments # Stream the given arguments
# #
VGL_sourceS() { VGL_sourceS() {
( printf '%q\n' "$@" ) || (( $? == 141 )) printf '%q\n' "$@"
}
# Stream the results of the given command
#
VGL_systemS() {
declare -a command=("$@")
( eval $(printf '%q ' "${command[@]}") ) || (( $? == 141 ))
} }
# Stream the results of find (correctly escapes all filenames) # Stream the results of find (correctly escapes all filenames)
# #
VGL_findS() { VGL_findS() {
declare -a options=("$@") file declare -a options=("$@") file
VGL_systemS find "${options[@]}" -print0 | find "${options[@]}" -print0 |
while read -d '' -r file; do while read -d '' -r file; do
VGL_sourceS "$file" VGL_sourceS "$file"
done done
@@ -34,7 +23,7 @@ VGL_findS() {
# #
VGL_elfLibsS() { VGL_elfLibsS() {
declare file=$1 line declare file=$1 line
VGL_systemS ldd "$file" | ldd "$file" |
while read line; do while read line; do
line=${line#$'\t'} line=${line#$'\t'}
case "$line" in case "$line" in
@@ -136,6 +125,9 @@ VGL_isLibGL() {
# Find all executables that depend on libGL and add a libvglfaker.so dependency # Find all executables that depend on libGL and add a libvglfaker.so dependency
# #
VGL_autoAddVGL() { VGL_autoAddVGL() {
declare opts=$(shopt -p) output
set +o pipefail
echo "Inserting VirtualGL into OpenGL executables in $prefix..." >&2 echo "Inserting VirtualGL into OpenGL executables in $prefix..." >&2
for output in $outputs; do for output in $outputs; do
@@ -155,6 +147,8 @@ VGL_autoAddVGL() {
done done
} }
done done
eval "$opts"
} }
postFixupHooks+=(VGL_autoAddVGL) postFixupHooks+=(VGL_autoAddVGL)

View File

@@ -3,7 +3,7 @@
# Add a setup hook to the mesa_noglu package that automatically adds # Add a setup hook to the mesa_noglu package that automatically adds
# a libvglfaker.so dependency to executables that depend on libGL.so. # a libvglfaker.so dependency to executables that depend on libGL.so.
{ super, lib, buildEnv, makeSetupHook, file }: { super, lib, buildEnv, makeSetupHook, file, bash }:
let let
autoVirtualGLHook = autoVirtualGLHook =