"
fi
if [ "$1" = "dd-list" ] || [ "$1" = "stats" ] ; then
write_page " Join #debian-reproducible on OFTC or send us an email to get support for making sure your packages build reproducibly too!"
write_page "
"
fi
write_page "
Have a look at:
"
for MY_STATE in $ALLSTATES ; do
set_icon $MY_STATE
write_page "
"
write_icon
write_page "
"
done
for TARGET in $ALLVIEWS ; do
if [ "$TARGET" = "pkg_sets" ] && [ "$SUITE" = "experimental" ] ; then
# no pkg_sets are tested in experimental
continue
fi
SPOKEN_TARGET=${SPOKENTARGET[$TARGET]}
BASEURL="/$SUITE/$ARCH"
for i in $GLOBALVIEWS ; do
if [ "$TARGET" = "$i" ] ; then
BASEURL=""
fi
done
for i in ${SUITEVIEWS} ; do
if [ "$TARGET" = "$i" ] ; then
BASEURL="/$SUITE"
fi
done
write_page "
A package name displayed with a bold font is an indication that this package has a note. Visited packages are linked in green, those which have not been visited are linked in blue.
"
}
publish_page() {
if [ "$1" = "" ] ; then
if [ "$VIEW" = "$MAINVIEW" ] ; then
cp $PAGE /var/lib/jenkins/userContent/reproducible.html
fi
TARGET=$PAGE
else
TARGET=$1/$PAGE
fi
cp $PAGE /var/lib/jenkins/userContent/$TARGET
rm $PAGE
echo "Enjoy $REPRODUCIBLE_URL/$TARGET"
}
set_package_class() {
if [ -f ${NOTES_PATH}/${PKG}_note.html ] ; then
CLASS="class=\"noted\""
else
CLASS="class=\"package\""
fi
}
set_linktarget() {
for PKG in $@ ; do
if [ -f $RB_PATH/$SUITE/$ARCH/$PKG.html ] ; then
set_package_class
LINKTARGET[$PKG]="$PKG"
else
LINKTARGET[$PKG]="$PKG"
fi
done
}
link_packages() {
for PKG in $@ ; do
write_page " ${LINKTARGET[$PKG]}"
done
}
gen_packages_html() {
local suite="$1"
shift
CWD=$(pwd)
cd /srv/jenkins/bin
for (( i=1; i<$#+1; i=i+100 )) ; do
string='['
delimiter=''
for (( j=0; j<100; j++)) ; do
item=$(( $j+$i ))
if (( $item < $#+1 )) ; then
string+="${delimiter}\"${!item}\""
delimiter=','
fi
done
string+=']'
python3 -c "from reproducible_html_packages import gen_packages_html; gen_packages_html(${string}, suite=\"${suite}\", no_clean=True)"
done
python3 -c "from reproducible_html_packages import purge_old_pages; purge_old_pages()"
cd "$CWD"
}
gather_schedule_stats() {
SCHEDULED=$(sqlite3 -init $INIT $PACKAGES_DB "SELECT name FROM sources_scheduled ORDER BY date_scheduled" | xargs echo)
COUNT_SCHEDULED=$(sqlite3 -init $INIT $PACKAGES_DB "SELECT count(name) FROM sources_scheduled" | xargs echo)
QUERY=" SELECT count(sources.name) FROM sources,source_packages
WHERE sources.name NOT IN
(SELECT sources.name FROM sources,sources_scheduled
WHERE sources.name=sources_scheduled.name)
AND sources.name IN
(SELECT sources.name FROM sources,source_packages
WHERE sources.name=source_packages.name
AND sources.version!=source_packages.version
AND source_packages.status!='blacklisted')
AND sources.name=source_packages.name"
COUNT_NEW_VERSIONS=$(sqlite3 -init $INIT $PACKAGES_DB "$QUERY")
}
gather_stats() {
COUNT_BAD=$(sqlite3 -init $INIT $PACKAGES_DB "SELECT COUNT(s.name) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite='$SUITE' AND r.status = \"unreproducible\"")
COUNT_UGLY=$(sqlite3 -init $INIT $PACKAGES_DB "SELECT COUNT(s.name) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite='$SUITE' AND r.status = \"FTBFS\"")
COUNT_SOURCELESS=$(sqlite3 -init $INIT $PACKAGES_DB "SELECT COUNT(s.name) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite='$SUITE' AND r.status = \"404\"")
COUNT_NOTFORUS=$(sqlite3 -init $INIT $PACKAGES_DB "SELECT COUNT(s.name) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite='$SUITE' AND r.status = \"not for us\"")
COUNT_BLACKLISTED=$(sqlite3 -init $INIT $PACKAGES_DB "SELECT COUNT(s.name) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite='$SUITE' AND r.status = \"blacklisted\"")
PERCENT_BAD=$(echo "scale=1 ; ($COUNT_BAD*100/$COUNT_TOTAL)" | bc)
PERCENT_UGLY=$(echo "scale=1 ; ($COUNT_UGLY*100/$COUNT_TOTAL)" | bc)
PERCENT_NOTFORUS=$(echo "scale=1 ; ($COUNT_NOTFORUS*100/$COUNT_TOTAL)" | bc)
PERCENT_SOURCELESS=$(echo "scale=1 ; ($COUNT_SOURCELESS*100/$COUNT_TOTAL)" | bc)
}