blob: 0203b7ea3a94d1c74ce5fc2349911c1bef80589d [file] [log] [blame]
# Copyright 2012 Google Inc. All Rights Reserved.
# Author: (Keir Mierle)
# 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"
rm -rf $temp_repo
git clone \ \
cd $temp_repo
declare -r commit="$(git log | head -1 | cut -d ' ' -f2)"
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.tar.gz" >> $temp_readme
echo "Version: $commit" >> $temp_readme
tail -n +3 >> $temp_readme
cp $temp_readme