Add format_binary_url.sh (#1331)

This commit is contained in:
hillsp
2016-12-06 13:16:29 -05:00
committed by GitHub
parent 4d728fc081
commit 7f225e2e70
4 changed files with 28 additions and 3 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
In a release this file would contain the URL to download the pre-compiled PSOL In a release this file would contain the URL to download the pre-compiled PSOL
binary, but on development branches (like this one) you have to build PSOL from binary, but on development branches (like this one) you have to build PSOL from
source yourself. See: source yourself. See:
https://github.com/pagespeed/ngx_pagespeed/wiki/Building-PSOL-From-Source https://github.com/pagespeed/ngx_pagespeed/wiki/Building-PSOL-From-Source
+2 -1
View File
@@ -26,7 +26,8 @@ if [ "$mod_pagespeed_dir" = "unset" ] ; then
if [ ! -e "$mod_pagespeed_dir" ] ; then if [ ! -e "$mod_pagespeed_dir" ] ; then
echo "ngx_pagespeed: pagespeed optimization library not found:" echo "ngx_pagespeed: pagespeed optimization library not found:"
psol_binary_url="$(cat $ngx_addon_dir/PSOL_BINARY_URL)" psol_binary_url="$($ngx_addon_dir/scripts/format_binary_url.sh \
$ngx_addon_dir/PSOL_BINARY_URL)"
if [[ "$psol_binary_url" != https://* ]]; then if [[ "$psol_binary_url" != https://* ]]; then
echo " echo "
This is a development branch of ngx_pagespeed, which means there is no This is a development branch of ngx_pagespeed, which means there is no
+1 -1
View File
@@ -614,7 +614,7 @@ Not deleting $directory; name is suspiciously short. Something is wrong."
elif [ -e PSOL_BINARY_URL ]; then elif [ -e PSOL_BINARY_URL ]; then
# Releases after 1.11.33.4 there is a PSOL_BINARY_URL file that tells us # Releases after 1.11.33.4 there is a PSOL_BINARY_URL file that tells us
# where to look. # where to look.
psol_url="$(cat PSOL_BINARY_URL)" psol_url="$(scripts/format_binary_url.sh PSOL_BINARY_URL)"
if [[ "$psol_url" != https://* ]]; then if [[ "$psol_url" != https://* ]]; then
fail "Got bad psol binary location information: $psol_url" fail "Got bad psol binary location information: $psol_url"
fi fi
+24
View File
@@ -0,0 +1,24 @@
#!/bin/bash
set -e
set -u
if [ $# -ne 1 ]; then
echo "Usage: $(basename $0) <url_file>" >&2
exit 1
fi
url_file=$1
if [ ! -e "$url_file" ]; then
echo "Url file '$url_file' missing!" >&2
fi
# The size names must match install/build_psol.sh in mod_pagespeed
if [ "$(uname -m)" = x86_64 ]; then
bit_size_name=x64
else
bit_size_name=ia32
fi
sed -e 's/$BIT_SIZE_NAME\b/'$bit_size_name'/g' $url_file