From 8d5abe7b160addeacf19f099e689cb439918e835 Mon Sep 17 00:00:00 2001 From: Lauri Tirkkonen Date: Thu, 30 Aug 2018 23:17:18 +0300 Subject: [PATCH] libc: remove THIRDPARTYLICENSE/extract-copyright the extract-copyright script happens to use ksh93 associative arrays in a creative way that is not (easily) translatable into ksh. since our packages' license metadata is horribly inaccurate anyway, just remove it. --- usr/src/lib/libc/Makefile | 8 +-- usr/src/lib/libc/extract-copyright.sh | 113 ---------------------------------- 2 files changed, 1 insertion(+), 120 deletions(-) delete mode 100755 usr/src/lib/libc/extract-copyright.sh diff --git a/usr/src/lib/libc/Makefile b/usr/src/lib/libc/Makefile index f3b8966ff8..01fac5d07c 100644 --- a/usr/src/lib/libc/Makefile +++ b/usr/src/lib/libc/Makefile @@ -65,8 +65,6 @@ BASEHDRS= getxby_door.h CHECKHDRS= $(BASEHDRS:%.h=port/gen/%.check) HDRS= $(BASEHDRS) -CLOBBERFILES += THIRDPARTYLICENSE extract-copyright - # install rules for install_h target $(ROOTHDRDIR)/%: port/gen/% $(INS.file) @@ -78,11 +76,7 @@ $(ROOTFS_LIBDIR64)/$(DYNLIB) := FILEMODE = 755 .KEEP_STATE: -all: all_h lib32 $(BUILD64) .WAIT lib64 .WAIT etc THIRDPARTYLICENSE - -THIRDPARTYLICENSE: extract-copyright - $(RM) $@ - ./extract-copyright . > $@ +all: all_h lib32 $(BUILD64) .WAIT lib64 .WAIT etc etc: $($(MACH)_ETC) diff --git a/usr/src/lib/libc/extract-copyright.sh b/usr/src/lib/libc/extract-copyright.sh deleted file mode 100755 index 350060e7da..0000000000 --- a/usr/src/lib/libc/extract-copyright.sh +++ /dev/null @@ -1,113 +0,0 @@ -#! /usr/bin/ksh93 -# -# This file and its contents are supplied under the terms of the -# Common Development and Distribution License ("CDDL"), version 1.0. -# You may only use this file in accordance with the terms version -# 1.0 of the CDDL. -# -# A full copy of the text of the CDDL should have accompanied this -# source. A copy is of the CDDL is also available via the Internet -# at http://www.illumos.org/license/CDDL. -# - -# -# Copyright 2010 Nexenta Systems, Inc. All rights reserved. -# Copyright 2014 Garett D'Amore -# Copyright 2016 Josef 'Jeff' Sipek -# - -# -# This extracts all the BSD copyrights (excluding the CDDL licenses) -# for use in a THIRDPARTYLICENSE file. It tries hard to avoid duplicates. -# - -typeset -A LICENSE - -function dofile { - typeset file - typeset comment - typeset license - typeset line - typeset copyr - typeset block - typeset -i i - - typeset nl=$(print) - file=$1 ; shift - - comment= - unset license - unset block - copyr= - - cat $file | while IFS="" read line; do - if [[ "$line" == /* ]] ; then - comment=y - copyr= - block= - continue - fi - - if [[ -z $comment ]]; then - # not in a comment - continue - fi - - # - # We don't want to know about CDDL files. They don't - # require an explicit THIRDPARTYLICENSE file. - # - if [[ "$line" == *CDDL* ]] - then - return - fi - - if [[ "$line" == *Copyright* ]] - then - copyr=y - fi - - if [[ "$line" != */ ]] - then - line="${line# \* }" - line="${line# \*}" - line="${line% \*/}" - # append to block array - block="${block}${line}"'\n' - continue - fi - - # - # We have reached the end of the comment now. - # - comment= - - # Check to see if we saw a copyright. - if [[ -z "$copyr" ]]; then - block= - continue - fi - license="${license}${block}" - block= - done - - if [[ -n "$license" ]] - then - LICENSE["${license}"]="${LICENSE["${license}"]} $file" - fi -} - -find "$@" -type f -name '*.[chs]' -print | sort | while read f -do - dofile $f -done - -for lic in "${!LICENSE[@]}"; do - print "The following files from the C library:" - for f in ${LICENSE[$lic]}; do - print " $f" - done - print "are provided under the following terms:" - print - print "$lic" -done -- 2.11.4.GIT