Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
Eigen
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
llvm
Eigen
Commits
d4ca0963
Commit
d4ca0963
authored
13 years ago
by
Keir Mierle
Browse files
Options
Downloads
Patches
Plain Diff
Add preliminary script to relicense Eigen to MPL2.
parent
904ecdf9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/relicense.py
+69
-0
69 additions, 0 deletions
scripts/relicense.py
with
69 additions
and
0 deletions
scripts/relicense.py
0 → 100644
+
69
−
0
View file @
d4ca0963
# This file is part of Eigen, a lightweight C++ template library
# for linear algebra.
#
# Copyright (C) 2012 Keir Mierle <mierle@gmail.com>
#
# This Source Code Form is subject to the terms of the Mozilla
# Public License v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Author: mierle@gmail.com (Keir Mierle)
#
# Make the long-awaited conversion to MPL.
lgpl3_header
=
'''
// Eigen is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 3 of the License, or (at your option) any later version.
//
// Alternatively, you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of
// the License, or (at your option) any later version.
//
// Eigen is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License and a copy of the GNU General Public License along with
// Eigen. If not, see <http://www.gnu.org/licenses/>.
'''
mpl2_header
=
"""
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""
import
os
import
sys
exclusions
=
set
([
'
relicense.py
'
])
def
update
(
text
):
if
text
.
find
(
lgpl3_header
)
==
-
1
:
return
text
,
False
return
text
.
replace
(
lgpl3_header
,
mpl2_header
),
True
rootdir
=
sys
.
argv
[
1
]
for
root
,
sub_folders
,
files
in
os
.
walk
(
rootdir
):
for
basename
in
files
:
if
basename
in
exclusions
:
print
'
SKIPPED
'
,
filename
continue
filename
=
os
.
path
.
join
(
root
,
basename
)
fo
=
file
(
filename
)
text
=
fo
.
read
()
fo
.
close
()
text
,
updated
=
update
(
text
)
if
updated
:
fo
=
file
(
filename
,
"
w
"
)
fo
.
write
(
text
)
fo
.
close
()
print
'
UPDATED
'
,
filename
else
:
print
'
'
,
filename
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment