--- /dev/null
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0-only
+
+#
+# Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+#
+# This file is part of Lustre, http://www.lustre.org/
+#
+# contrib/scripts/license-status
+#
+# Display the license status of files in the current directory
+#
+# Author: Gordon Matzigkeit <gord@fig.org>, 2001-09-27
+# Author: Timothy Day <timday@amazon.com>, 2023-04-03
+#
+
+for file in $(git ls-tree -r HEAD --name-only); do
+ if head -20 "$file" | egrep -e 'SPDX' > /dev/null; then
+ license="$(grep SPDX $file | awk '{ print $3; exit; }')"
+ printf "%-10s %-15s %-s\n" "SPDX" "$license" "$file"
+ elif head -20 "$file" | egrep -e 'GNU General Public License' > /dev/null; then
+ printf "%-10s %-15s %-s\n" "guess" "gpled" "$file"
+ elif head -20 "$file" | egrep -e '\([Cc]\)' > /dev/null; then
+ printf "%-10s %-15s %-s\n" "guess" "copyright" "$file"
+ else
+ printf "%-10s %-15s %-s\n" "guess" "unknown" "$file"
+ fi
+done | sort
endif # UTILS
-EXTRA_DIST = license-status lustre_rmmod ldev lc_mon lhbadm \
+EXTRA_DIST = lustre_rmmod ldev lc_mon lhbadm \
lc_servip lustre_routes_config lustre_routes_conversion \
$(addsuffix .in,$(genscripts)) lfs_migrate lustre_req_history \
lustre lsvcgss lc_common haconfig Lustre.ha_v2 dkms.mkconf \
+++ /dev/null
-#! /bin/sh
-# license-status - Display the status of files in the current directory
-# Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
-#
-# This code is issued under the GNU General Public License.
-# See the file COPYING in this distribution
-#
-# Gordon Matzigkeit <gord@fig.org>, 2001-09-27
-
-for f in `find . -type f | sort`; do
- case "$f" in
- *~ | *.orig | *.gz | */config.* | *.o | \
- */CVS/* | */.cvsignore | */.depfiles/* | \
- */COPYING | */ChangeLog)
- continue
- ;;
- esac
-
- if head -20 "$f" | egrep -e 'GNU' > /dev/null; then
- echo "gpled $f"
- elif head -20 "$f" | egrep -e '\([Cc]\)' > /dev/null; then
- echo "copyrighted $f"
- else
- echo "bare $f"
- fi
-done | sort