Forráskód Böngészése

Added Core Filtering Option

RetroDriven 6 éve
szülő
commit
aadda6b5d8
1 módosított fájl, 23 hozzáadás és 10 törlés
  1. 23 10
      Scripts/Updater_RetroDriven.sh

+ 23 - 10
Scripts/Updater_RetroDriven.sh

@@ -29,15 +29,17 @@ By downloading ROM injected Core/RBF files you are agreeing to the following:
 * I take no responsibility for any data loss or anything, use the script at your own risk.
 '
 
+# v1.3 - Adjusted Script and INI File for RetroDriven Core Filtering
 # v1.2 - Removed Cores from GitHub. Adjusted script to account for this change
 # v1.0 - Changed original Script from Locutus73 as needed
 
 
 #=========   USER OPTIONS   =========
+
 #Base directory for all script’s tasks, "/media/fat" for SD root, "/media/usb0" for USB drive root.
 BASE_PATH="/media/fat"
 
-#Directories where all core categories will be downloaded.
+#Directory where RetroDriven Cores are downloaded
 declare -A CORE_CATEGORY_PATHS
 CORE_CATEGORY_PATHS["arcade-cores"]="$BASE_PATH/_RetroDriven"
 
@@ -68,12 +70,12 @@ TEMP_PATH="/tmp"
 TO_BE_DELETED_EXTENSION="to_be_deleted"
 
 echo
-echo "RetroDriven.com - Launching Soon!"
+echo "*** NEWS: RetroDriven.com - Launching Soon! ***"
 echo
 sleep 3
-echo "RetroDriven Core Updater - A Festivus for the rest of Us!" 
+echo "*** RetroDriven Core Updater - A Festivus for the rest of Us! ***" 
 echo
-sleep 5
+sleep 3
 
 #========= CODE STARTS HERE =========
 
@@ -149,10 +151,20 @@ fi
 CORE_URLS=$(curl $CURL_RETRY $SSL_SECURITY_OPTION -sLf "https://github.com/RetroDriven/MiSTer_UnofficialCores/wiki" | grep -io '\(https://retrodriven.com/Mister_Cores/[a-zA-Z0-9./_-]*\)\|\(user-content-[a-z-]*\)')
 
 
-CORE_CATEGORY="-"
+#CORE_CATEGORY="-"
 SD_INSTALLER_PATH=""
 REBOOT_NEEDED="false"
+#CORE_CATEGORIES_FILTER=""
+
+CORE_CATEGORY="zzz"
+CORE_CATEGORIES_FILTER="zzz"
+
 CORE_CATEGORIES_FILTER=""
+if [ "$REPOSITORIES_FILTER" != "" ]
+then
+	CORE_CATEGORIES_FILTER="^\($( echo "$REPOSITORIES_FILTER" | sed 's/[ 	]\{1,\}/\\)\\|\\(/g' )\)$"
+	REPOSITORIES_FILTER="\(Main_MiSTer\)\|\(Menu_MiSTer\)\|\(SD-Installer-Win64_MiSTer\)\|\($( echo "$REPOSITORIES_FILTER" | sed 's/[ 	]\{1,\}/\\)\\|\\([\/_-]/g' )\)"
+fi
 
 GOOD_CORES=""
 if [ "$GOOD_CORES_URL" != "" ]
@@ -372,8 +384,9 @@ for CORE_URL in $CORE_URLS; do
 		CORE_CATEGORY=$(echo "$CORE_URL" | sed 's/user-content-//g')
 		if [ "$CORE_CATEGORY" == "" ]
 		then
-			CORE_CATEGORY="-"
-		fi
+			CORE_CATEGORY="-" || { echo "$CORE_URL" | grep -qi "$REPOSITORIES_FILTER";  } || { echo "$CORE_CATEGORY" | grep -qi "$CORE_CATEGORIES_FILTER";}
+        fi
+
 		if [ "$CORE_CATEGORY" == "computer-cores" ]
 		then
 			CORE_CATEGORY="cores"
@@ -382,11 +395,11 @@ for CORE_URL in $CORE_URLS; do
 done
 wait
 
-echo "All RetroDriven Cores have been Updated!"
+echo "*** All RetroDriven Cores have been Updated! ***"
 echo
-echo "Please visit RetroDriven.com for all of your MiSTer and Retro News!"
+#echo "** Please visit RetroDriven.com for all of your MiSTer and Retro News and Updates! ***"
 echo
-sleep 5
+#sleep 3
 
 
 if [ $REBOOT_NEEDED == "true" ]