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