aboutsummaryrefslogtreecommitdiff
blob: f86f6ea28a6a69134865fdd2b4fcea82fe322fcf (plain)
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
#!/bin/bash
# Copyright 2015 Gentoo Foundation
# Distributed under the terms of the GNU GPL version 2 or later
# Author: Markos Chandras <hwoarang@gentoo.org>

tmpfile="/tmp/mn-pkglist$$.tmp"

cleanup () {
	[[ -e ${tmpfile} ]] && rm ${tmpfile}
}

portageq --no-filters --orphaned -n > ${tmpfile} || { cleanup; exit 1; }

echo """
<html>
	<head>
		<style type=\"text/css\"> li a { font-family: monospace; display: block; float: left; }</style>
		<title>Orphan packages</title>
	</head>
	<body>
		List generated on $(date)<br/>
		Total packages: <b>$(wc -l ${tmpfile} | cut -d ' '  -f1)</b><br/><br/>
		<table frame="box" rules="all">
			<tr>
				<th>Package Name</th>
				<th>Description</th>
				<th>Open bugs</th>
			</tr>
"""

while read pkg; do
	echo """
			<tr>
				<td>${pkg}</td>
				<td>$(pquery --no-version --one-attr description ${pkg})</td>
				<td><a href=\"https://bugs.gentoo.org/buglist.cgi?quicksearch=${pkg}\">Open Bugs</a></td>
			</tr>
	"""
done < ${tmpfile}

echo """
		</table>
	</body>
</html>
"""

cleanup

exit 0