Openbci_gui: Linux Binary - Handle Paths with Spaces

Created on 10 Nov 2020  路  8Comments  路  Source: OpenBCI/OpenBCI_GUI

Problem

The Linux build includes the shell script OpenBCI_GUI inside the zipped file. This needs a trivial modification to support extracting into a location with spaces in the path, but I don't see this file in the repository. It looks like it's being created by some dependency in the build process, so I'm just gonna submit a bug rather than try to work it out when someone else will know already what needs changing.

In the script:

#!/bin/sh

APPDIR=$(readlink -f "$0")
APPDIR=$(dirname "$APPDIR")
$APPDIR/java/bin/java -Djna.nosys=true -Djava.ext.dirs="$APPDIR/java/lib/ext"  .....  OpenBCI_GUI "$@"

simply needs to become

#!/bin/sh

APPDIR=$(readlink -f "$0")
APPDIR=$(dirname "$APPDIR")
"$APPDIR/java/bin/java" -Djna.nosys=true -Djava.ext.dirs="$APPDIR/java/lib/ext"  .....  OpenBCI_GUI "$@"

Seems to me all other appearances of $APPDIR are correctly quoted.

Operating System and Version

Linux: Ubuntu Focal AMD64

GUI Version

v 5.0.1

Running standalone app

Yes, the standalone binaries.

difficulty-medium linux priority-low

Most helpful comment

Fixed and Tested!

All 8 comments

@stellarpower Where does this script live that you mention? Can you submit a PR if you already have a fix?

I can see this in the Linux Standalone. Though, I think this is handled by Processing.

That's the thing, I didn't see it. It's in the zip folder for the release, and I'm presuing it's created by release_script/make-release.py, unless I'm just not looking hard enough. It's the same script as in #403.

That's the thing, I didn't see it. It's in the zip folder for the release, and I'm presuing it's created by release_script/make-release.py, unless I'm just not looking hard enough. It's the same script as in #403.

Precisely. I think this means it needs to be a hard-coded fix in make-release.py to edit the Linux standalone file after it is created.

Maybe an easy fix is to do regex in make-release.py for $APPDIR/java/bin/java -> "$APPDIR/java/bin/java" .

Maybe an easy fix is to do regex in make-release.py for $APPDIR/java/bin/java -> "$APPDIR/java/bin/java" .

For clarification, this regex replace would need to happen in make-release.py for Linux build only, after app is built.

Fixed and Tested!

Thank you! Sorry been absent, not had much time available for a while!

@stellarpower You can see the fix above. As tested, it fully resolves this issue.

Take Care,
RW

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Elisabeth-github picture Elisabeth-github  路  3Comments

jacobgmartin picture jacobgmartin  路  7Comments

jps2000 picture jps2000  路  6Comments

jps2000 picture jps2000  路  6Comments

Otemo picture Otemo  路  7Comments