From 5fd2e95c4d8415e07b0d822ef404c861b87daf85 Mon Sep 17 00:00:00 2001 From: Jonathan Barda Date: Mon, 23 Jan 2017 07:36:24 +0100 Subject: [PATCH 1/3] Few fixes Added `&>/dev/null` on git commands to suppress their output Fixed the symbolic link creation that pointed to non existent path. `ecdsa` folder moved to `src/ecdsa` --- cscan.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cscan.sh b/cscan.sh index e0a3b01..c5e686f 100755 --- a/cscan.sh +++ b/cscan.sh @@ -1,12 +1,12 @@ #!/bin/bash pushd "$(dirname ${BASH_SOURCE[0]})" > /dev/null if [ ! -d ./tlslite ]; then - git clone --depth=1 https://github.com/tomato42/tlslite-ng.git .tlslite-ng + git clone --depth=1 https://github.com/tomato42/tlslite-ng.git .tlslite-ng &>/dev/null ln -s .tlslite-ng/tlslite tlslite fi if [ ! -d ./ecdsa ]; then - git clone --depth=1 https://github.com/warner/python-ecdsa.git .python-ecdsa - ln -s .python-ecdsa/ecdsa ecdsa + git clone --depth=1 https://github.com/warner/python-ecdsa.git .python-ecdsa &>/dev/null + ln -s .python-ecdsa/src/ecdsa ecdsa fi # update the code if it is running in interactive terminal From 717b9c0a1302b4f33ad2e6a5e24d1f95512e9dc1 Mon Sep 17 00:00:00 2001 From: Jonathan Barda Date: Mon, 23 Jan 2017 15:27:04 +0100 Subject: [PATCH 2/3] Adapted changes as requested Added some detail when required libraries are not present on the host and needs downloading --- cscan.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cscan.sh b/cscan.sh index c5e686f..a80a308 100755 --- a/cscan.sh +++ b/cscan.sh @@ -1,11 +1,13 @@ #!/bin/bash pushd "$(dirname ${BASH_SOURCE[0]})" > /dev/null if [ ! -d ./tlslite ]; then - git clone --depth=1 https://github.com/tomato42/tlslite-ng.git .tlslite-ng &>/dev/null + echo -e "\ntlslite-ng not found, downloading..." + git clone --depth=1 https://github.com/tomato42/tlslite-ng.git .tlslite-ng ln -s .tlslite-ng/tlslite tlslite fi if [ ! -d ./ecdsa ]; then - git clone --depth=1 https://github.com/warner/python-ecdsa.git .python-ecdsa &>/dev/null + echo -e "\npython-ecdsa not found, downloading..." + git clone --depth=1 https://github.com/warner/python-ecdsa.git .python-ecdsa ln -s .python-ecdsa/src/ecdsa ecdsa fi From 0b1d5331d691ff96f59526747a425208a7f8c32a Mon Sep 17 00:00:00 2001 From: Jonathan Barda Date: Mon, 23 Jan 2017 16:12:34 +0100 Subject: [PATCH 3/3] Added requested changes I may change `${BASH_SOURCE[0]}` by ` `basename $BASH_SOURCE` ` if you prefer --- cscan.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cscan.sh b/cscan.sh index a80a308..0572d66 100755 --- a/cscan.sh +++ b/cscan.sh @@ -1,12 +1,12 @@ #!/bin/bash pushd "$(dirname ${BASH_SOURCE[0]})" > /dev/null if [ ! -d ./tlslite ]; then - echo -e "\ntlslite-ng not found, downloading..." + echo -e "\n${BASH_SOURCE[0]}: tlslite-ng not found, downloading..." git clone --depth=1 https://github.com/tomato42/tlslite-ng.git .tlslite-ng ln -s .tlslite-ng/tlslite tlslite fi if [ ! -d ./ecdsa ]; then - echo -e "\npython-ecdsa not found, downloading..." + echo -e "\n${BASH_SOURCE[0]}: python-ecdsa not found, downloading..." git clone --depth=1 https://github.com/warner/python-ecdsa.git .python-ecdsa ln -s .python-ecdsa/src/ecdsa ecdsa fi