Skip to content

Commit

Permalink
wrapGAppsHook: Correct wrapProgram invocations
Browse files Browse the repository at this point in the history
This change fixes several defects in the way `wrapGAppsHook` selected
the executable to wrap.

Previously, it would wrap any top-level files in the target `/bin` and
`/libexec` directories, including directories and non-executable
files.  In addition, it failed to wrap files in subdirectories.

Now, it uses `find` to iterate over these directory hierarchies,
selecting only executable files for wrapping.
  • Loading branch information
ahmedtd committed Apr 24, 2017
1 parent 100919a commit 8b9f153
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkgs/build-support/setup-hooks/wrap-gapps-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ wrapGAppsHook() {
done

if [ -z "$dontWrapGApps" ]; then
for i in $prefix/bin/* $prefix/libexec/*; do
echo "Wrapping app $i"
wrapProgram "$i" "${gappsWrapperArgs[@]}"
find "${prefix}/bin" "${prefix}/libexec" -type f -executable -print0 \
| while IFS= read -r -d '' file; do
echo "Wrapping program $file"
wrapProgram "$file" "${gappsWrapperArgs[@]}"
done
fi
}
Expand Down

0 comments on commit 8b9f153

Please sign in to comment.