Skip to content

Commit

Permalink
cosmetic - script files contain mix of spaces/tabs indentation and tr…
Browse files Browse the repository at this point in the history
…ailing whitespace. convert tabs->spaces and strip trailing whitespace
  • Loading branch information
joolswills committed Jul 12, 2014
1 parent 0dd4c27 commit 5ce5f33
Show file tree
Hide file tree
Showing 11 changed files with 391 additions and 391 deletions.
74 changes: 37 additions & 37 deletions retropie_packages.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
#!/usr/bin/env bash

#
#
# (c) Copyright 2012-2014 Florian Müller ([email protected])
#
#
# RetroPie-Setup homepage: https://github.com/petrockblog/RetroPie-Setup
#
#
# Permission to use, copy, modify and distribute this work in both binary and
# source form, for non-commercial purposes, is hereby granted without fee,
# providing that this license information and copyright notice appear with
# all copies and any derived work.
#
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event shall the authors be held liable for any damages
# arising from the use of this software.
#
#
# RetroPie-Setup is freeware for PERSONAL USE only. Commercial users should
# seek permission of the copyright holders first. Commercial use includes
# charging money for RetroPie-Setup or software derived from RetroPie-Setup.
#
#
# The copyright holders request that bug fixes and improvements to the code
# should be forwarded to them so everyone can benefit from the modifications
# in future versions.
#
#
# Many, many thanks go to all people that provide the individual packages!!!
#
#

# global variables ==========================================================

Expand Down Expand Up @@ -78,7 +78,7 @@ function getScriptAbsoluteDir() {
fi
}

