-
Notifications
You must be signed in to change notification settings - Fork 3
/
package_support_explorer.html
385 lines (364 loc) · 10.2 KB
/
package_support_explorer.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="support_info.css">
</head>
<body>
<h1>Package Support Explorer</h1>
<p>This page will dynamically generate the information for your set of provided packages. It is thus useful for determining how the Support Statements impact your particular system or image.</p>
<p>You can paste in a list of package names to get a custom report of all the relevant support statements with dates.</p>
<p>If you want to get the results for a specific system, pasting in the result of <code class="bash">rpm -qa --qf "%{NAME}\n"</code> is the preferred way, although if you just have the result of <code class="bash">rpm -qa</code> this page will attempt to match the full NEVRA to a package name using a rather effective regex.</p>
<p>The default set of packages is what is included in the AL1 container image, retreived with <code class="bash">docker run --rm public.ecr.aws/amazonlinux/amazonlinux:1 rpm -qa --qf "%{NAME}\n"|grep -v gpg-pubkey</code>.</p>
<p>You can change the Time to pretend it is, and this will change the highlighting in the generated table.</p>
<hr/>
<div>
<p>
<label for="thetime">Time to look at support for: </label>
<input id="thetime" size="40" type="text" onchange="refresh_support_statements(); package_list_changed()"/> (defaults to the time when this page was loaded)
<table>
<thead>
<tr>
<th>Background Color</th>
<th>Meaning</th>
</tr>
</thead>
<tbody>
<tr class="supported">
<td>Green</td>
<td>More than 180 days of support remaining from the above date</td>
</tr>
<tr class="unsupported">
<td>Red</td>
<td>As the time of the above date, the package is End of Life</td>
</tr>
<tr class="unsupportedin60">
<td>Orange</td>
<td>Fewer than 60 days of support remaining from the above date</td>
</tr>
<tr class="unsupportedin180">
<td>Yellow</td>
<td>Fewer than 180 days of support remaining from the above date</td>
</tr>
</tbody>
</table>
</p>
<p>
<label for="package_list">List of packages: </label><br/>
<textarea id="package_list" name="package_list" rows="20" cols="80" onchange="package_list_changed()">
</textarea>
</p>
<p>
<button onclick="reset_packages_to_AL1_container(); package_list_changed();">
Reset packages to AL1 Container Image
</button>
</p>
</div>
<h2>Known Support Statements</h2>
<p>Below is a list of the support statements being used</p>
<div id="support_statements">
<p>No support statements found (or javascript off/not-ready)</p>
</div>
<h1 style="margin-left: 0; margin-right: 0;">Currently Unsupported Packages</h1>
<div id="my_currently_unsupported">
<p>No unsupported packages or javascript error</p>
</div>
<h1 style="margin-left: 0; margin-right: 0;">All Packages</h1>
<div id="warnings">
<ul>
</ul>
</div>
<div id="my_package_status">
<p>No packages found (or javascript off/not-ready)</p>
</div>
<script lang="javascript">
var d = new Date(Date());
document.getElementById("thetime").value = d.toISOString();
var xhttp = new XMLHttpRequest();
var support_info;
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
support_info = xhttp.responseXML;
clear_warnings();
refresh_support_statements();
package_list_changed();
}
};
xhttp.open("GET", "support_info.xml", true);
xhttp.send();
reset_packages_to_AL1_container();
function reset_packages_to_AL1_container() {
document.getElementById("package_list").value = `basesystem
nss-softokn-freebl
nspr
libselinux
db4
readline
libacl
libxml2
libassuan
p11-kit
shared-mime-info
libpsl
libgcrypt
libunistring
ncurses
coreutils
nss-tools
libcurl
openldap
gpgme
rpm-python27
yum-metadata-parser
python27-chardet
yum-plugin-priorities
yum-utils
ncurses-base
bash
ncurses-libs
zlib
bzip2-libs
lua
libcap
libstdc++72
sed
libffi
keyutils-libs
pcre
pinentry
libidn2
libverto
nss-pem
libssh2
curl
pth
expat
python27-pycurl
python27-pyxattr
python27-kitchen
sysctl-defaults
ca-certificates
setup
tzdata
glibc-common
nss-util
info
popt
elfutils-libelf
libgpg-error
libcom_err
file-libs
pkgconfig
gmp
grep
db4-utils
make
krb5-libs
nss
gdbm
rpm-libs
gnupg2
python27
python27-urlgrabber
python27-pyliblzma
python27-iniparse
system-release
gzip
filesystem
libgcc72
glibc
libsepol
xz-libs
chkconfig
libattr
sqlite
nss-softokn
libtasn1
glib2
libicu
p11-kit-trust
cyrus-sasl-lib
gawk
openssl
nss-sysinit
libnghttp2
rpm
rpm-build-libs
python27-libs
python27-pygpgme
libxml2-python27
yum
yum-plugin-ovl
tar`;
}
function td_class(c, t) {
return "<td class=\"" + c + "\">" + t + "</td>";
}
function td(t) {
return "<td>" + t + "</td>";
}
function href(r, t) {
return "<a href=\"" + r + "\">" + t + "</a>";
}
function get_nodes_for_path(path, xml) {
var r = [];
if (xml.evaluate) {
var nodes = xml.evaluate(path, xml, null, XPathResult.ANY_TYPE, null);
var result = nodes.iterateNext();
while (result) {
if (result) {
r.push(result);
}
result = nodes.iterateNext();
}
// Code For Internet Explorer
} else if (window.ActiveXObject || xhttp.responseType == "msxml-document") {
xml.setProperty("SelectionLanguage", "XPath");
nodes = xml.selectNodes(path);
for (i = 0; i < nodes.length; i++) {
if (nodes[i]) {
r.push(nodes[i]);
}
}
}
return r;
}
function clear_warnings() {
document.getElementById("warnings").getElementsByTagName("ul")[0].replaceChildren();
}
function add_warning(t) {
li = document.createElement("li");
li.appendChild(document.createTextNode(t));
document.getElementById("warnings").getElementsByTagName("ul")[0].appendChild(li);
}
function translate_package_name(p) {
if(p.match(/^system-release-20[0-9]+\.0[39]/)) {
return "system-release";
}
return p.replace(/-([0-9:\-.][a-z]?)+.amzn[0-9]+.(noarch|x86_64|aarch64)/, '');
}
function get_note(note_id, xml) {
nodes = get_nodes_for_path("//notes/note[@id=\"" + note_id + "\"]", xml);
if (nodes.length == 0) {
add_warning("Could not find referenced note for package, note_id: " + note_id);
} else if (nodes.length > 1) {
add_warning("More than one note with note_id: " + note_id);
} else {
return nodes[0]
}
}
function get_days_remaining(d) {
var pretend_now = new Date(document.getElementById("thetime").value);
var s_date = new Date(d);
var days_remaining = ((s_date.getTime() - pretend_now.getTime()) / (1 * 24 * 60 * 60 * 1000)).toFixed();
return days_remaining;
}
function get_class_for_days_remaining(days_remaining) {
if (days_remaining < 0) {
return "unsupported";
} else if (days_remaining > 180) {
return "supported";
} else if (days_remaining > 60) {
return "unsupportedin180";
} else {
return "unsupportedin60";
}
}
function package_list_changed() {
clear_warnings();
var pl = document.getElementById("package_list").value;
var pkgs = pl.split(/\r?\n/);
var si = support_info;
var table = "<table>";
table += "<tr>"
+ "<th>Entered Package</th>"
+ "<th>Matched Package</th>"
+ "<th>Statement Start</th>"
+ "<th>Days Remaining</th>"
+ "<th>Type</th>"
+ "<th>Statement</th>"
+ "<th>Note</th>"
+ "</tr>";
var unsupported_table = table;
var i;
for (i = 0; i < pkgs.length; i++) {
var package_name = translate_package_name(pkgs[i]);
if (package_name == "")
continue;
if (package_name.match(/^gpg-pubkey-[0-9a-f]+-[0-9a-f]+$/)) {
add_warning("Skipping GPG key " + package_name);
continue;
}
path = "//package[@name=\"" + package_name + "\"]";
nodes = get_nodes_for_path(path, si);
var row = "<tr>";
var add_to_unsupported = false;
row += td(pkgs[i]);
if (nodes.length > 1 ) {
add_warning("Multiple matches for package name: " + pkgs[i])
} else if (nodes.length == 1) {
row += td(href("support_info_by_package.html#pkg-" + nodes[0].getAttribute('name'),
nodes[0].getAttribute('name')));
pkg_statement = nodes[0].parentNode.parentNode;
s = pkg_statement;
days_remaining = get_days_remaining(s.getAttribute('start_date'));
c = get_class_for_days_remaining(days_remaining);
if (c == "unsupported") {
add_to_unsupported = true;
}
row += td_class(c, s.getAttribute('start_date'));
row += td_class(c, days_remaining);
c = s.getAttribute('marker');
row += td_class(c, s.getAttribute('marker'));
row += td(
href("support_info_by_support_statement.html#" +
s.getAttribute('id'),
s.getElementsByTagName("summary")[0].innerHTML)
);
if (nodes[0].getAttribute('note')) {
row += td(get_note(nodes[0].getAttribute('note'), si).innerHTML);
}
} else {
add_warning("No matching package: " + pkgs[i]);
}
row += "</tr>";
table += row;
if (add_to_unsupported) {
unsupported_table += row;
}
}
table += "</table>";
unsupported_table += "</table>";
document.getElementById("my_package_status").innerHTML =
table;
document.getElementById("my_currently_unsupported").innerHTML =
unsupported_table;
}
function refresh_support_statements() {
var si = support_info;
var i;
var table="<table><tr><th>Summary</th><th>Type</th><th>Start</th><th>Days Remaining</th></tr>";
var statements = si.getElementsByTagName("statement");
for (i = 0; i < statements.length; i ++) {
var s = statements[i];
table += "<tr>"
+ td(
href("support_info_by_support_statement.html#" +
s.getAttribute('id'),
s.getElementsByTagName("summary")[0].innerHTML));
marker = s.getAttribute('marker');
table += td_class(marker, marker);
start_date = s.getAttribute('start_date');
if (start_date) {
days_remaining = get_days_remaining(start_date);
c = get_class_for_days_remaining(days_remaining);
table += td_class(c, start_date);
table += td_class(c, days_remaining);
}
table += "</tr>";
}
table += "</table>";
document.getElementById("support_statements").innerHTML = table;
};
</script>
</body>
</html>