Skip to content

Commit 9a15c43

Browse files
committed
Scan LICENSE files in descendants
1 parent 7731a12 commit 9a15c43

File tree

1 file changed

+2
-21
lines changed

1 file changed

+2
-21
lines changed

lib/node_modules/@stdlib/_tools/scripts/publish_packages.js

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -486,12 +486,8 @@ function publish( pkg, clbk ) {
486486
} else {
487487
fs.copyFileSync( join( __dirname, 'templates', 'license_apache2.txt' ), join( dist, 'LICENSE' ) );
488488
command = [
489-
'# Extract pattern from all files:',
490-
'find '+dist+' -type f -name "*.js" -exec cat {} \\; | sed -n \'/^\\* ```/,/^\\* ```/p\' | sed \'s/^\\* ```text//\' | sed \'s/```$//\' > LICENSE.tmp',
491-
'',
492-
'# Remove leading asterisks in each line including lines with only asterisks and no following text:',
493-
'sed -i \'s/^\\* //\' LICENSE.tmp',
494-
'sed -i \'s/^\\*//\' LICENSE.tmp',
489+
'# Extract custom licenses from all descendant packages:',
490+
'find '+src+' -type f -name "LICENSE" -exec cat {} \\; > LICENSE.tmp',
495491
'',
496492
'# Check whether LICENSE.tmp is empty:',
497493
'if [ -s LICENSE.tmp ]; then',
@@ -502,21 +498,6 @@ function publish( pkg, clbk ) {
502498
' # Remove duplicate licenses, i.e., multiline strings:',
503499
' awk -v RS= \'!x[$0]++{print; print ""}\' LICENSE.out > LICENSE.tmp',
504500
'',
505-
' # Prepend individual licenses with respective heading:',
506-
' perl -0777 -pe \'s/The MIT License \\(MIT\\)\n\nCopyright \\(c\\) 2017 Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and others/\\* SpecialFunctions.jl \\<https:\\/\\/raw.githubusercontent.com\\/JuliaMath\\/SpecialFunctions.jl\\/02a173fbe24a61c4b392aec17a9764ac5727feb1\\/LICENSE\\>\n\nThe MIT License \\(MIT\\)\n\nCopyright \\(c\\) 2017 Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and others/\' LICENSE.tmp > LICENSE.out',
507-
'',
508-
' sed -i \'s/Copyright (c) 2011-2014, The OpenBLAS Project/\\* OpenBLAS <https:\\/\\/raw.githubusercontent.com\\/xianyi\\/OpenBLAS\\/\ndef146efed8d5908ea04e22668feeab7099599a0\\/LICENSE>\n\nCopyright (c) 2011-2014, The OpenBLAS Project/\' LICENSE.out',
509-
' sed -i \'s/Copyright (c) 2013-2017 GitHub Inc./\\* Electron <https:\\/\\/raw.githubusercontent.com\\/electron\\/electron\\/\nc4cfb3e7110266b9d7ad80e1ae097c4db564501c\\/LICENSE>\n\nCopyright (c) 2013-2017 GitHub Inc./\' LICENSE.out',
510-
' sed -i \'s/Boost Software License - Version 1.0 - August 17th, 2003/\\* Boost <http:\\/\\/www.boost.org\\/LICENSE_1_0.txt>\n\nBoost Software License - Version 1.0 - August 17th, 2003/\' LICENSE.out',
511-
' sed -i \'s/Copyright (c) 1984-2000 Stephen L. Moshier/\\* Cephes <http:\\/\\/www.netlib.org\\/cephes\\/readme>\n\nCopyright (c) 1984-2000 Stephen L. Moshier/\' LICENSE.out',
512-
'',
513-
' sed -i \'s/Copyright (C) 1993-2004 by Sun Microsystems, Inc. All rights reserved./\\* FreeBSD <https:\\/\\/svnweb.freebsd.org\\/base\\/head\\/license.html>\n\nCopyright (C) 1993-2004 by Sun Microsystems, Inc. All rights reserved./\' LICENSE.out',
514-
' sed -i \'s/Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved./\\* FDLIBM <http:\\/\\/www.netlib.org\\/fdlibm\\/LICENSE>\n\nCopyright (C) 2004 by Sun Microsystems, Inc. All rights reserved./\' LICENSE.out',
515-
' sed -i \'s/Copyright (c) 2009 The Go Authors. All rights reserved./\\* Go <https:\\/\\/raw.githubusercontent.com\/golang\\/go\\/master\\/LICENSE>\n\nCopyright (c) 2009 The Go Authors. All rights reserved./\' LICENSE.out',
516-
'',
517-
' sed -i \'s/Copyright (c) 2015: Dahua Lin./\\* StatsFuns.jl <https:\\/\\/raw.githubusercontent.com\\/JuliaStats\\/StatsFuns.jl\\/\ne66dd973650c375bc1739c820e5b96bb5bd000a8\\/LICENSE.md>\n\nCopyright (c) 2015: Dahua Lin./\' LICENSE.out',
518-
' sed -i \'s/Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura/\\* MT19937 <http:\\/\\/www.math.sci.hiroshima-u.ac.jp\\/~m-mat\\/MT\\/MT2002\\/CODES\\/mt19937ar.c>\n\nCopyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura/\' LICENSE.out',
519-
'',
520501
' # Move LICENSE.out to LICENSE:',
521502
' mv LICENSE.out '+dist+'/LICENSE',
522503
'',

0 commit comments

Comments
 (0)