[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] 2 commits: reproducible Debian builtin-pho: refactoring
Holger Levsen
gitlab at salsa.debian.org
Sat Feb 29 15:40:19 GMT 2020
Holger Levsen pushed to branch master at Debian QA / jenkins.debian.net
Commits:
459a879b by Holger Levsen at 2020-02-29T16:33:33+01:00
reproducible Debian builtin-pho: refactoring
Signed-off-by: Holger Levsen <holger at layer-acht.org>
reproducible Debian builtin-pho: refactoring
Signed-off-by: Holger Levsen <holger at layer-acht.org>
- - - - -
6c4fa249 by Holger Levsen at 2020-02-29T16:40:08+01:00
reproducible Debian builtin-pho: more refactoring
Signed-off-by: Holger Levsen <holger at layer-acht.org>
- - - - -
1 changed file:
- bin/reproducible_html_builtin-pho.sh
Changes:
=====================================
bin/reproducible_html_builtin-pho.sh
=====================================
@@ -28,8 +28,13 @@ get_localsuite() {
fi
}
+sed_db_output_to_html() {
+ cat $1 | tr -d ' ' | sed -E "s/([^|]*)(.*)/<a href=\"https:\/\/tracker.debian.org\/\1\">\1<\/a> <a href=\"https:\/\/packages.debian.org\/$SUITE\/\1\">binaries (\2)<\/a> <a href=\"https:\/\/buildinfos.debian.net\/\1\">.buildinfo<\/a>/g" | tr -d '|' > $2
+
+}
+
query_builtin_pho_db_hits() {
- psql --tuples-only buildinfo <<EOF > $HITS
+ psql --tuples-only buildinfo <<EOF > $RAW_HITS
SELECT DISTINCT p.source,p.version
FROM
binary_packages p, builds b
@@ -41,10 +46,12 @@ WHERE
(b.arch_$ARCH AND p.arch='$ARCH') )
ORDER BY source
EOF
+ sed_db_output_to_html $RAW_HITS $HTML_HITS
+ HITS=$(cat $RAW_HITS | wc -l)
}
query_builtin_pho_db_misses() {
- psql --tuples-only buildinfo <<EOF > $MISSES
+ psql --tuples-only buildinfo <<EOF > $RAW_MISSES
SELECT DISTINCT p.source,p.version
FROM
binary_packages p
@@ -60,6 +67,8 @@ WHERE
(b.arch_$ARCH AND p.arch='$ARCH') )
ORDER BY source
EOF
+ sed_db_output_to_html $RAW_MISSES $HTML_MISSES
+ MISSES=$(cat $RAW_MISSES | wc -l)
}
#
@@ -71,17 +80,16 @@ create_buildinfos_page() {
echo "$(date -u) - starting to write $PAGE page for $SUITE/$ARCH."
write_page_header $VIEW "Overview of .buildinfo files for $SUITE/$ARCH"
write_page "<p>"
- cat $HITS | wc -l >> $PAGE
- write_page "sources with .buildinfo files found:"
- write_page "<br/><small>(While we also know about $(cat $MISSES | wc -l >> $PAGE) sources without .buildinfo files in $SUITE/$ARCH.)</small></p>"
+ write_page "$HITS sources with .buildinfo files found:"
+ write_page "<br/><small>(While we also know about $MISSES sources without .buildinfo files in $SUITE/$ARCH.)</small></p>"
write_page "<pre>"
- cat $HITS | tr -d ' ' | sed -E "s/([^|]*)(.*)/<a href=\"https:\/\/tracker.debian.org\/\1\">\1<\/a> <a href=\"https:\/\/packages.debian.org\/$SUITE\/\1\">binaries (\2)<\/a> <a href=\"https:\/\/buildinfos.debian.net\/\1\">.buildinfo<\/a>/g" | tr -d '|' >> $PAGE
+ cat $HTML_HITS >> $PAGE
write_page "</pre>"
# the end
write_page_footer
# copy to ~jenkins/builtin-pho-html/ for rsyncing to jenkins with another job
mkdir -p ~jenkins/builtin-pho-html/debian/$SUITE/$ARCH
- echo "$(date -u) - $(cp -v $PAGE ~jenkins/builtin-pho-html/debian/$SUITE/$ARCH/)"
+ cp $PAGE ~jenkins/builtin-pho-html/debian/$SUITE/$ARCH/
rm $PAGE
echo "$(date -u) - $REPRODUCIBLE_URL/debian/$SUITE/$ARCH/$PAGE will be updated (via rsync) after this job succeeded..."
}
@@ -95,17 +103,16 @@ create_no_buildinfos_page() {
echo "$(date -u) - starting to write $PAGE page for $SUITE/$ARCH."
write_page_header $VIEW "Overview of missing .buildinfo files for $SUITE/$ARCH"
write_page "<p>"
- cat $MISSES | wc -l >> $PAGE
- write_page "sources without .buildinfo files found:"
- write_page "<br/><small>(While we also know about $(cat $HITS | wc -l >> $PAGE) sources with .buildinfo files in $SUITE/$ARCH.)</small></p>"
+ write_page "$MISSES sources without .buildinfo files found:"
+ write_page "<br/><small>(While we also know about $HITS sources with .buildinfo files in $SUITE/$ARCH.)</small></p>"
write_page "<pre>"
- cat $MISSES | tr -d ' ' | sed -E "s/([^|]*)(.*)/<a href=\"https:\/\/tracker.debian.org\/\1\">\1<\/a> <a href=\"https:\/\/packages.debian.org\/$SUITE\/\1\">binaries (\2)<\/a> <a href=\"https:\/\/buildinfos.debian.net\/\1\">.buildinfo<\/a>/g" | tr -d '|' >> $PAGE
+ cat $HTML_MISSES >> $PAGE
write_page "</pre>"
# the end
write_page_footer
# copy to ~jenkins/builtin-pho-html/ for rsyncing to jenkins with another job
mkdir -p ~jenkins/builtin-pho-html/debian/$SUITE/$ARCH
- echo "$(date -u) - $(cp -v $PAGE ~jenkins/builtin-pho-html/debian/$SUITE/$ARCH/)"
+ cp -v $PAGE ~jenkins/builtin-pho-html/debian/$SUITE/$ARCH/
rm $PAGE
echo "$(date -u) - $REPRODUCIBLE_URL/debian/$SUITE/$ARCH/$PAGE will be updated (via rsync) after this job succeeded..."
}
@@ -113,8 +120,12 @@ create_no_buildinfos_page() {
#
# main
#
-HITS=$(mktemp -t reproducible-builtin-pho-XXXXXXXX)
-MISSES=$(mktemp -t reproducible-builtin-pho-XXXXXXXX)
+RAW_HITS=$(mktemp -t reproducible-builtin-pho-XXXXXXXX)
+RAW_MISSES=$(mktemp -t reproducible-builtin-pho-XXXXXXXX)
+HTML_HITS=$(mktemp -t reproducible-builtin-pho-XXXXXXXX)
+HTML_MISSES=$(mktemp -t reproducible-builtin-pho-XXXXXXXX)
+HITS=0
+MISSES=0
LOCALSUITE=""
for ARCH in ${ARCHS} ; do
for SUITE in $SUITES ; do
@@ -125,4 +136,4 @@ for ARCH in ${ARCHS} ; do
create_no_buildinfos_page
done
done
-rm -f $HITS $MISSES
+rm -f $RAW_HITS $RAW_MISSES $HTML_HITS $HTML_MISSES
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/compare/26db0a3a42a8f899e541b74bd8c72d85e583468f...6c4fa249f2ee2139ddc35c871c66c337da538501
--
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/compare/26db0a3a42a8f899e541b74bd8c72d85e583468f...6c4fa249f2ee2139ddc35c871c66c337da538501
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20200229/0459b3ba/attachment-0001.html>
More information about the Qa-jenkins-scm
mailing list