source: LMDZ6/branches/Amaury_dev/tools/fcm/t/fcm-loc-layout/test_header @ 5095

Last change on this file since 5095 was 5095, checked in by abarral, 4 months ago

Revert cosp*/ from the trunk, as it's external code
Add missing bits from FCM2 source

File size: 2.1 KB
Line 
1#!/bin/bash
2# ------------------------------------------------------------------------------
3# Copyright (C) 2006-2021 British Crown (Met Office) & Contributors.
4#
5# This file is part of FCM, tools for managing and building source code.
6#
7# FCM is free software: you can redistribute it and/or modify
8# it under the terms of the GNU 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# FCM 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 General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with FCM. If not, see <http://www.gnu.org/licenses/>.
19# ------------------------------------------------------------------------------
20# Optional enviroment variables:
21#   TEST_REMOTE_HOST (tests using svn+ssh repositories located on given host)
22# ------------------------------------------------------------------------------
23
24. $(dirname $0)/../lib/bash/svn_test_header
25
26function init_repos_layout_roses() {
27    if [[ -n ${TEST_REMOTE_HOST:-} ]]; then
28        TEST_REMOTE_DIR=$(ssh $TEST_REMOTE_HOST "mktemp -d")
29        ssh $TEST_REMOTE_HOST "svnadmin create --fs-type fsfs $TEST_REMOTE_DIR"
30        REPOS_URL="svn+ssh://${TEST_REMOTE_HOST}$TEST_REMOTE_DIR"
31    else
32        svnadmin create --fs-type fsfs $TEST_DIR/test_repos
33        REPOS_URL="file://$TEST_DIR/test_repos"
34    fi
35    svn mkdir -q -m " " --parents $REPOS_URL/a/a/0/0/0/trunk
36    svn import -q $TEST_SOURCE_DIR/../etc/repo_files \
37        $REPOS_URL/a/a/0/0/0/trunk -m "initial trunk import"
38    TMPFILE=$(mktemp)
39    cat >$TMPFILE <<__LAYOUT__
40depth-project = 5
41depth-branch = 1
42depth-tag = 1
43dir-trunk = trunk
44dir-branch =
45dir-tag =
46level-owner-branch =
47level-owner-tag =
48template-branch =
49template-tag =
50__LAYOUT__
51    TMPDIR=$(mktemp -d)
52    svn checkout -q $REPOS_URL $TMPDIR
53    svn propset -q --file=$TMPFILE fcm:layout $TMPDIR
54    svn commit -q -m " " $TMPDIR
55    rm -f $TMPFILE
56    rm -rf $TMPDIR
57    ROOT_URL=$REPOS_URL
58}
Note: See TracBrowser for help on using the repository browser.