From 5a5642e65f44d7f253674bfd03f576d53c8a27a7 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Mon, 23 Feb 2015 17:23:22 +0100 Subject: reproducible: new page 'repo_stats' --- bin/reproducible_html_repo_stats.sh | 61 +++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100755 bin/reproducible_html_repo_stats.sh (limited to 'bin/reproducible_html_repo_stats.sh') diff --git a/bin/reproducible_html_repo_stats.sh b/bin/reproducible_html_repo_stats.sh new file mode 100755 index 00000000..3506ad1f --- /dev/null +++ b/bin/reproducible_html_repo_stats.sh @@ -0,0 +1,61 @@ +#!/bin/bash + +# Copyright 2015 Holger Levsen +# 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=repo_stats +PAGE=index_${VIEW}.html +echo "$(date) - starting to write $PAGE page." +write_page_header $VIEW "Overview of ${SPOKENTARGET[$VIEW]}" +TMPFILE=$(mktemp) +TMPSCRIPT=$(mktemp) +echo "cat /var/lib/apt/lists/reproducible.alioth.debian.org_debian_._Packages" > $TMPSCRIPT +sudo pbuilder --execute --basetgz /var/cache/pbuilder/base-reproducible.tgz $TMPSCRIPT > $TMPFILE +grep -v ^I:\ $TMPFILE > $TMPSCRIPT +mv $TMPSCRIPT $TMPFILE + +write_page "

The source packages are different from sid in our toolchain. They are available in an apt repository on alioth which is accessable with these sources.lists entries:" +write_page "deb http://reproducible.alioth.debian.org/debian/ ./" +write_page "deb-src http://reproducible.alioth.debian.org/debian/ ./" +write_page "

" +write_page "

" +SOURCES=$(grep-dctrl -n -s source -FArchitecture amd64 -o -FArchitecture all $TMPFILE | sort -u) +for PKG in $SOURCES ; do + write_page "td>$PKG" +done +write_page "
source packageversion(s)
" + VERSIONS=$(grep-dctrl -n -s version -S $PKG $TMPFILE|sort -u) + BET="" + for VERSION in ${VERSIONS} ; do + if [ "$BET" = "" ] ; then + BET=${VERSION} + continue + elif dpkg --compare-versions "$BET" lt "${VERSION}" ; then + BET=${VERSION} + fi + done + write_page "$BET
" + WARNED=false + for VERSION in ${VERSIONS} ; do + if [ "${VERSION}" != "$BET" ] ; then + write_page "${VERSION}
" + elif ! $WARNED ; then + echo "Warning: more than one version of $PKG available in our repo, please clean up." + WARNED=true + fi + done + write_page "

" +rm $TMPFILE +write_page_footer +publish_page + -- cgit v1.2.3-70-g09d2