Bug 1272640: Update update.sh to import s_truncf.cpp into fdlibm/; r=arai
authorBenjamin Bouvier <benj@benj.me>
Thu, 19 May 2016 16:20:19 +0200
changeset 324632 335c62fd3d98ae9bfe311960577647c41da8d801
parent 324631 2026dc41b83eff1f5b9900269bfe8f629d1f8627
child 324633 7ba34f7a79a0d6eb5c95cd38be47ac11cd3fe1dd
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-esr52@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersarai
bugs1272640
milestone49.0a1
Bug 1272640: Update update.sh to import s_truncf.cpp into fdlibm/; r=arai MozReview-Commit-ID: 27MMIP67LxN
modules/fdlibm/import.sh
modules/fdlibm/src/moz.build
modules/fdlibm/update.sh
--- a/modules/fdlibm/import.sh
+++ b/modules/fdlibm/import.sh
@@ -1,18 +1,20 @@
 #!/bin/sh
 
 set -e
 
 BASE_URL=https://raw.githubusercontent.com/freebsd/freebsd/master/lib/msun/src
 
-function download_source() {
+download_source() {
     REMOTE_FILENAME=$1
     LOCAL_FILENAME=$2
-    curl -o "src/${LOCAL_FILENAME}" "${BASE_URL}/${REMOTE_FILENAME}"
+    while true; do
+        curl -o "src/${LOCAL_FILENAME}" "${BASE_URL}/${REMOTE_FILENAME}" && break
+    done
 }
 
 mkdir -p src
 
 # headers
 download_source math.h fdlibm.h
 download_source math_private.h math_private.h
 
@@ -88,16 +90,17 @@ download_source e_sinh.c e_sinh.cpp
 
 # Math.tan (not used due to poor performance)
 
 # Math.tanh
 download_source s_tanh.c s_tanh.cpp
 
 # Math.trunc
 download_source s_trunc.c s_trunc.cpp
+download_source s_truncf.c s_truncf.cpp
 
 # dependencies
 download_source k_exp.c k_exp.cpp
 download_source s_copysign.c s_copysign.cpp
 download_source s_fabs.c s_fabs.cpp
 download_source s_scalbn.c s_scalbn.cpp
 
 # These are not not used in Math.* functions, but used internally.
--- a/modules/fdlibm/src/moz.build
+++ b/modules/fdlibm/src/moz.build
@@ -55,9 +55,10 @@ SOURCES += [
     's_expm1.cpp',
     's_fabs.cpp',
     's_floor.cpp',
     's_floorf.cpp',
     's_log1p.cpp',
     's_scalbn.cpp',
     's_tanh.cpp',
     's_trunc.cpp',
+    's_truncf.cpp',
 ]
--- a/modules/fdlibm/update.sh
+++ b/modules/fdlibm/update.sh
@@ -2,24 +2,26 @@
 
 # Script to update the mozilla in-tree copy of the fdlibm library.
 # Run this within the /modules/fdlibm directory of the source tree.
 
 set -e
 
 API_BASE_URL=https://api.github.com/repos/freebsd/freebsd
 
-function get_commit {
+get_commit() {
     curl -s "${API_BASE_URL}/commits?path=lib/msun/src&per_page=1" \
         | python -c 'import json, sys; print(json.loads(sys.stdin.read())[0]["sha"])'
 }
 
+mv ./src/moz.build ./src_moz.build
 rm -rf src
 BEFORE_COMMIT=$(get_commit)
 sh ./import.sh
+mv ./src_moz.build ./src/moz.build
 COMMIT=$(get_commit)
 if [ ${BEFORE_COMMIT} != ${COMMIT} ]; then
     echo "Latest commit is changed during import.  Please run again."
     exit 1
 fi
 for FILE in $(ls patches/*.patch | sort); do
     patch -p3 < ${FILE}
 done