1 #!/bin/bash 2 # 3 # Copyright 2013 Google Inc. All Rights Reserved. 4 # Author: sameeragarwal (at] google.com (Sameer Agarwal) 5 # 6 # Import the latest version of Ceres into google3. 7 8 set -e 9 set -x 10 11 if [[ "google3" != "$(basename $(pwd))" ]] ; then 12 echo "ERROR: Not in toplevel google3 directory. Bailing." 13 exit 1 14 fi 15 16 declare -r google3_dir="$(pwd)" 17 18 declare -r temp_repo="/tmp/ceres-solver" 19 git clone \ 20 /usr/local/google/home/sameeragarwal/ceres-solver -b testing\ 21 $temp_repo 22 23 cd $temp_repo 24 declare -r commit="$(git log | head -1)" 25 rm -rf .git 26 27 # Get rid of the internal gtest and gmock code until the upstream 28 # version moves it around appropriately. 29 rm -rf internal/ceres/gtest* 30 rm -rf internal/ceres/gmock* 31 rm -rf internal/ceres/mock_log.h 32 33 cd $google3_dir 34 cp -R $temp_repo/* third_party/ceres 35 36 cd third_party/ceres 37 38 declare -r temp_readme="/tmp/README.google" 39 rm -f $temp_readme 40 41 echo "URL: https://ceres-solver.googlesource.com/ceres-solver/+/$commit" >> $temp_readme 42 echo "Version: $commit" >> $temp_readme 43 tail -n +3 README.google >> $temp_readme 44 cp $temp_readme README.google 45