From 8b12f39ebae2f25a15f3b70b493587fe71c41a30 Mon Sep 17 00:00:00 2001 From: "T. Joseph Carter" Date: Sun, 1 Mar 2015 04:19:34 -0800 Subject: [PATCH] Make the devkit move final --- libretro-upgrade.sh | 41 +++++++++++++++++++++++++++++++++++++++++ rules.d/devkit-rules.sh | 2 -- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/libretro-upgrade.sh b/libretro-upgrade.sh index 2c62e40a..0179fa8b 100755 --- a/libretro-upgrade.sh +++ b/libretro-upgrade.sh @@ -60,6 +60,46 @@ libretro_bsnes_one_copy() { fi } +libretro_devkit_mgit_dir_0="libretro-manifest" +libretro_devkit_mgit_dir_1="libretrodb" +libretro_devkit_mgit_dir_2="libretro-dat-pull" +libretro_devkit_mgit_dir_3="libretro-common" + +libretro_move_devkit() { + if [ -d "$WORKDIR/libretrodb" ]; then + found_nothing="" + if [ -d "$WORKDIR/libretro-devkit" ]; then + echo "" + echo "=== Detected multiple copies of libretro devkit" + echo " devkit has moved to a subdir, but you have old copies installed." + echo "" + echo -n " Would you like to delete the extras? [y/N] : " + read user + if [[ "$user" = "y" || "$user" == "Y" ]]; then + echo " Removing old versions of devkit..." + rm -rf "$WORKDIR/libretro-manifest" + rm -rf "$WORKDIR/libretrodb" + rm -rf "$WORKDIR/libretro-dat-pull" + rm -rf "$WORKDIR/libretro-common" + else + echo " Retaining devkit duplicates at your request." + fi + else + echo "" + echo "=== Detected devkit installed in working directory" + echo " Found in \"$WORKDIR\"" + echo " Should be \"$WORKDIR/libretro-devkit\"" + echo "" + echo " will move it" + mkdir -p "$WORKDIR/libretro-devkit" + mv "$WORKDIR/libretro-manifest" "$WORKDIR/libretro-devkit" + mv "$WORKDIR/libretrodb" "$WORKDIR/libretro-devkit" + mv "$WORKDIR/libretro-dat-pull" "$WORKDIR/libretro-devkit" + mv "$WORKDIR/libretro-common" "$WORKDIR/libretro-devkit" + fi + fi +} + if [ -n "$1" ]; then while [ -n "$1" ]; do "$1" @@ -68,6 +108,7 @@ if [ -n "$1" ]; then else libretro_move_libretro_common libretro_bsnes_one_copy + libretro_move_devkit fi if [ -n "$found_nothing" ]; then echo "Nothing to upgrade." diff --git a/rules.d/devkit-rules.sh b/rules.d/devkit-rules.sh index a9eb3f74..cc798854 100644 --- a/rules.d/devkit-rules.sh +++ b/rules.d/devkit-rules.sh @@ -1,8 +1,6 @@ # vim: set ts=3 sw=3 noet ft=sh : bash libretro_devkit_name="libretro Developer's Kit" -# FIXME: Twinaphex, uncomment next line for libretro-super/libretrodb etc or delete, your choice -#libretro_devkit_dir="." libretro_devkit_fetch_rule=multi_git libretro_devkit_mgit_urls=4 libretro_devkit_mgit_dir_0="libretro-manifest"