blob: c21bcd60d7ad9961e4abf79befff3a9ecde50b59 [file] [log] [blame]
Neels Hofmeyr1a4c4602018-03-15 22:04:41 +01001#!dont_run_this
2# This file is sourced by */gen_links.sh
3
Harald Welte0cdf0712019-06-19 18:15:38 +02004# Copyright 2017 Harald Welte
5# Copyright 2018 sysmocom - s.f.m.c. GmbH
6#
7# Licensed under the Apache License, Version 2.0 (the "License");
8# you may not use this file except in compliance with the License.
9# You may obtain a copy of the License at
10#
11# http://www.apache.org/licenses/LICENSE-2.0
12#
13# Unless required by applicable law or agreed to in writing, software
14# distributed under the License is distributed on an "AS IS" BASIS,
15# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16# See the License for the specific language governing permissions and
17# limitations under the License.
18
Neels Hofmeyr53fb0cf2018-03-15 22:14:38 +010019rm -f .gitignore
20
21gen_link() {
22 src="$1"
23 f="$2"
24 echo "Linking $f"
25 ln -sf "$src" "$f"
26 echo "$f" >> .gitignore
27}
28
Neels Hofmeyr1a4c4602018-03-15 22:04:41 +010029gen_links() {
30 DIR=$1
31 shift
32 FILES=$*
33 for f in $FILES; do
Neels Hofmeyr53fb0cf2018-03-15 22:14:38 +010034 gen_link "$DIR/$f" "$f"
Neels Hofmeyr1a4c4602018-03-15 22:04:41 +010035 done
36}
Neels Hofmeyrcd112232018-03-16 00:03:00 +010037
38ignore_pp_results() {
Pau Espin Pedrolbedb1fd2022-03-18 18:37:42 +010039 # Avoid using the pattern itself if no file is found in globbing below:
40 shopt -s nullglob
Neels Hofmeyrcd112232018-03-16 00:03:00 +010041 for pp in *.ttcnpp; do
42 ttcn_file="$(echo $pp | sed 's/pp$//')"
43 echo "$ttcn_file" >> .gitignore
44 done
45}