Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix/quote path to vdpm #49

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions bootstrap-vitasdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,21 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

INSTALLDIR="${VITASDK:-/usr/local/vitasdk}"

. $DIR/include/install-vitasdk.sh
fallback_fail() {
echo "FAIL: removing $INSTALLDIR"
sudo rm -rf $INSTALLDIR
exit 1
}

. "$DIR/include/install-vitasdk.sh"

if [ -d "$INSTALLDIR" ]; then
echo "$INSTALLDIR already exists. Remove it first (e.g. 'sudo rm -rf $INSTALLDIR' or 'rm -rf $INSTALLDIR') and then restart this script"
exit 1
fi

echo "==> Installing vitasdk to $INSTALLDIR"
install_vitasdk $INSTALLDIR
install_vitasdk $INSTALLDIR || fallback_fail

echo "Please add the following to the bottom of your .bashrc:"
printf "\033[0;36m""export VITASDK=${INSTALLDIR}""\033[0m\n"
Expand Down
2 changes: 1 addition & 1 deletion include/install-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

b() {
$DIR/../vdpm $1
"$DIR/../vdpm" $1
}

install_packages() {
Expand Down
17 changes: 9 additions & 8 deletions include/install-vitasdk.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -e

get_download_link () {
curl -sL https://github.com/vitasdk/vita-headers/raw/master/.travis.d/last_built_toolchain.py | python - $@
Expand All @@ -9,9 +10,9 @@ install_vitasdk () {

case "$(uname -s)" in
Darwin*)
mkdir -p $INSTALLDIR
wget -O "vitasdk-nightly.tar.bz2" "$(get_download_link master osx)"
tar xf "vitasdk-nightly.tar.bz2" -C $INSTALLDIR --strip-components=1
mkdir -p $INSTALLDIR &&
wget -O "vitasdk-nightly.tar.bz2" "$(get_download_link master osx)" &&
tar xf "vitasdk-nightly.tar.bz2" -C $INSTALLDIR --strip-components=1 &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why add &&?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also it's possible to pipe wget into tar and avoid a temporary .tar.bz file on disk
wget -O- ... | tar x -C ...

rm -f "vitasdk-nightly.tar.bz2"
;;

Expand All @@ -23,16 +24,16 @@ install_vitasdk () {
sudo mkdir -p $INSTALLDIR
sudo chown $USER:$(id -gn $USER) $INSTALLDIR
fi
wget -O "vitasdk-nightly.tar.bz2" "$(get_download_link master linux)"
tar xf "vitasdk-nightly.tar.bz2" -C $INSTALLDIR --strip-components=1
wget -O "vitasdk-nightly.tar.bz2" "$(get_download_link master linux)" &&
tar xf "vitasdk-nightly.tar.bz2" -C $INSTALLDIR --strip-components=1 &&
rm -f "vitasdk-nightly.tar.bz2"
;;

MSYS*|MINGW64*)
UNIX=false
mkdir -p $INSTALLDIR
wget -O "vitasdk-nightly.tar.bz2" "$(get_download_link master win)"
tar xf "vitasdk-nightly.tar.bz2" -C $INSTALLDIR --strip-components=1
mkdir -p $INSTALLDIR &&
wget -O "vitasdk-nightly.tar.bz2" "$(get_download_link master win)" &&
tar xf "vitasdk-nightly.tar.bz2" -C $INSTALLDIR --strip-components=1 &&
rm -f "vitasdk-nightly.tar.bz2"
;;

Expand Down
2 changes: 1 addition & 1 deletion install-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ set -e

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

. $DIR/include/install-packages.sh
. "$DIR/include/install-packages.sh"

install_packages
4 changes: 2 additions & 2 deletions vitasdk-update
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ if [ -z "$VITASDK" ]; then
exit 1
fi

. $DIR/include/install-vitasdk.sh
. $DIR/include/install-packages.sh
. "$DIR/include/install-vitasdk.sh"
. "$DIR/include/install-packages.sh"

echo "==> Updating vitasdk"
install_vitasdk $VITASDK
Expand Down