From 597cacf11214ce9e94a7f8eeda2d119622017bd7 Mon Sep 17 00:00:00 2001 From: Darren Date: Tue, 18 Sep 2012 20:02:26 -0400 Subject: [PATCH] (Pandora) allow launcher to use retroarch-zip script --- pandora/scripts/retroarch.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pandora/scripts/retroarch.sh b/pandora/scripts/retroarch.sh index 2fd9a5d2e0..4e1f807c73 100755 --- a/pandora/scripts/retroarch.sh +++ b/pandora/scripts/retroarch.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash source "$(dirname $0)/env-vars.sh" @@ -39,6 +39,12 @@ case "${BACKEND}" in ;; esac +# bit hackish, silently adds supported archive formats to file listings. +# worth noting that the pandora itself doesn't have 7z in firmware by default. +if [[ ! "${FILTER}" =~ ^Arcade ]] ; then + FILTER="${FILTER} *.zip *.rar *.7z" +fi + # try to point the file chooser at the last used path, if there is one. LASTROM= if [ -r "${BACKEND}-lastrom.txt" ] ; then @@ -52,5 +58,9 @@ ROM=$(zenity --file-selection --file-filter="${FILTER}" "${LASTROM}") echo "${ROM}" > "${BACKEND}-lastrom.txt" -exec retroarch "${ROM}" -L "${HOME}/lib/${BACKEND}" "${@}" +if [[ "${ROM}" =~ \.(zip|rar|7z)$ ]] && [[ ! "${FILTER}" =~ ^Arcade ]] ; then + source retroarch-zip "${ROM}" -L "${HOME}/lib/${BACKEND}" "${@}" +else + exec retroarch "${ROM}" -L "${HOME}/lib/${BACKEND}" "${@}" +fi