blob: 1bebbf4fc97f6eb7a7df5c648568c7cf0aab012b [file] [log] [blame]
# Copyright 2013 Google Inc. All Rights Reserved.
# Author: (Sameer Agarwal)
# Import the latest version of Ceres into google3.
set -e
set -x
if [[ "google3" != "$(basename $(pwd))" ]] ; then
echo "ERROR: Not in toplevel google3 directory. Bailing."
exit 1
declare -r google3_dir="$(pwd)"
declare -r temp_repo="/tmp/ceres-solver"
git clone \
/usr/local/google/home/sameeragarwal/ceres-solver -b testing\
cd $temp_repo
declare -r commit="$(git log | head -1)"
rm -rf .git
# Get rid of the internal gtest and gmock code until the upstream
# version moves it around appropriately.
rm -rf internal/ceres/gtest*
rm -rf internal/ceres/gmock*
rm -rf internal/ceres/mock_log.h
cd $google3_dir
cp -R $temp_repo/* third_party/ceres
cd third_party/ceres
declare -r temp_readme="/tmp/"
rm -f $temp_readme
echo "URL:$commit" >> $temp_readme
echo "Version: $commit" >> $temp_readme
tail -n +3 >> $temp_readme
cp $temp_readme