Martin Roth | adcba94 | 2016-11-28 13:16:24 -0700 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # This file is part of the coreboot project. |
| 3 | # |
| 4 | # Copyright (C) 2016 Google Inc. |
| 5 | # |
| 6 | # This program is free software; you can redistribute it and/or modify |
| 7 | # it under the terms of the GNU General Public License as published by |
| 8 | # the Free Software Foundation; version 2 of the License. |
| 9 | # |
| 10 | # This program is distributed in the hope that it will be useful, |
| 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | # GNU General Public License for more details. |
| 14 | # |
| 15 | # DESCR: Report any symbolic links |
| 16 | |
| 17 | LC_ALL=C export LC_ALL |
| 18 | |
| 19 | EXCLUDED_DIRS='^3rdparty\|^site-local' |
| 20 | |
| 21 | # If the code is in a git repo, only print files that are checked in |
Alex Thiessen | 73f19dc | 2018-01-16 23:05:48 +0000 | [diff] [blame] | 22 | if [ -n "$(command -v git)" ] && \ |
| 23 | [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ] |
| 24 | then |
Martin Roth | adcba94 | 2016-11-28 13:16:24 -0700 | [diff] [blame] | 25 | git ls-tree -r HEAD | \ |
| 26 | grep ^120000 | \ |
| 27 | cut -f2 | \ |
| 28 | grep -v "$EXCLUDED_DIRS" |
| 29 | else |
| 30 | # If the code isn't in a git repo, print everything |
| 31 | find . -type l | \ |
| 32 | sed 's|\.\/||' | \ |
| 33 | grep -v "$EXCLUDED_DIRS" |
| 34 | fi |