summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_build.sh
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 /bin/reproducible_build.sh
parent4792c4d6a600d2a50d20a02893095a0d17ef8b38 (diff)
downloadjenkins.debian.net-619d4bb423beda134376d174e2d9241dffd01ba4.tar.xz
reproducible: refactor, drop source_stats table for now
Diffstat (limited to 'bin/reproducible_build.sh')
-rwxr-xr-xbin/reproducible_build.sh5
1 files changed, 2 insertions, 3 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