2
# This file is part of Checkbox.
4
# Copyright 2013 Canonical Ltd.
6
# Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
8
# Checkbox is free software: you can redistribute it and/or modify
9
# it under the terms of the GNU General Public License version 3,
10
# as published by the Free Software Foundation.
13
# Checkbox is distributed in the hope that it will be useful,
14
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
18
# You should have received a copy of the GNU General Public License
19
# along with Checkbox. If not, see <http://www.gnu.org/licenses/>.
21
# Helper script to download external tarballs
22
# ===========================================
24
# Ensure that CHECKBOX_TOP is not empty
25
if [ "$CHECKBOX_TOP" = "" ]; then
26
echo "E: this script requires \$CHECKBOX_TOP"
30
# Ensure that we have git
31
if [ "$(which git)" = "" ]; then
32
echo "E: you need to have git installed first"
36
# Ensure that we have the external-tarballs repository
37
if [ ! -d "$CHECKBOX_TOP/support/external-tarballs" ]; then
38
echo "I: cloning external-tarballs repository..."
39
# Clone the external-tarballs repo
40
git clone git://github.com/checkbox/external-tarballs \
41
$CHECKBOX_TOP/support/external-tarballs
44
cd $CHECKBOX_TOP/support/external-tarballs
46
# Fetch so that we may have the needed revision
47
if ! git fetch origin --quiet; then
48
echo "W: cannot perform fetch, external-tarballs may be out of date"
51
# Ensure that we are on the correct revision
52
if ! git checkout $(cat $CHECKBOX_TOP/support/external-tarballs-revision.txt); then
53
echo "E: cannot switch to required commit!"