2 # SPDX-License-Identifier: GPL-2.0-only
5 # Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
9 # This file is part of Lustre, http://www.lustre.org/
11 # contrib/scripts/license-status
13 # Display the license status of files in the current directory
15 # Author: Gordon Matzigkeit <gord@fig.org>, 2001-09-27
16 # Author: Timothy Day <timday@amazon.com>, 2023-04-03
19 for file in $(git ls-tree -r HEAD --name-only); do
20 if head -20 "$file" | egrep -e 'SPDX' > /dev/null; then
21 license="$(grep SPDX $file | awk '{ print $3; exit; }')"
22 printf "%-10s %-15s %-s\n" "SPDX" "$license" "$file"
23 elif head -20 "$file" | egrep -e 'GNU General Public License' > /dev/null; then
24 printf "%-10s %-15s %-s\n" "guess" "gpled" "$file"
25 elif head -20 "$file" | egrep -e '\([Cc]\)' > /dev/null; then
26 printf "%-10s %-15s %-s\n" "guess" "copyright" "$file"
28 printf "%-10s %-15s %-s\n" "guess" "unknown" "$file"