function import() {
function import() {
# @description importer routine to get external functionality.
# @description the first location searched is the script directory.
# @description if not found, search the module in the paths contained in $SHELL_LIBRARY_PATH environment variable
Expand Down Expand Up @@ -158,7 +158,7 @@ function rps_checkNeededPackages() {
fi
else
echo "Found needed packages 'git' and 'dialog'."
fi
fi
}

function rps_availFreeDiskSpace() {
Expand All @@ -177,32 +177,32 @@ function rps_availFreeDiskSpace() {

# params: $1=ID, $2=description, $3=sources, $4=build, $5=install, $6=configure, $7=package
function rp_registerFunction() {
__cmdid+=($1)
__description[$1]=$2
__cmdid+=($1)
__description[$1]=$2
__dependencies[$1]=$3
__sources[$1]=$4
__build[$1]=$5
__install[$1]=$6
__configure[$1]=$7
__package[$1]=$8
__sources[$1]=$4
__build[$1]=$5
__install[$1]=$6
__configure[$1]=$7
__package[$1]=$8
}

function rp_listFunctions() {
local id
local id

echo -e "Command-ID: Description:\tList of available actions [sources|build|install|configure|package]"
echo "--------------------------------------------------"
for (( i = 0; i < ${#__cmdid[@]}; i++ )); do
id=${__cmdid[$i]};
echo -e "$id:\t${__description[$id]}:\t\c"
for (( i = 0; i < ${#__cmdid[@]}; i++ )); do
id=${__cmdid[$i]};
echo -e "$id:\t${__description[$id]}:\t\c"
fn_exists ${__dependencies[$id]} && echo -e "dependencies \c"
fn_exists ${__sources[$id]} && echo -e "sources \c"
fn_exists ${__build[$id]} && echo -e "build \c"
fn_exists ${__install[$id]} && echo -e "install \c"
fn_exists ${__configure[$id]} && echo -e "configure \c"
fn_exists ${__package[$id]} && echo -e "package \c"
echo ""
done
fn_exists ${__build[$id]} && echo -e "build \c"
fn_exists ${__install[$id]} && echo -e "install \c"
fn_exists ${__configure[$id]} && echo -e "configure \c"
fn_exists ${__package[$id]} && echo -e "package \c"
echo ""
done
echo "=================================================="
}

Expand All @@ -220,7 +220,7 @@ rps_checkNeededPackages
if [ $(id -u) -ne 0 ]; then
printf "Script must be run as root. Try 'sudo ./retropackages'\n"
exit 1
fi
fi

scriptdir=`dirname $0`
scriptdir=`cd $scriptdir && pwd`
Expand Down Expand Up @@ -314,10 +314,10 @@ rp_registerFunction "319" "Auto-start EmulationStation " ""
rp_registerFunction "320" "Install XBox contr. 360 driver " "" "" "" "set_install_xboxdrv" "" ""
rp_registerFunction "321" "Install PS3 controller driver " "" "" "" "set_installps3controller" "" ""
rp_registerFunction "322" "Register RetroArch controller " "" "" "" "set_RetroarchJoyconfig" "" ""
rp_registerFunction "323" "Install SDL 2.0.1 binaries " "" "" "" "install_libsdlbinaries" "" ""
rp_registerFunction "324" "Configure audio settings " "" "" "" "" "configure_audiosettings" ""
rp_registerFunction "325" "ES-Config " "" "" "" "install_esconfig" "configure_esconfig" ""
rp_registerFunction "326" "Gamecon driver " "" "" "" "install_gamecondriver" "configure_gamecondriver" ""
rp_registerFunction "323" "Install SDL 2.0.1 binaries " "" "" "" "install_libsdlbinaries" "" ""
rp_registerFunction "324" "Configure audio settings " "" "" "" "" "configure_audiosettings" ""
rp_registerFunction "325" "ES-Config " "" "" "" "install_esconfig" "configure_esconfig" ""
rp_registerFunction "326" "Gamecon driver " "" "" "" "install_gamecondriver" "configure_gamecondriver" ""

# TODO python scripts (es-config)

Expand All @@ -328,13 +328,13 @@ rp_registerFunction "326" "Gamecon driver " ""
# ID mode
if [[ $# -eq 1 ]]; then
ensureRootdirExists
id=$1
id=$1
fn_exists ${__dependencies[$id]} && ${__dependencies[$id]}
fn_exists ${__sources[$id]} && ${__sources[$id]}
fn_exists ${__build[$id]} && ${__build[$id]}
fn_exists ${__install[$id]} && ${__install[$id]}
fn_exists ${__configure[$id]} && ${__configure[$id]}
# fn_exists ${__package[$id]} && ${__package[$id]} packages are not built automatically
fn_exists ${__build[$id]} && ${__build[$id]}
fn_exists ${__install[$id]} && ${__install[$id]}
fn_exists ${__configure[$id]} && ${__configure[$id]}
# fn_exists ${__package[$id]} && ${__package[$id]} packages are not built automatically
elif [[ $# -eq 2 ]]; then
ensureRootdirExists
id=$1
Expand Down
62 changes: 31 additions & 31 deletions retropie_setup.sh
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
#!/usr/bin/env bash

# RetroPie-Setup - Shell script for initializing Raspberry Pi
# with RetroArch, various cores, and EmulationStation (a graphical
# RetroPie-Setup - Shell script for initializing Raspberry Pi
# with RetroArch, various cores, and EmulationStation (a graphical
# front end).
#
#
# (c) Copyright 2012-2014 Florian Müller ([email protected])
#
#
# RetroPie-Setup homepage: https://github.com/petrockblog/RetroPie-Setup
#
#
# Permission to use, copy, modify and distribute RetroPie-Setup in both binary and
# source form, for non-commercial purposes, is hereby granted without fee,
# providing that this license information and copyright notice appear with
# all copies and any derived work.
#
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event shall the authors be held liable for any damages
# arising from the use of this software.
#
#
# RetroPie-Setup is freeware for PERSONAL USE only. Commercial users should
# seek permission of the copyright holders first. Commercial use includes
# charging money for RetroPie-Setup or software derived from RetroPie-Setup.
#
#
# The copyright holders request that bug fixes and improvements to the code
# should be forwarded to them so everyone can benefit from the modifications
# in future versions.
#
#
# Many, many thanks go to all people that provide the individual packages!!!
#
#
# Raspberry Pi is a trademark of the Raspberry Pi Foundation.
#
#

function getScriptAbsoluteDir() {
# @description used to get the script path
Expand All @@ -45,7 +45,7 @@ function getScriptAbsoluteDir() {
fi
}

function import() {
function import() {
# @description importer routine to get external functionality.
# @description the first location searched is the script directory.
# @description if not found, search the module in the paths contained in $SHELL_LIBRARY_PATH environment variable
Expand Down Expand Up @@ -98,10 +98,10 @@ function import() {
}

function initImport() {
script_invoke_path="$0"
script_name=`basename "$0"`
getScriptAbsoluteDir "$script_invoke_path"
script_absolute_dir=$RESULT
script_invoke_path="$0"
script_name=`basename "$0"`
getScriptAbsoluteDir "$script_invoke_path"
script_absolute_dir=$RESULT
}

function rps_checkNeededPackages() {
Expand All @@ -117,7 +117,7 @@ function rps_checkNeededPackages() {
fi
else
echo "Found needed packages 'git' and 'dialog'."
fi
fi
}

function rps_availFreeDiskSpace() {
Expand All @@ -135,16 +135,16 @@ function rps_availFreeDiskSpace() {
}

function checkForLogDirectory() {
# make sure that RetroPie-Setup log directory exists
if [[ ! -d $scriptdir/logs ]]; then
mkdir -p "$scriptdir/logs"
chown $user "$scriptdir/logs"
chgrp $user "$scriptdir/logs"
if [[ ! -d $scriptdir/logs ]]; then
echo "Couldn't make directory $scriptdir/logs"
exit 1
fi
fi
# make sure that RetroPie-Setup log directory exists
if [[ ! -d $scriptdir/logs ]]; then
mkdir -p "$scriptdir/logs"
chown $user "$scriptdir/logs"
chgrp $user "$scriptdir/logs"
if [[ ! -d $scriptdir/logs ]]; then
echo "Couldn't make directory $scriptdir/logs"
exit 1
fi
fi
}

# =============================================================
Expand All @@ -162,14 +162,14 @@ rootdir=/opt/retropie
homedir="$home/RetroPie"
romdir="$homedir/roms"
if [[ ! -d $romdir ]]; then
mkdir $romdir
mkdir $romdir
fi

# check, if sudo is used
if [ $(id -u) -ne 0 ]; then
printf "Script must be run as root. Try 'sudo ./retropackages'\n"
exit 1
fi
fi

scriptdir=`dirname $0`
scriptdir=`cd $scriptdir && pwd`
Expand All @@ -185,7 +185,7 @@ rps_checkNeededPackages

# make sure that enough space is available
if [[ ! -d $rootdir ]]; then
mkdir -p $rootdir
mkdir -p $rootdir
fi
rps_availFreeDiskSpace 800000

Expand All @@ -197,7 +197,7 @@ while true; do
4 "UPDATE RetroPie Setup script"
5 "UPDATE RetroPie Binaries"
7 "Perform REBOOT" )
choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
if [ "$choices" != "" ]; then
case $choices in
1) rps_main_binaries ;;
Expand Down
Loading

0 comments on commit 5ce5f33

Please sign in to comment.