3
# Copyright (C) 2013 Anders Logg and Martin Sandve Alnaes
5
# This file is part of FFC.
7
# FFC is free software: you can redistribute it and/or modify
8
# it under the terms of the GNU Lesser General Public License as published by
9
# the Free Software Foundation, either version 3 of the License, or
10
# (at your option) any later version.
12
# FFC is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU Lesser General Public License for more details.
17
# You should have received a copy of the GNU Lesser General Public License
18
# along with FFC. If not, see <http://www.gnu.org/licenses/>.
20
# First added: 2013-04-22
21
# Last changed: 2013-08-21
23
# This script overwrites the reference data with the current output
24
# and stores the new reference data as part of the FFC reference data
25
# repository. The commit id of the stored reference data is commited
26
# to a file in the main repo.
29
source ./scripts/parameters
31
# Get updated reference repository
32
./scripts/getreferencerepo
37
# Check that we have any data
38
if [ ! -d "$OUTPUT_DIR" ]; then
39
echo "Missing data directory '$OUTPUT_DIR'."
44
echo "Copying new reference data to $DATA_DIR"
45
rsync -r --exclude='README.rst' --exclude='*.bin' --exclude='*.cpp' $OUTPUT_DIR/ $DATA_DIR
48
# Get current id for main repo (does not include dirty files, so not quite trustworthy!)
49
REPO_ID=`git rev-list --max-count 1 HEAD`
51
# Commit new data to reference repository
54
git commit -m "Update reference data, current project head is ${REPO_ID}." | grep -v "create mode"
56
echo "Failed to commit reference data."
59
DATA_ID=`git rev-list --max-count 1 HEAD`
62
# Commit reference data commit id to file in main repo
63
echo $DATA_ID > $DATA_ID_FILE
64
git commit $DATA_ID_FILE -m"Update reference data pointer to ${DATA_ID}."
66
# Push references to server
70
echo "WARNING: Failed to push new reference data to server."