Neels Hofmeyr | 1a4c460 | 2018-03-15 22:04:41 +0100 | [diff] [blame] | 1 | #!dont_run_this |
| 2 | # This file is sourced by */gen_links.sh |
| 3 | |
Harald Welte | 0cdf071 | 2019-06-19 18:15:38 +0200 | [diff] [blame] | 4 | # 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 Hofmeyr | 53fb0cf | 2018-03-15 22:14:38 +0100 | [diff] [blame] | 19 | rm -f .gitignore |
| 20 | |
| 21 | gen_link() { |
| 22 | src="$1" |
| 23 | f="$2" |
| 24 | echo "Linking $f" |
| 25 | ln -sf "$src" "$f" |
| 26 | echo "$f" >> .gitignore |
| 27 | } |
| 28 | |
Neels Hofmeyr | 1a4c460 | 2018-03-15 22:04:41 +0100 | [diff] [blame] | 29 | gen_links() { |
| 30 | DIR=$1 |
| 31 | shift |
| 32 | FILES=$* |
| 33 | for f in $FILES; do |
Neels Hofmeyr | 53fb0cf | 2018-03-15 22:14:38 +0100 | [diff] [blame] | 34 | gen_link "$DIR/$f" "$f" |
Neels Hofmeyr | 1a4c460 | 2018-03-15 22:04:41 +0100 | [diff] [blame] | 35 | done |
| 36 | } |
Neels Hofmeyr | cd11223 | 2018-03-16 00:03:00 +0100 | [diff] [blame] | 37 | |
| 38 | ignore_pp_results() { |
| 39 | for pp in *.ttcnpp; do |
| 40 | ttcn_file="$(echo $pp | sed 's/pp$//')" |
| 41 | echo "$ttcn_file" >> .gitignore |
| 42 | done |
| 43 | } |