summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_html_dd_list.sh
blob: b9aede87b144d0825edb38411b98ebfbe8bab699 (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
#!/bin/bash

# Copyright 2014 Holger Levsen <holger@layer-acht.org>
#         © 2015 Mattia Rizzolo <mattia@mapreri.org>
# released under the GPLv=2

DEBUG=false
. /srv/jenkins/bin/common-functions.sh
common_init "$@"

# common code defining db access
. /srv/jenkins/bin/reproducible_common.sh

set +x
init_html

VIEW=dd-list
PAGE=index_${VIEW}.html
echo "$(date) - starting to write $PAGE page."
write_page_header $VIEW "Overview of ${SPOKENTARGET[$VIEW]}"
TMPFILE=$(mktemp)
SOURCES=$(mktemp)
schroot --directory /tmp -c source:jenkins-reproducible-sid cat /var/lib/apt/lists/*_source_Sources > $SOURCES || \
    wget ${MIRROR}/dists/sid/main/source/Sources.xz -O - | xzcat > $SOURCES
BAD=$(sqlite3 -init $INIT $PACKAGES_DB 'SELECT s.name FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE r.status="unreproducible" AND s.suite="sid" ORDER BY r.build_date DESC' | xargs echo)
echo "${BAD}" | dd-list --stdin --sources $SOURCES > $TMPFILE || true
write_page "<p>The following maintainers and uploaders are listed for packages within Sid which have built unreproducibly:</p><p><pre>"
while IFS= read -r LINE ; do
	if [ "${LINE:0:3}" = "   " ] ; then
		PACKAGE=$(echo "${LINE:3}" | cut -d " " -f1)
		UPLOADERS=$(echo "${LINE:3}" | cut -d " " -f2-)
		if [ "$UPLOADERS" = "$PACKAGE" ] ; then
			UPLOADERS=""
		fi
		write_page "   <a href=\"/rb-pkg/sid/amd64/$PACKAGE.html\">$PACKAGE</a> $UPLOADERS"
	else
		LINE="$(echo $LINE | sed 's#&#\&amp;#g ; s#<#\&lt;#g ; s#>#\&gt;#g')"
		write_page "$LINE"
	fi
done < $TMPFILE
write_page "</pre></p>"
rm $TMPFILE
rm $SOURCES
write_page_footer
publish_page