summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2014-10-12 18:12:48 +0200
committerHolger Levsen <holger@layer-acht.org>2014-10-12 18:12:48 +0200
commit619d4bb423beda134376d174e2d9241dffd01ba4 (patch)
treef7e57165d25f06f08d35af8f9d150e1a9fbd0090
parent4792c4d6a600d2a50d20a02893095a0d17ef8b38 (diff)
downloadjenkins.debian.net-619d4bb423beda134376d174e2d9241dffd01ba4.tar.xz
reproducible: refactor, drop source_stats table for now
-rwxr-xr-xbin/reproducible_build.sh5
-rwxr-xr-xbin/reproducible_setup.sh5
-rwxr-xr-xbin/reproducible_stats.sh2
3 files changed, 3 insertions, 9 deletions
diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh
index 1f5a357d..111e16b5 100755
--- a/bin/reproducible_build.sh
+++ b/bin/reproducible_build.sh
@@ -30,6 +30,7 @@ update_sources_table() {
(xzcat $TMPFILE | egrep "(^Package:|^Version:)" | sed -s "s#^Version: ##g; s#Package: ##g; s#\n# #g"| while read PKG ; do read VERSION ; echo "$PKG,$VERSION" ; done) > $CSVFILE
sqlite3 -csv -init $INIT ${PACKAGES_DB} "DELETE from sources"
echo ".import $CSVFILE sources" | sqlite3 -csv -init $INIT ${PACKAGES_DB}
+ rm $CSVFILE # $TMPFILE is still being used # FIXME: remove TMPFILE too...
echo "$(date) Removing duplicate versions from sources db..."
for PKG in $(sqlite3 ${PACKAGES_DB} 'SELECT name FROM sources GROUP BY name HAVING count(name) > 1') ; do
BET=""
@@ -44,7 +45,7 @@ update_sources_table() {
sqlite3 -init $INIT ${PACKAGES_DB} "DELETE FROM sources WHERE name = '$PKG' AND version != '$BET'"
done
echo "$(date) Done removing duplicate versions from sources db..."
- # update amount of available packages (for doing statistics later)
+ # verify duplicate entries have been removed correctly from the db
P_IN_TMPFILE=$(xzcat $TMPFILE | grep "^Package:" | cut -d " " -f2 | sort -u | wc -l)
P_IN_SOURCES=$(sqlite3 ${PACKAGES_DB} 'SELECT count(name) FROM sources')
if [ $P_IN_TMPFILE -ne $P_IN_SOURCES ] ; then
@@ -52,8 +53,6 @@ update_sources_table() {
echo "DEBUG: P_IN_TMPFILE = $P_IN_TMPFILE"
exit 1
fi
- sqlite3 -init $INIT ${PACKAGES_DB} "REPLACE INTO source_stats VALUES (\"sid\", \"${P_IN_SOURCES}\")"
- rm $CSVFILE # $TMPFILE is still being used
}
set +x
diff --git a/bin/reproducible_setup.sh b/bin/reproducible_setup.sh
index f56b0d11..50c7ac44 100755
--- a/bin/reproducible_setup.sh
+++ b/bin/reproducible_setup.sh
@@ -18,11 +18,6 @@ if [ ! -f ${PACKAGES_DB} ] ; then
build_date TEXT NOT NULL,
PRIMARY KEY (name))'
sqlite3 ${PACKAGES_DB} '
- CREATE TABLE source_stats
- (suite TEXT NOT NULL,
- amount INTEGER NOT NULL,
- PRIMARY KEY (suite))'
- sqlite3 ${PACKAGES_DB} '
CREATE TABLE sources
(name TEXT NOT NULL,
version TEXT NOT NULL)'
diff --git a/bin/reproducible_stats.sh b/bin/reproducible_stats.sh
index 91ab9444..8a84f8be 100755
--- a/bin/reproducible_stats.sh
+++ b/bin/reproducible_stats.sh
@@ -26,7 +26,7 @@ declare -A SPOKENTARGET
LAST24="AND build_date > datetime('now', '-24 hours') "
LAST48="AND build_date > datetime('now', '-48 hours') "
SUITE=sid
-AMOUNT=$(sqlite3 -init $INIT $PACKAGES_DB "SELECT amount FROM source_stats WHERE suite = \"$SUITE\"" | xargs echo)
+AMOUNT=$(sqlite3 -init $INIT $PACKAGES_DB "SELECT count(name) FROM sources")
ALLSTATES="reproducible FTBR_with_buildinfo FTBR FTBFS 404 not_for_us blacklisted"
MAINVIEW="all_abc"
ALLVIEWS="last_24h last_48h all_abc"