From b2f897a4786c6767dc343d2eab41af42be0e48eb Mon Sep 17 00:00:00 2001 From: joshcangit <33022160+joshcangit@users.noreply.github.com> Date: Sun, 26 Jan 2020 11:00:06 +0000 Subject: [PATCH 1/5] Slight improvements to run.sh --- run.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/run.sh b/run.sh index 2d5f026..6c3bf34 100755 --- a/run.sh +++ b/run.sh @@ -1,5 +1,5 @@ -#! /bin/bash +#!/bin/sh -BASEDIR=$(dirname $0) +BASEDIR="$(dirname $(realpath $(readlink -f $0)))" $BASEDIR/latest/chrome --user-data-dir="$BASEDIR/user-data-dir" $* &> /dev/null & From 25c5564230f4bba898f591416ef7f6dd83bdde04 Mon Sep 17 00:00:00 2001 From: joshcangit <33022160+joshcangit@users.noreply.github.com> Date: Sun, 26 Jan 2020 11:01:31 +0000 Subject: [PATCH 2/5] Sight improvements to update-and-run.sh --- update-and-run.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/update-and-run.sh b/update-and-run.sh index 93673ed..cbff49e 100755 --- a/update-and-run.sh +++ b/update-and-run.sh @@ -1,3 +1,5 @@ -#! /bin/bash -cd $(dirname $0) -./update.sh && ./run.sh +#!/bin/sh + +BASEDIR="$(dirname $(realpath $(readlink -f $0)))" + +$BASEDIR/update.sh && $BASEDIR/run.sh From a181c14e2ace546d1d82af6196de3a42304fee05 Mon Sep 17 00:00:00 2001 From: joshcangit <33022160+joshcangit@users.noreply.github.com> Date: Sun, 26 Jan 2020 11:08:02 +0000 Subject: [PATCH 3/5] Improvements to update.sh Improvement include - Using sh instead of bash - Supporting either curl or wget - An argument to select snapshots or continuous builds while defaulting to continuous builds - Rename and symlink the "chrome-linux" folder --- update.sh | 64 ++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 47 insertions(+), 17 deletions(-) diff --git a/update.sh b/update.sh index 6730185..86a6bbd 100755 --- a/update.sh +++ b/update.sh @@ -1,31 +1,61 @@ -#! /bin/bash - -cd $(dirname $0) +#!/bin/sh + +BASEDIR="$(dirname $(realpath $(readlink -f $0)))" + +web() { +local list="wget curl" +for item in $list; +do + if [ -z $(command -v $item) ]; then + echo $list | sed "s/$item//g" + fi +done +} + +dl() { +case $(web) in + *wget*) wget -q --show-progress -O $@;; + *curl*) curl -#L -o $@;; +esac +} + +out() { +case $(web) in + *curl*) curl -sL $@;; + *wget*) wget -qO - $@;; +esac +} + +TRUNK="continuous" +if [ -n "$1" ]; then +OPT="$1" +shift +case "$OPT" in + snapshots|s) TRUNK="snapshots";; + continuous|c) TRUNK="continuous";; +esac +fi -LASTCHANGE_URL="https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Linux_x64%2FLAST_CHANGE?alt=media" +LASTCHANGE_URL="https://commondatastorage.googleapis.com/chromium-browser-$TRUNK/Linux/LAST_CHANGE" -REVISION=$(curl -s -S $LASTCHANGE_URL) +REVISION=$(out $LASTCHANGE_URL) echo "latest revision is $REVISION" -if [ -d $REVISION ] ; then +if [ -d $BASEDIR/$REVISION ] ; then echo "already have latest version" exit fi -ZIP_URL="https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Linux_x64%2F$REVISION%2Fchrome-linux.zip?alt=media" +ZIP_URL="https://www.googleapis.com/download/storage/v1/b/chromium-browser-$TRUNK/o/Linux_x64%2F$REVISION%2Fchrome-linux.zip?alt=media" -ZIP_FILE="${REVISION}-chrome-linux.zip" +ZIP_FILE="chrome-linux-${REVISION}.zip" echo "fetching $ZIP_URL" -rm -rf $REVISION -mkdir $REVISION -pushd $REVISION -curl -# $ZIP_URL > $ZIP_FILE +dl "$BASEDIR/$ZIP_FILE" "$ZIP_URL" echo "unzipping.." -unzip $ZIP_FILE -popd -rm -f ./latest -ln -s $REVISION/chrome-linux/ ./latest - +unzip "$BASEDIR/$ZIP_FILE" -d "$BASEDIR" +mv "$BASEDIR/chrome-linux" "$BASEDIR/$REVISION" +rm -f "$BASEDIR/latest" "$BASEDIR/$ZIP_FILE" +ln -s "$BASEDIR/$REVISION" "$BASEDIR/latest" From fb548f8376395e6d002862e3ace150c94367fb08 Mon Sep 17 00:00:00 2001 From: joshcangit <33022160+joshcangit@users.noreply.github.com> Date: Mon, 29 Jun 2020 00:57:40 +0000 Subject: [PATCH 4/5] Default to snapshots Code now defaults to the snapshots trunk. --- update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update.sh b/update.sh index 86a6bbd..9ba1d85 100755 --- a/update.sh +++ b/update.sh @@ -26,7 +26,7 @@ case $(web) in esac } -TRUNK="continuous" +TRUNK="snapshots" if [ -n "$1" ]; then OPT="$1" shift From 8312635819ad530468086c48744ba2e666215046 Mon Sep 17 00:00:00 2001 From: joshcangit <33022160+joshcangit@users.noreply.github.com> Date: Mon, 1 Nov 2021 21:59:40 +0800 Subject: [PATCH 5/5] Update LAST_CHANGE URL Previous LAST_CHANGE URL no longer works with this script. --- update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update.sh b/update.sh index 9ba1d85..a6cb36c 100755 --- a/update.sh +++ b/update.sh @@ -36,7 +36,7 @@ case "$OPT" in esac fi -LASTCHANGE_URL="https://commondatastorage.googleapis.com/chromium-browser-$TRUNK/Linux/LAST_CHANGE" +LASTCHANGE_URL="https://www.googleapis.com/download/storage/v1/b/chromium-browser-$TRUNK/o/Linux_x64%2FLAST_CHANGE?alt=media" REVISION=$(out $LASTCHANGE_URL)