Skip to content

Commit 62574b6

Browse files
xiaoxqjmtao
authored andcommitted
Scripts: Check agreement on dev_start instead of inside container.
1 parent 0899d09 commit 62574b6

File tree

4 files changed

+29
-29
lines changed

4 files changed

+29
-29
lines changed

.travis.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ cache:
1313
- $HOME/.cache/bazel
1414
install: skip
1515
before_script:
16-
- if [ ! -d "${HOME}/.cache" ]; then mkdir ${HOME}/.cache; fi
17-
- cp scripts/AGREEMENT.txt ${HOME}/.cache/.apollo_agreement.txt
16+
- cp scripts/AGREEMENT.txt ${HOME}/.apollo_agreement.txt
1817
script:
1918
- ./docker/scripts/dev_start.sh
2019
- ./apollo_docker.sh ${JOB}

docker/scripts/dev_start.sh

+27
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,32 @@ VERSION_X86_64="dev-x86_64-20180419_1510"
2424
VERSION_AARCH64="dev-aarch64-20170927_1111"
2525
VERSION_OPT=""
2626

27+
# Check whether user has agreed license agreement
28+
function check_agreement() {
29+
agreement_record="${HOME}/.apollo_agreement.txt"
30+
if [ -e "$agreement_record" ]; then
31+
return
32+
fi
33+
34+
AGREEMENT_FILE="$APOLLO_ROOT_DIR/scripts/AGREEMENT.txt"
35+
if [ ! -e "$AGREEMENT_FILE" ]; then
36+
error "AGREEMENT $AGREEMENT_FILE does not exist."
37+
exit 1
38+
fi
39+
40+
cat $AGREEMENT_FILE
41+
tip="Type 'y' or 'Y' to agree to the license agreement above, or type any other key to exit"
42+
echo $tip
43+
read -n 1 user_agreed
44+
if [ "$user_agreed" == "y" ] || [ "$user_agreed" == "Y" ]; then
45+
cp $AGREEMENT_FILE $agreement_record
46+
echo "$tip" >> $agreement_record
47+
echo "$user_agreed" >> $agreement_record
48+
else
49+
exit 1
50+
fi
51+
}
52+
2753
function show_usage()
2854
{
2955
cat <<EOF
@@ -48,6 +74,7 @@ if [ -e /proc/sys/kernel ]; then
4874
fi
4975

5076
source ${APOLLO_ROOT_DIR}/scripts/apollo_base.sh
77+
check_agreement
5178

5279
VOLUME_VERSION="latest"
5380
DEFAULT_MAPS=(

scripts/AGREEMENT.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ THE APOLLO OPEN PLATFORM (“PLATFORM”) FOR AND ON BEHALF OF ITSELF AND ITS SU
33
2. LICENSE GRANT: Subject to the terms and conditions of this Agreement, with the exception of different license terms and license grants for separate, individual third-party components as set forth below, the Software is licensed to you under the terms of the Apache 2.0 license available at: https://www.apache.org/licenses/LICENSE-2.0. You agree to these terms with respect to the Software.
44
3. THIRD PARTY CODE: Additional copyright notices and license terms applicable to portions of the Software are set forth below in Appendix A. You expressly agree to the license terms associated with third party code set forth in Appendix A. In addition to any terms and conditions of any third party license identified in Appendix A, the disclaimer of warranty and limitation of liability provisions in paragraphs 4 and 5 of this License Agreement shall apply to all Software in this distribution. YOU EXPRESSLY AGREE THAT YOU HAVE REVIEWED THE TERMS OF THE AGREEMENTS LINKED TO AND RESTATED IN APPENDIX A TO THIS AGREEMENT, AND THAT YOU AGREE TO THE TERMS OF THOSE AGREEMENTS.
55
4. DISCLAIMER OF WARRANTY. THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. BAIDU FURTHER DISCLAIMS ALL WARRANTIES, EXPRESS AND IMPLIED, INCLUDING WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
6-
5. LIMITATION OF LIABILITY. IN NO EVENT SHALL BAIDU BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, PUNITIVE OR CONSEQUENTIAL DAMAGES, OR DAMAGES FOR LOSS OF PROFITS, REVENUE, DATA OR DATA USE, INCURRED BY YOU OR ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT, EVEN IF BAIDU HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. BAIDU’S ENTIRE LIABILITY FOR DAMAGES HEREUNDER SHALL IN NO EVENT EXCEED ONE ONE CENT (U.S. $0.01).
6+
5. LIMITATION OF LIABILITY. IN NO EVENT SHALL BAIDU BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, PUNITIVE OR CONSEQUENTIAL DAMAGES, OR DAMAGES FOR LOSS OF PROFITS, REVENUE, DATA OR DATA USE, INCURRED BY YOU OR ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT, EVEN IF BAIDU HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. BAIDU’S ENTIRE LIABILITY FOR DAMAGES HEREUNDER SHALL IN NO EVENT EXCEED ONE CENT (U.S. $0.01).
77

88
Copyright (c) 2017 Various License Holders. All Rights Reserved
99

1010
Apollo software is built on top of various other open source software packages, a complete list of licenses are located at https://github.com/ApolloAuto/apollo/blob/master/third_party/ACKNOWLEDGEMENT.txt
1111

1212
You agree to the terms of all the License Agreements.
13-

scripts/apollo_base.sh

-25
Original file line numberDiff line numberDiff line change
@@ -68,34 +68,9 @@ function fail() {
6868
exit -1
6969
}
7070

71-
# Check whether user has agreed license agreement
72-
function check_agreement() {
73-
agreement_record="$HOME/.cache/.apollo_agreement.txt"
74-
if [ ! -e "$agreement_record" ]; then
75-
AGREEMENT_FILE="$APOLLO_ROOT_DIR/scripts/AGREEMENT.txt"
76-
if [ ! -e "$AGREEMENT_FILE" ]; then
77-
error "AGREEMENT $AGREEMENT_FILE does not exist."
78-
exit 0
79-
fi
80-
cat $AGREEMENT_FILE
81-
tip="Type 'y' or 'Y' to agree to the license agreement above, or type any other key to exit"
82-
echo $tip
83-
read -n 1 user_agreed
84-
if [ "$user_agreed" == "y" ] || [ "$user_agreed" == "Y" ]; then
85-
rm -rf $agreement_record
86-
cat $AGREEMENT_FILE >> $agreement_record
87-
echo "$tip" >> $agreement_record
88-
echo "$user_agreed" >> $agreement_record
89-
else
90-
exit 0
91-
fi
92-
fi
93-
}
94-
9571
function check_in_docker() {
9672
if [ -f /.dockerenv ]; then
9773
APOLLO_IN_DOCKER=true
98-
check_agreement
9974
else
10075
APOLLO_IN_DOCKER=false
10176
fi

0 commit comments

Comments
 (0)