From fe7f43155a4382ebfb81102908f8b45104d72bb7 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 5 Mar 2013 15:04:17 +0100 Subject: [PATCH] Use the dowload script of prebuilt-cef. --- Rakefile | 8 +--- prebuilt-cef | 2 +- script/download_cef | 91 --------------------------------------------- 3 files changed, 3 insertions(+), 98 deletions(-) delete mode 100755 script/download_cef diff --git a/Rakefile b/Rakefile index fa4acf85a..8e07e69e0 100644 --- a/Rakefile +++ b/Rakefile @@ -20,9 +20,7 @@ end desc "Update CEF to the latest version specified by the prebuilt-cef submodule" task "update-cef" => "bootstrap" do - # TODO Use prebuilt-cef's script after https://github.com/github/prebuilt-cef/pull/2 is merged. - # exit 1 unless system %{prebuilt-cef/script/download -b 1410 -r 1107 -d https://gh-contractor-zcbenz.s3.amazonaws.com/cefode/prebuilt-cef -f cef} - exit 1 unless system %{script/download_cef -b 1410 -r 1107 -d https://gh-contractor-zcbenz.s3.amazonaws.com/cefode/prebuilt-cef -f cef} + exit 1 unless system %{prebuilt-cef/script/download -b 1410 -r 1107 -d https://gh-contractor-zcbenz.s3.amazonaws.com/cefode/prebuilt-cef -f cef} Dir.glob('cef/*.gypi').each do |filename| `sed -i '' -e "s/'include\\//'cef\\/include\\//" -e "s/'libcef_dll\\//'cef\\/libcef_dll\\//" #{filename}` end @@ -30,9 +28,7 @@ end desc "Download debug symbols for CEF" task "download-cef-symbols" => "update-cef" do - # TODO Use prebuilt-cef's script after https://github.com/github/prebuilt-cef/pull/2 is merged. - # sh %{prebuilt-cef/script/download -b 1410 -r 1107 -d https://gh-contractor-zcbenz.s3.amazonaws.com/cefode/prebuilt-cef -s cef} - sh %{script/download_cef -b 1410 -r 1107 -d https://gh-contractor-zcbenz.s3.amazonaws.com/cefode/prebuilt-cef -s cef} + sh %{prebuilt-cef/script/download -b 1410 -r 1107 -d https://gh-contractor-zcbenz.s3.amazonaws.com/cefode/prebuilt-cef -s cef} end task "bootstrap" do diff --git a/prebuilt-cef b/prebuilt-cef index c24e35c3e..59d147be2 160000 --- a/prebuilt-cef +++ b/prebuilt-cef @@ -1 +1 @@ -Subproject commit c24e35c3ed60952f9e3ed6b3a73e17f0714d147b +Subproject commit 59d147be26fc404ed0522729e363a324bff98b66 diff --git a/script/download_cef b/script/download_cef deleted file mode 100755 index 5ba36bb92..000000000 --- a/script/download_cef +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/sh -#/ Usage: download [-f] [-s] [-b cef-branch] [-r cef-revision] [-d url/to/prebuilt/cef] path/for/extraction -#/ Download and extract prebuilt CEF. -#/ -#/ Options: -#/ -f Overwrite path/for/extraction if it already exists. -#/ -s Download debugging symbols as well. -#/ -b CEF branch. -#/ -r CEF revision. -#/ -d Where to download binaries. -#/ -h Show this message. - -set -e - -usage() { - grep '^#/' <"$0"| cut -c4- -} - -DISTURL="https://github-janky-artifacts.s3.amazonaws.com/prebuilt-cef" - -while getopts ":fsb:r:d:h" OPTION; do - case ${OPTION} in - f) - FORCE=1 - ;; - s) - SYMBOLS=1 - ;; - b) - CEF_BRANCH=${OPTARG} - ;; - r) - CEF_REVISION=${OPTARG} - ;; - d) - DISTURL=${OPTARG} - ;; - h) - usage - exit 0 - ;; - ?) - echo "Unknown option -${OPTARG}" - usage - exit 1 - ;; - esac -done - -shift $((OPTIND-1)) - -if [ -z "${1}" ]; then - usage - exit 1 -fi - -if [ "$(uname)" = "Darwin" ]; then - OS_TYPE=macosx -else - OS_TYPE=linux -fi -CEF_BASENAME="cef_binary_3.${CEF_BRANCH}.${CEF_REVISION}_${OS_TYPE}" -CEF_SYMBOLS_BASENAME="${CEF_BASENAME}_symbols" - -TEMP_DIR=$(mktemp -d -t prebuilt-cef-download.XXXXXX) -trap "rm -rf \"${TEMP_DIR}\"" EXIT - -# See if we've already downloaded this version. -grep -E "^CEF Version:[[:space:]]+3\.${CEF_BRANCH}\.${CEF_REVISION}$" "${1}/README.txt" >/dev/null 2>&1 || { - if [ -e "${1}" ] && [ "${FORCE}" != "1" ]; then - echo >&2 "Error: ${1} already exists. Pass -f if you want to overwrite it." - exit 1 - fi - - rm -rf "${1}" - mkdir -p "${1}" - - echo "Downloading/extracting CEF3 branch ${CEF_BRANCH} r${CEF_REVISION}..." - curl --progress-bar "${DISTURL}/${CEF_BASENAME}.zip" > "${TEMP_DIR}/cef.zip" - unzip -q "${TEMP_DIR}/cef.zip" -d "${TEMP_DIR}" - mv "${TEMP_DIR}/${CEF_BASENAME}"/* "${1}" -} - -if [ "${SYMBOLS}" != "1" ]; then - exit 0 -fi - -echo "Downloading/extracting symbols for CEF3 branch ${CEF_BRANCH} r${CEF_REVISION}..." -curl --progress-bar "${DISTURL}/${CEF_SYMBOLS_BASENAME}.zip" > "${TEMP_DIR}/symbols.zip" -unzip -q "${TEMP_DIR}/symbols.zip" -d "${TEMP_DIR}" -mv "${TEMP_DIR}/${CEF_SYMBOLS_BASENAME}"/* "${1}/Release"