]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: convert to SPDX license tags
authorDave Chinner <dchinner@redhat.com>
Thu, 28 Jun 2018 20:11:58 +0000 (15:11 -0500)
committerEric Sandeen <sandeen@redhat.com>
Thu, 28 Jun 2018 20:11:58 +0000 (15:11 -0500)
commit37b3b4d6c38aaf501dd7714d9670bff4ac282923
tree24a2e00064128d0c8e6e7a20fe3c0a35090b4a89
parentec2919897ff2e41603d2a0ab713e4d3afc5bc557
xfs: convert to SPDX license tags

Source kernel commit: 0b61f8a4079d904b1b1d47946cca898313de8c26

Remove the verbose license text from XFS files and replace them
with SPDX tags. This does not change the license of any of the code,
merely refers to the common, up-to-date license files in LICENSES/

This change was mostly scripted. fs/xfs/Makefile and
fs/xfs/libxfs/xfs_fs.h were modified by hand, the rest were detected
and modified by the following command:

for f in `git grep -l "GNU General" fs/xfs/` ; do
echo $f
cat $f | awk -f hdr.awk > $f.new
mv -f $f.new $f
done

And the hdr.awk script that did the modification (including
detecting the difference between GPL-2.0 and GPL-2.0+ licenses)
is as follows:

$ cat hdr.awk
BEGIN {
hdr = 1.0
tag = "GPL-2.0"
str = ""
}

/^ \* This program is free software/ {
hdr = 2.0;
next
}

/any later version./ {
tag = "GPL-2.0+"
next
}

/^ \*\// {
if (hdr > 0.0) {
print "// SPDX-License-Identifier: " tag
print str
print $0
str=""
hdr = 0.0
next
}
print $0
next
}

/^ \* / {
if (hdr > 1.0)
next
if (hdr > 0.0) {
if (str != "")
str = str "\n"
str = str $0
next
}
print $0
next
}

/^ \*/ {
if (hdr > 0.0)
next
print $0
next
}

// {
if (hdr > 0.0) {
if (str != "")
str = str "\n"
str = str $0
next
}
print $0
}

END { }
$

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
67 files changed:
libxfs/xfs_ag_resv.c
libxfs/xfs_ag_resv.h
libxfs/xfs_alloc.c
libxfs/xfs_alloc.h
libxfs/xfs_alloc_btree.c
libxfs/xfs_alloc_btree.h
libxfs/xfs_attr.c
libxfs/xfs_attr_leaf.c
libxfs/xfs_attr_leaf.h
libxfs/xfs_attr_remote.c
libxfs/xfs_attr_remote.h
libxfs/xfs_attr_sf.h
libxfs/xfs_bit.c
libxfs/xfs_bit.h
libxfs/xfs_bmap.c
libxfs/xfs_bmap.h
libxfs/xfs_bmap_btree.c
libxfs/xfs_bmap_btree.h
libxfs/xfs_btree.c
libxfs/xfs_btree.h
libxfs/xfs_da_btree.c
libxfs/xfs_da_btree.h
libxfs/xfs_da_format.c
libxfs/xfs_da_format.h
libxfs/xfs_defer.c
libxfs/xfs_defer.h
libxfs/xfs_dir2.c
libxfs/xfs_dir2.h
libxfs/xfs_dir2_block.c
libxfs/xfs_dir2_data.c
libxfs/xfs_dir2_leaf.c
libxfs/xfs_dir2_node.c
libxfs/xfs_dir2_priv.h
libxfs/xfs_dir2_sf.c
libxfs/xfs_dquot_buf.c
libxfs/xfs_errortag.h
libxfs/xfs_format.h
libxfs/xfs_fs.h
libxfs/xfs_ialloc.c
libxfs/xfs_ialloc.h
libxfs/xfs_ialloc_btree.c
libxfs/xfs_ialloc_btree.h
libxfs/xfs_iext_tree.c
libxfs/xfs_inode_buf.c
libxfs/xfs_inode_buf.h
libxfs/xfs_inode_fork.c
libxfs/xfs_inode_fork.h
libxfs/xfs_log_format.h
libxfs/xfs_log_rlimit.c
libxfs/xfs_quota_defs.h
libxfs/xfs_refcount.c
libxfs/xfs_refcount.h
libxfs/xfs_refcount_btree.c
libxfs/xfs_refcount_btree.h
libxfs/xfs_rmap.c
libxfs/xfs_rmap.h
libxfs/xfs_rmap_btree.c
libxfs/xfs_rmap_btree.h
libxfs/xfs_rtbitmap.c
libxfs/xfs_sb.c
libxfs/xfs_sb.h
libxfs/xfs_shared.h
libxfs/xfs_symlink_remote.c
libxfs/xfs_trans_resv.c
libxfs/xfs_trans_resv.h
libxfs/xfs_trans_space.h
libxfs/xfs_types.h