diff --git a/libretro-build.sh b/libretro-build.sh index 9d733bce..f1f64871 100755 --- a/libretro-build.sh +++ b/libretro-build.sh @@ -180,17 +180,24 @@ fi if [ -n "$1" ]; then while [ -n "$1" ]; do case "$1" in - build_libretro_*) - # "Old"-style - $1 + --nologs) + LIBRETRO_LOG_SUPER="" + LIBRETRO_LOG_CORE="" ;; *) # New style (just generic cores for now) - libretro_build_core $1 + want_cores="$want_cores $1" ;; esac shift done +fi + +libretro_log_init +if [ -n "$want_cores" ]; then + for core in $want_cores; do + libretro_build_core $core + done else build_default_cores fi diff --git a/script-modules/log.sh b/script-modules/log.sh index a7b802f4..d4472b77 100644 --- a/script-modules/log.sh +++ b/script-modules/log.sh @@ -14,14 +14,23 @@ lecho() { LIBRETRO_LOG_DIR="${LIBRETRO_LOG_DIR:-$WORKDIR/log}" LIBRETRO_LOG_CORE="${LIBRETRO_LOG_CORE:-%s.log}" LIBRETRO_LOG_SUPER="${LIBRETRO_LOG_SUPER:-libretro-super.log}" -if [ -n "$LIBRETRO_LOG_SUPER" ]; then - log_super="$LIBRETRO_LOG_DIR/$LIBRETRO_LOG_SUPER" - [ -z "$LIBRETRO_LOG_APPEND" ] && : > $log_super -fi -# Core log can't be handled here -mkdir -p "$LIBRETRO_LOG_DIR" +libretro_log_init() { + if [ -z "$LIBRETRO_LOG_SUPER" -a -z "$LIBRETRO_LOG_CORE" ]; then + return + fi + if [ -n "$LIBRETRO_LOG_SUPER" ]; then + log_super="$LIBRETRO_LOG_DIR/$LIBRETRO_LOG_SUPER" + [ -z "$LIBRETRO_LOG_APPEND" ] && : > $log_super + fi + # Core log can't be truncated here + + mkdir -p "$LIBRETRO_LOG_DIR" + +} + +# TODO: Move this into libretro_log_init once libretro-fetch is fixed if [[ -n $FORCE_COLOR || -t 1 && -z "$NO_COLOR" ]]; then want_color=1 use_color=1