File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,25 @@ function version(){
28
28
echo " with_predict_sdk: @WITH_PREDICT_SDK@"
29
29
}
30
30
31
+ function ver2num() {
32
+ printf " %03d%03d%03d%03d" \
33
+ $( echo $1 | sed ' s#v##g' | tr ' .' ' ' \
34
+ | tr ' a' ' 0 ' | tr ' b' ' 1 ' | tr ' rc' ' 2 ' )
35
+ }
36
+
37
+ PADDLE_CONF_HOME=" $HOME /.config/paddle"
38
+ mkdir -p ${PADDLE_CONF_HOME}
39
+
40
+ if [ -z " ${PADDLE_NO_STAT+x} " ]; then
41
+ SERVER_VER=` curl -m 5 -X POST --data content=" { version: \" @PADDLE_VERSION@\" }" \
42
+ -b ${PADDLE_CONF_HOME} /paddle.cookie \
43
+ -c ${PADDLE_CONF_HOME} /paddle.cookie \
44
+ http://api.paddlepaddle.org/version 2> /dev/null`
45
+ if [ $? -eq 0 ] && [ " $( ver2num @PADDLE_VERSION@) " -lt $( ver2num $SERVER_VER ) ]; then
46
+ echo " Paddle release a new version ${SERVER_VER} , you can get the install package in http://www.paddlepaddle.org"
47
+ fi
48
+ fi
49
+
31
50
32
51
MYDIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
33
52
You can’t perform that action at this time.
0 commit comments