From 87fdb40a03063b09811d4e3f303432f62b12e25d Mon Sep 17 00:00:00 2001 From: Sean Long Date: Fri, 21 Feb 2014 21:32:35 -0800 Subject: First pass on getting build working on FreeBSD. --- scripts/common.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'scripts/common.sh') diff --git a/scripts/common.sh b/scripts/common.sh index d7653c6aa1..8c5d8a61ab 100644 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -1,3 +1,16 @@ +platform='unknown' +unameval=`uname` +if [ "$unameval" == 'Linux' ]; then + platform='linux' +elif [ "$unameval" == 'FreeBSD' ]; then + platform='freebsd' +fi + +sha1sumcmd='sha1sum' +if [ "$platform" == 'freebsd' ]; then + sha1sumcmd='shasum' +fi + pkgroot="$(pwd)" deps="$pkgroot/.deps" prefix="$deps/usr" @@ -17,7 +30,7 @@ download() { # download, untar and calculate sha1 sum in one pass (wget "$url" -O - | tee "$fifo" | \ (cd "$tgt"; tar --strip-components=1 -xvzf -)) & - sum=$(sha1sum < "$fifo" | cut -d ' ' -f1) + sum=$("$sha1sumcmd" < "$fifo" | cut -d ' ' -f1) rm -rf "$tmp_dir" if [ "$sum" != "$sha1" ]; then echo "SHA1 sum doesn't match, expected '$sha1' got '$sum'" -- cgit From 6241a499431ce56b012facd1971a380b73a15dab Mon Sep 17 00:00:00 2001 From: John Szakmeister Date: Sun, 23 Feb 2014 15:01:41 -0500 Subject: scripts/common.sh: remove a couple bashisms This allows the scripts to work on systems that don't have /bin/bash as /bin/sh--such as Debian. --- scripts/common.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts/common.sh') diff --git a/scripts/common.sh b/scripts/common.sh index 8c5d8a61ab..f42c000c6f 100644 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -1,13 +1,13 @@ platform='unknown' unameval=`uname` -if [ "$unameval" == 'Linux' ]; then +if [ "$unameval" = 'Linux' ]; then platform='linux' -elif [ "$unameval" == 'FreeBSD' ]; then +elif [ "$unameval" = 'FreeBSD' ]; then platform='freebsd' fi sha1sumcmd='sha1sum' -if [ "$platform" == 'freebsd' ]; then +if [ "$platform" = 'freebsd' ]; then sha1sumcmd='shasum' fi -- cgit From e7b0aa224a2a873ad9da05776e26793eb5c882e6 Mon Sep 17 00:00:00 2001 From: Theo Belaire Date: Sat, 22 Feb 2014 14:49:53 -0800 Subject: Added curl support and one test Now it checks for the existance of curl after failing to find wget. Note that I ended up removing the quotes around $url when referencing it in the call to wget, since urls can't have spaces anyways, and the correct quoting was messy. To test, I did rm -r .deps make clean make cmake make And it worked. --- scripts/common.sh | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'scripts/common.sh') diff --git a/scripts/common.sh b/scripts/common.sh index f42c000c6f..eb2d05c48c 100644 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -23,21 +23,29 @@ download() { if [ ! -d "$tgt" ]; then mkdir -p "$tgt" + local download_command="" if which wget > /dev/null 2>&1; then - tmp_dir=$(mktemp -d "/tmp/download_sha1check_XXXXXXX") - fifo="$tmp_dir/fifo" - mkfifo "$fifo" - # download, untar and calculate sha1 sum in one pass - (wget "$url" -O - | tee "$fifo" | \ - (cd "$tgt"; tar --strip-components=1 -xvzf -)) & - sum=$("$sha1sumcmd" < "$fifo" | cut -d ' ' -f1) - rm -rf "$tmp_dir" - if [ "$sum" != "$sha1" ]; then - echo "SHA1 sum doesn't match, expected '$sha1' got '$sum'" - exit 1 - fi + # -O - to send output to stdout + download_command="wget $url -O -" + elif which curl >/dev/null 2>&1; then + # -L to follow the redirects that github will send us + # -sS to supress the progress bar, but show errors + # curl sends output to stdout by default + download_command="curl -L -sS $url" else - echo "Missing wget utility" + echo "Missing wget utility and curl utility" + exit 1 + fi + local tmp_dir=$(mktemp -d "/tmp/download_sha1check_XXXXXXX") + local fifo="$tmp_dir/fifo" + mkfifo "$fifo" + # download, untar and calculate sha1 sum in one pass + ($download_command | tee "$fifo" | \ + (cd "$tgt"; tar --strip-components=1 -xvzf -)) & + local sum=$("$sha1sumcmd" < "$fifo" | cut -d ' ' -f1) + rm -rf "$tmp_dir" + if [ "$sum" != "$sha1" ]; then + echo "SHA1 sum doesn't match, expected '$sha1' got '$sum'" exit 1 fi fi -- cgit From 98f4c55e456371050a373e077d894d6031395680 Mon Sep 17 00:00:00 2001 From: Theo Belaire Date: Sat, 22 Feb 2014 16:10:31 -0800 Subject: Silenced wget's progress bar This way it won't show up in travis-ci like: 0% [ ] 0 --.-K/s 100%[======================================>] 371,453 --.-K/s --- scripts/common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/common.sh') diff --git a/scripts/common.sh b/scripts/common.sh index eb2d05c48c..0317f02725 100644 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -26,7 +26,7 @@ download() { local download_command="" if which wget > /dev/null 2>&1; then # -O - to send output to stdout - download_command="wget $url -O -" + download_command="wget --no-verbose $url -O -" elif which curl >/dev/null 2>&1; then # -L to follow the redirects that github will send us # -sS to supress the progress bar, but show errors -- cgit From fffb8991fdb3333355bf6fbc584229990d4455ab Mon Sep 17 00:00:00 2001 From: ash-lshift Date: Tue, 25 Feb 2014 09:11:16 +0000 Subject: silence tar when getting libuv --- scripts/common.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'scripts/common.sh') diff --git a/scripts/common.sh b/scripts/common.sh index 0317f02725..9efa3d5e6c 100644 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -39,14 +39,17 @@ download() { local tmp_dir=$(mktemp -d "/tmp/download_sha1check_XXXXXXX") local fifo="$tmp_dir/fifo" mkfifo "$fifo" + echo "Downloading $url..." # download, untar and calculate sha1 sum in one pass ($download_command | tee "$fifo" | \ - (cd "$tgt"; tar --strip-components=1 -xvzf -)) & + (cd "$tgt"; tar --strip-components=1 -xzf -)) & local sum=$("$sha1sumcmd" < "$fifo" | cut -d ' ' -f1) rm -rf "$tmp_dir" if [ "$sum" != "$sha1" ]; then echo "SHA1 sum doesn't match, expected '$sha1' got '$sum'" exit 1 + else + echo "Download complete." fi fi } -- cgit