Skip to content

Commit 4f6b57c

Browse files
committed
[sb2] Check if default mode for target exists, error out earlier
Doing so exits with a clearer error message then errors about sb2d failing to start later such as these: Runtime-Error loading /tmp/sb2-bidar-20240329-145433.AwoNRb/lua_scripts/init.lua (...dar-20240329-145433.AwoNRb/lua_scripts/argvenvp_misc.lua:28: bad argument #1 to 'files' (/tmp/sb2-bidar-20240329-145433.AwoNRb/wrappers.sdk-build: No such file or directory)) sb2: Error: startup of sb2d failed. Tested-by: Björn Bidar <bjorn.bidar@jolla.com>
1 parent e355548 commit 4f6b57c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

utils/sb2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,10 @@ load_configuration()
233233
exit_error "Cannot access target root '$SBOX_TARGET_ROOT', aborting."
234234
fi
235235

236+
if [ ! -d "$SBOX_DIR/share/scratchbox2/modes/$SBOX_MAPMODE" ]; then
237+
exit_error "Configure mode doesn't '$SBOX_MAPMODE' for target doesn't exist, aborting."
238+
fi
239+
236240
LD_LIBRARY_PATH=$saved_LD_LIBRARY_PATH
237241

238242
# resolve possible symlinks in SBOX_TARGET_ROOT and SBOX_TOOLS_ROOT

0 commit comments

Comments
 (0)