1 |
commit: cb9b2f139fb89bd77e9b0572ef5a92a68ee6cee2 |
2 |
Author: Alexis Ballier <aballier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jun 8 15:09:22 2017 +0000 |
4 |
Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jun 8 15:09:22 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/tex.git/commit/?id=cb9b2f13 |
7 |
|
8 |
generate license from texlive files instead of parsing html with regexpes... |
9 |
|
10 |
scripts/texlive/tlpsrc/Makefile | 13 +++++----- |
11 |
scripts/texlive/tlpsrc/Makefile-dist | 6 ----- |
12 |
.../tlpsrc/cataloguelicense2gentoolicense.sh | 30 ++++++++++++++++++++++ |
13 |
scripts/texlive/tlpsrc/getlicense.sh | 2 +- |
14 |
4 files changed, 37 insertions(+), 14 deletions(-) |
15 |
|
16 |
diff --git a/scripts/texlive/tlpsrc/Makefile b/scripts/texlive/tlpsrc/Makefile |
17 |
index e35bcd9..900fad3 100644 |
18 |
--- a/scripts/texlive/tlpsrc/Makefile |
19 |
+++ b/scripts/texlive/tlpsrc/Makefile |
20 |
@@ -30,7 +30,7 @@ unpacked : $(FULLDESC:%=%.unpacked) |
21 |
%.srclist: %.tlpobj |
22 |
./gensrc.sh $(shell cat $(<:%.tlpobj=%.list)) > $@ |
23 |
|
24 |
-%.licenselist: %.cataloguehtml |
25 |
+%.licenselist: %.tlplic |
26 |
./getlicense.sh $(shell cat $(@:%.licenselist=%.list)) | sort | uniq | tr '\n' ' ' > $@ |
27 |
|
28 |
%.gentoolicense: %.licenselist |
29 |
@@ -65,6 +65,7 @@ clean: |
30 |
$(RMF) $(FULLDESC:%=%.list) |
31 |
$(RMF) $(FULLDESC:%=%.srclist) |
32 |
$(RMF) $(FULLDESC:%=%.doclist) |
33 |
+ $(RMF) $(FULLDESC:%=%.fulllist) |
34 |
$(RMF) $(FULLDESC:%=%.licenselist) |
35 |
$(RMF) $(FULLDESC:%=%.base) |
36 |
$(RMF) $(FULLDESC:%=%.versionnedzips) |
37 |
@@ -76,7 +77,6 @@ clean: |
38 |
$(RMF) $(DESC:%=%.metadata) |
39 |
$(RMF) *.tlpobj |
40 |
$(RMF) *.tlplic |
41 |
- $(RMF) *.cataloguehtml |
42 |
$(RMF) *.unpacked |
43 |
$(RMF) tldir |
44 |
|
45 |
@@ -100,12 +100,11 @@ clean: |
46 |
$(MAKE) CONTENTS="$(shell cat $<)" -f Makefile-dist tlpobj |
47 |
touch $@ |
48 |
|
49 |
-%.tlplic: %.list |
50 |
- $(MAKE) CONTENTS="$(shell cat $<)" -f Makefile-dist tlplic |
51 |
- touch $@ |
52 |
+%.fulllist: %.list %.doclist %.srclist |
53 |
+ cat $^ | tr '\n' ' ' > $@ |
54 |
|
55 |
-%.cataloguehtml: %.list |
56 |
- $(MAKE) CONTENTS="$(shell cat $<)" -f Makefile-dist cataloguehtml |
57 |
+%.tlplic: %.fulllist |
58 |
+ $(MAKE) CONTENTS="$(shell cat $<)" -f Makefile-dist tlplic |
59 |
touch $@ |
60 |
|
61 |
%-post-ebuild: |
62 |
|
63 |
diff --git a/scripts/texlive/tlpsrc/Makefile-dist b/scripts/texlive/tlpsrc/Makefile-dist |
64 |
index 3a7c625..023e141 100644 |
65 |
--- a/scripts/texlive/tlpsrc/Makefile-dist |
66 |
+++ b/scripts/texlive/tlpsrc/Makefile-dist |
67 |
@@ -22,12 +22,6 @@ tlplic: $(CONTENTS:%=%.tlplic) |
68 |
%.tlpobj: $(TL_TRUNK)/Master/tlpkg/tlpsrc/%.tlpsrc |
69 |
$(TL_TRUNK)/Master/tlpkg/bin/tl-update-tlpdb -master=$(TL_TRUNK)/Master -output=$@ --tlpsrc-from-cmdline $< |
70 |
|
71 |
-%.cataloguehtml: |
72 |
- curl -I http://www.ctan.org/pkg/$(@:%.cataloguehtml=%) | grep 404 || wget -O $@ http://www.ctan.org/pkg/$(@:%.cataloguehtml=%) |
73 |
- touch $@ |
74 |
- |
75 |
-cataloguehtml: $(CONTENTS:%=%.cataloguehtml) |
76 |
- |
77 |
tldir: |
78 |
mkdir tlunpackdir |
79 |
touch $@ |
80 |
|
81 |
diff --git a/scripts/texlive/tlpsrc/cataloguelicense2gentoolicense.sh b/scripts/texlive/tlpsrc/cataloguelicense2gentoolicense.sh |
82 |
index 512022a..6a13b4d 100755 |
83 |
--- a/scripts/texlive/tlpsrc/cataloguelicense2gentoolicense.sh |
84 |
+++ b/scripts/texlive/tlpsrc/cataloguelicense2gentoolicense.sh |
85 |
@@ -13,6 +13,10 @@ while [ $# -gt 0 ] ; do |
86 |
echo "GPL-3";; |
87 |
gpl3+) |
88 |
echo "GPL-3+";; |
89 |
+ gpl3+cc-by-sa-4) |
90 |
+ $0 gpl3+ cc-by-sa-4;; |
91 |
+ gplofllppl) |
92 |
+ $0 gpl ofl lppl;; |
93 |
lppl1) |
94 |
echo "LPPL-1.3";; |
95 |
lppl) |
96 |
@@ -23,6 +27,18 @@ while [ $# -gt 0 ] ; do |
97 |
echo "LPPL-1.3";; |
98 |
lppl1.3c) |
99 |
echo "LPPL-1.3c";; |
100 |
+ # Some tlpobj from texlive have this like that. This means both and are |
101 |
+ # only few of them, so split manually. |
102 |
+ lppl1.3ofl) |
103 |
+ $0 lppl1.3 ofl;; |
104 |
+ lppl1.3lppl1.3) |
105 |
+ $0 lppl1.3;; |
106 |
+ lpplgpl) |
107 |
+ $0 lppl gpl;; |
108 |
+ lpplgpl2) |
109 |
+ $0 lppl gpl2;; |
110 |
+ lppllppl) |
111 |
+ $0 lppl;; |
112 |
gfl) |
113 |
echo "LPPL-1.3";; |
114 |
gfsl) |
115 |
@@ -37,6 +53,10 @@ while [ $# -gt 0 ] ; do |
116 |
echo "GPL-2";; |
117 |
other-free) |
118 |
echo "TeX-other-free";; |
119 |
+ other-freelppl) |
120 |
+ $0 other-free lppl;; |
121 |
+ other-freelppl1.3) |
122 |
+ $0 other-free lppl1.3;; |
123 |
#other) |
124 |
# echo "TeX-other";; |
125 |
other-nonfree) |
126 |
@@ -49,6 +69,8 @@ while [ $# -gt 0 ] ; do |
127 |
echo "LGPL-3";; |
128 |
pd) |
129 |
echo "public-domain";; |
130 |
+ pdgpl3) |
131 |
+ $0 pd gpl3;; |
132 |
apache2) |
133 |
echo "Apache-2.0";; |
134 |
artistic2) |
135 |
@@ -65,10 +87,18 @@ while [ $# -gt 0 ] ; do |
136 |
echo "FDL-1.1";; |
137 |
ofl) |
138 |
echo "OFL";; |
139 |
+ oflapache2lppl1.3) |
140 |
+ $0 ofl apache2 lppl1.3;; |
141 |
+ ofllppl) |
142 |
+ $0 ofl lppl;; |
143 |
+ ofllppl1.3) |
144 |
+ $0 ofl lppl1.3;; |
145 |
opl) |
146 |
echo "OPL";; |
147 |
mit) |
148 |
echo "MIT";; |
149 |
+ mitlppl) |
150 |
+ $0 mit lppl;; |
151 |
bsd2) |
152 |
echo "BSD-2";; |
153 |
#nosell) |
154 |
|
155 |
diff --git a/scripts/texlive/tlpsrc/getlicense.sh b/scripts/texlive/tlpsrc/getlicense.sh |
156 |
index 4ab1779..a417e22 100755 |
157 |
--- a/scripts/texlive/tlpsrc/getlicense.sh |
158 |
+++ b/scripts/texlive/tlpsrc/getlicense.sh |
159 |
@@ -1,5 +1,5 @@ |
160 |
#!/bin/bash |
161 |
while [ $# -gt 0 ] ; do |
162 |
- cat $1.cataloguehtml | tr '"' '\n' | grep '\/license\/' | tr '/' ' ' | awk '{print $2}' |
163 |
+ grep '^catalogue-license' $1.tlplic | awk '{print $2}' |
164 |
shift |
165 |
done |