1
0
mirror of https://github.com/github/choosealicense.com synced 2025-01-03 10:31:44 +01:00

hack in supported fields

This commit is contained in:
Mike Linksvayer 2017-11-20 10:21:45 -08:00
parent eae239088e
commit 9d6bccda17
7 changed files with 36 additions and 16 deletions

View File

@ -26,7 +26,7 @@ limitations:
--- ---
Copyright (c) <year> <owner> All rights reserved. Copyright (c) [year] [fullname] All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met: modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this 1. Redistributions of source code must retain the above copyright notice, this

View File

@ -26,7 +26,7 @@ limitations:
--- ---
The Clear BSD License The Clear BSD License
Copyright (c) [xxxx]-[xxxx] [Owner Organization] Copyright (c) [year] [fullname]
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
modification, are permitted (subject to the limitations in the disclaimer modification, are permitted (subject to the limitations in the disclaimer
@ -36,9 +36,9 @@ below) provided that the following conditions are met:
* Redistributions in binary form must reproduce the above copyright * Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution. documentation and/or other materials provided with the distribution.
* Neither the name of [Owner Organization] nor the names of its * Neither the name of [fullname] nor the names of its contributors may be
contributors may be used to endorse or promote products derived from this used to endorse or promote products derived from this software without
software without specific prior written permission. specific prior written permission.
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY
THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT

View File

@ -25,7 +25,7 @@ limitations:
--- ---
Copyright (c) <year> <owner>. All rights reserved. Copyright (c) [year] [fullname]. All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met: modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this 1. Redistributions of source code must retain the above copyright notice, this

View File

@ -28,8 +28,7 @@ limitations:
--- ---
ISC License: ISC License:
Copyright (c) 2004-2010 by Internet Systems Consortium, Inc. ("ISC") Copyright (c) [year], [fullname]
Copyright (c) 1995-2003 by Internet Software Consortium
Permission to use, copy, modify, and/or distribute this software for any Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies. copyright notice and this permission notice appear in all copies.

View File

@ -30,7 +30,7 @@ limitations:
--- ---
MIT License MIT License
Copyright (c) <year> <copyright holders> Copyright (c) [year] [fullname]
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights in the Software without restriction, including without limitation the rights

View File

@ -29,9 +29,8 @@ limitations:
--- ---
University of Illinois/NCSA Open Source License University of Illinois/NCSA Open Source License
Copyright (c) <Year> <Owner Organization Name>. All rights reserved. Copyright (c) [year] [fullname]. All rights reserved.
Developed by: <Name of Development Group> <Name of Institution> <URL for Developed by: [fullname] [project] [project_url]
Development Group/Institution>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
with the Software without restriction, including without limitation the rights with the Software without restriction, including without limitation the rights
@ -43,10 +42,9 @@ furnished to do so, subject to the following conditions:
* Redistributions in binary form must reproduce the above copyright * Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimers in the notice, this list of conditions and the following disclaimers in the
documentation and/or other materials provided with the distribution. documentation and/or other materials provided with the distribution.
* Neither the names of <Name of Development Group, Name of Institution>, * Neither the names of [fullname], [project], nor the names of its
nor the names of its contributors may be used to endorse or promote contributors may be used to endorse or promote products derived from this
products derived from this Software without specific prior written Software without specific prior written permission.
permission.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE

View File

@ -17,6 +17,29 @@ site.collections['licenses'].docs.each do |license|
puts "Updating the #{license.data['title']}..." puts "Updating the #{license.data['title']}..."
text_file = File.join(text_dir, "#{license.data['spdx-id']}.txt") text_file = File.join(text_dir, "#{license.data['spdx-id']}.txt")
spdx_text = File.read(text_file).gsub(/\s+\n/, "\n") spdx_text = File.read(text_file).gsub(/\s+\n/, "\n")
license_key = license.data['spdx-id'].downcase
if ['bsd-2-clause', 'bsd-3-clause'].include? license_key
spdx_text = spdx_text.gsub(/<year>/, '[year]')
spdx_text = spdx_text.gsub(/<owner>/, '[fullname]')
elsif license_key == 'bsd-3-clause-clear'
spdx_text = spdx_text.gsub(/\[xxxx\]-\[xxxx\]/, '[year]')
spdx_text = spdx_text.gsub(/\[Owner Organization\]/, '[fullname]')
elsif license_key == 'isc'
spdx_text = spdx_text.gsub(/Copyright.*Consortium/m, 'Copyright (c) [year], [fullname]')
elsif license_key == 'mit'
spdx_text = spdx_text.gsub(/<year>/, '[year]')
spdx_text = spdx_text.gsub(/<copyright holders>/, '[fullname]')
elsif license_key == 'ncsa'
spdx_text = spdx_text.gsub(/<Year>/, '[year]')
spdx_text = spdx_text.gsub(/<Owner Organization Name>/, '[fullname]')
spdx_text = spdx_text.gsub(/<Name of Development Group>/, '[fullname]')
spdx_text = spdx_text.gsub(/<Name of Institution>/, '[project]')
spdx_text = spdx_text.gsub(%r{<URL for Development Group/Institution>}, '[project_url]')
spdx_text = spdx_text.gsub(/<Name of Development Group, Name of Institution>/, '[fullname], [project]')
end
license_text = '' license_text = ''
spdx_text.lines.each do |line| spdx_text.lines.each do |line|