Debian Codegraph @

crt/s2n/codebuild/bin/install_saw.sh

raw symbols SCIP
1 #!/bin/bash
2 # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License").
5 # You may not use this file except in compliance with the License.
6 # A copy of the License is located at
7 #
8 # http://aws.amazon.com/apache2.0
9 #
10 # or in the "license" file accompanying this file. This file is distributed
11 # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 # express or implied. See the License for the specific language governing
13 # permissions and limitations under the License.
14 #
15
16
17 set -xe
18
19 usage() {
20 echo "install_saw.sh download_dir install_dir"
21 exit 1
22 }
23
24 if [ "$#" -ne "2" ]; then
25 usage
26 fi
27
28 DOWNLOAD_DIR=$1
29 INSTALL_DIR=$2
30
31 if [ -x "$INSTALL_DIR/bin/saw" ]; then
32 echo "Saw already installed at $INSTALL_DIR/bin/saw";
33 exit 0;
34 fi
35
36 mkdir -p "$DOWNLOAD_DIR"
37 cd "$DOWNLOAD_DIR"
38
39 #download saw binaries
40 curl --retry 3 https://s2n-public-test-dependencies.s3.us-west-2.amazonaws.com/saw-0.9.0.99-Linux-x86_64.tar.gz --output saw.tar.gz
41
42 mkdir -p saw && tar -xzf saw.tar.gz --strip-components=1 -C saw
43 mkdir -p "$INSTALL_DIR" && mv saw/* "$INSTALL_DIR"
44
45 "$INSTALL_DIR"/bin/saw --version