~ubuntu-branches/ubuntu/vivid/ffc/vivid

« back to all changes in this revision

Viewing changes to test/regression/scripts/upload

  • Committer: Package Import Robot
  • Author(s): Johannes Ring
  • Date: 2014-01-10 13:56:45 UTC
  • mfrom: (1.1.14)
  • Revision ID: package-import@ubuntu.com-20140110135645-4ozcd71y1oggj44z
Tags: 1.3.0-1
* New upstream release.
* debian/watch: Update URL for move to Bitbucket.
* debian/docs: README -> README.rst and remove TODO.
* debian/control:
  - Add python-numpy to Build-Depends.
  - Replace python-all with python-all-dev in Build-Depends.
  - Add ${shlibs:Depends} to Depends.
  - Change to Architecture: any.
  - Bump Standards-Version to 3.9.5 (no changes needed).
* debian/rules: Call dh_numpy in override_dh_python2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
#
 
3
# Copyright (C) 2013 Anders Logg and Martin Sandve Alnaes
 
4
#
 
5
# This file is part of FFC.
 
6
#
 
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.
 
11
#
 
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.
 
16
#
 
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/>.
 
19
#
 
20
# First added:  2013-04-22
 
21
# Last changed: 2013-08-21
 
22
#
 
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.
 
27
 
 
28
# Parameters
 
29
source ./scripts/parameters
 
30
 
 
31
# Get updated reference repository
 
32
./scripts/getreferencerepo
 
33
if [ $? -ne 0 ]; then
 
34
    exit 1
 
35
fi
 
36
 
 
37
# Check that we have any data
 
38
if [ ! -d "$OUTPUT_DIR" ]; then
 
39
    echo "Missing data directory '$OUTPUT_DIR'."
 
40
    exit 1
 
41
fi
 
42
 
 
43
# Copy references
 
44
echo "Copying new reference data to $DATA_DIR"
 
45
rsync -r  --exclude='README.rst' --exclude='*.bin' --exclude='*.cpp' $OUTPUT_DIR/ $DATA_DIR
 
46
echo ""
 
47
 
 
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`
 
50
 
 
51
# Commit new data to reference repository
 
52
pushd $DATA_DIR
 
53
git add *
 
54
git commit -m "Update reference data, current project head is ${REPO_ID}." | grep -v "create mode"
 
55
if [ $? -ne 0 ]; then
 
56
    echo "Failed to commit reference data."
 
57
    exit 1
 
58
fi
 
59
DATA_ID=`git rev-list --max-count 1 HEAD`
 
60
popd
 
61
 
 
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}."
 
65
 
 
66
# Push references to server
 
67
pushd $DATA_DIR
 
68
git push
 
69
if [ $? -ne 0 ]; then
 
70
    echo "WARNING: Failed to push new reference data to server."
 
71
fi
 
72
popd