mirror of
https://github.com/libretro/libretro-super
synced 2025-03-14 04:18:40 +00:00
Merge 4aeeaa9cbd7dfb00bec5105b7910742052f76141 into 8a019b0c9c6b1ee8c8abbdcd910e5b6d745cb6c9
This commit is contained in:
commit
f58edb87bc
@ -28,6 +28,30 @@ fi
|
||||
. "$BASE_DIR/rules.d/lutro-rules.sh"
|
||||
. "$BASE_DIR/build-config.sh"
|
||||
|
||||
|
||||
summary_fetch() {
|
||||
# fmt is external and may not be available
|
||||
fmt_output="$(find_tool "fmt")"
|
||||
local num_success="$(numwords $fetch_success)"
|
||||
local fmt_success="${fmt_output:+$(echo " $fetch_success" | $fmt_output)}"
|
||||
local num_fail="$(numwords $fetch_fail)"
|
||||
local fmt_fail="${fmt_output:+$(echo " $fetch_fail" | $fmt_output)}"
|
||||
|
||||
if [[ -z "$fetch_success" && -z "$fetch_fail" ]]; then
|
||||
secho "No fetch actions performed."
|
||||
return
|
||||
fi
|
||||
|
||||
if [ -n "$fetch_success" ]; then
|
||||
secho "$(color 32)$num_success core(s)$(color) successfully processed:"
|
||||
secho "$fmt_success"
|
||||
fi
|
||||
if [ -n "$fetch_fail" ]; then
|
||||
secho "$(color 31)$num_fail core(s)$(color) failed:"
|
||||
secho "$fmt_fail"
|
||||
fi
|
||||
}
|
||||
|
||||
# libretro_fetch: Download the given core using its fetch rules
|
||||
#
|
||||
# $1 Name of the core to fetch
|
||||
@ -66,6 +90,10 @@ libretro_fetch() {
|
||||
# TODO: Don't depend on fetch_rule being git
|
||||
echo "Fetching ${1}..."
|
||||
fetch_git "$git_url" "$module_dir" "$git_submodules"
|
||||
if [ $? -ne 0 ]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
;;
|
||||
|
||||
*)
|
||||
@ -78,6 +106,9 @@ libretro_fetch() {
|
||||
if [ -n "$post_fetch_cmd" ]; then
|
||||
echo_cmd "cd \"$WORKDIR/$module_dir\""
|
||||
echo_cmd "$post_fetch_cmd"
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
@ -126,4 +157,10 @@ done
|
||||
|
||||
for a in $fetch_cores; do
|
||||
libretro_fetch "${a%%:*}"
|
||||
if [ $? -eq 0 ]; then
|
||||
export fetch_success="$fetch_success$a "
|
||||
else
|
||||
export fetch_fail="$fetch_fail$a "
|
||||
fi
|
||||
done
|
||||
summary_fetch
|
||||
|
@ -1822,6 +1822,12 @@ include_core_vidtest() {
|
||||
libretro_vidtest_name="vidtest"
|
||||
libretro_vidtest_git_url="https://github.com/schellingb/vidtest_libretro.git"
|
||||
|
||||
include_core_dice() {
|
||||
register_module core "dice"
|
||||
}
|
||||
libretro_dice_name="dice"
|
||||
libretro_dice_git_url="https://github.com/mittonk/dice-libretro.git"
|
||||
|
||||
|
||||
# CORE RULE VARIABLES
|
||||
#
|
||||
|
@ -14,18 +14,31 @@ fetch_git() {
|
||||
if [ -d "$fetch_dir/.git" ]; then
|
||||
echo_cmd "cd \"$fetch_dir\""
|
||||
echo_cmd "git pull"
|
||||
if [ $? -ne 0 ]; then
|
||||
return 1
|
||||
fi
|
||||
if [ "$3" = "yes" ]; then
|
||||
echo_cmd "git submodule foreach git pull origin master"
|
||||
if [ $? -ne 0 ]; then
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
else
|
||||
clone_type=
|
||||
[ -n "$SHALLOW_CLONE" ] && depth="--depth 1 "
|
||||
echo_cmd "git clone $depth\"$1\" \"$WORKDIR/$2\""
|
||||
if [ $? -ne 0 ]; then
|
||||
return 1
|
||||
fi
|
||||
if [[ "$3" = "yes" || "$3" = "clone" ]]; then
|
||||
echo_cmd "cd \"$fetch_dir\""
|
||||
echo_cmd "git submodule update --init --recursive"
|
||||
if [ $? -ne 0 ]; then
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
return $?
|
||||
}
|
||||
|
||||
# fetch_revision_git: Output the hash of the last commit in a git repository
|
||||
|
Loading…
x
Reference in New Issue
Block a user