-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1822 from Sonicadvance1/check_binfmt_misc_conflict
CMake: Check for binfmt_misc conflicts before install
- Loading branch information
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/sh | ||
for binfmt in "$@" | ||
do | ||
result=0 | ||
if command -v update-binfmts>/dev/null; then | ||
update-binfmts --find "$binfmt" 1>&- 2>&- | ||
if [ $? -eq 0 ] | ||
then | ||
# If we found the binfmt_misc file passed in then error | ||
result=1 | ||
fi | ||
fi | ||
|
||
if [ $result -eq 0 ] | ||
then | ||
if [ -f "$binfmt" ]; then | ||
# If the binfmt_misc file exists then error | ||
result=1 | ||
fi | ||
fi | ||
|
||
if [ $result -eq 1 ] | ||
then | ||
echo "===============================================================" | ||
echo "$binfmt binfmt file is installed!" | ||
echo "This conflicts with FEX-Emu's binfmt_misc!" | ||
echo "This will cause issues when running FEX-Emu through binfmt_misc" | ||
echo "Not installing until you uninstall this binfmt_misc file!" | ||
echo "===============================================================" | ||
exit 1 | ||
fi | ||
done | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters