From afb0bab33c37d99fb0227bf365e089f00084d803 Mon Sep 17 00:00:00 2001 From: "T. Joseph Carter" Date: Sun, 5 Apr 2015 22:47:49 -0700 Subject: [PATCH] The stuff that would've broken libretro-fetch.sh --- script-modules/modules.sh | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/script-modules/modules.sh b/script-modules/modules.sh index e251bc9d..9c947da4 100644 --- a/script-modules/modules.sh +++ b/script-modules/modules.sh @@ -22,7 +22,8 @@ register_module() { build_plats="${build_plats#,}" skip_plats="${skip_plats#,}" - eval "libretro_${mod_type}s=\"\$libretro_${mod_type}s $mod_name:${build_plats:-any}:$skip_plats\"" + eval "libretro_${mod_type}s=\"\$libretro_${mod_type}s $mod_name:${build_plats:=any}:$skip_plats\"" + libretro_modules="$libretro_modules $mod_name:$build_plats:$skip_plats" else echo "register_module:Trying to register a $mod_type without a name" exit 1 @@ -40,9 +41,11 @@ register_core() { } can_build_module() { + [ -n "$force" ] && return 0 + if [[ "$1" != *:*:* ]]; then - # Not in :: format, assume developer mode - return 0 + # Not in :: format, assume error + return 1 fi build_plats="${1#*:}" @@ -64,3 +67,14 @@ can_build_module() { return 0 } + +find_module() { + needle="$1" + shift + + for haystack in $@; do + if [[ "$needle" == $haystack:* ]]; then + echo "$needle" + fi + done +}