From 21ce98cd746a35df07891084baea6bbde1876166 Mon Sep 17 00:00:00 2001 From: Valerie R Young Date: Fri, 16 Sep 2016 21:09:49 -0400 Subject: reproducible debian: make bash sql sqlite/postgres agnostic This commit does the following for all bash scripts: - remove sqlite specfic datetime functions in sql queries - remove double quotes from sql queries - replace the "REPLACE INTO" sql queries Signed-off-by: Mattia Rizzolo Signed-off-by: Holger Levsen --- bin/reproducible_blacklist.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'bin/reproducible_blacklist.sh') diff --git a/bin/reproducible_blacklist.sh b/bin/reproducible_blacklist.sh index bbd9b7fc..5e94e962 100755 --- a/bin/reproducible_blacklist.sh +++ b/bin/reproducible_blacklist.sh @@ -17,7 +17,12 @@ blacklist_packages() { VERSION=$(query_db "SELECT version FROM sources WHERE name='$PKG' AND suite='$SUITE' AND architecture='$ARCH';") PKGID=$(query_db "SELECT id FROM sources WHERE name='$PKG' AND suite='$SUITE' AND architecture='$ARCH';") cleanup_pkg_files - query_db "REPLACE INTO results (package_id, version, status, build_date, job) VALUES ('$PKGID', '$VERSION', 'blacklisted', '$DATE', '');" + RESULTID=$(query_db "SELECT id FROM results WHERE package_id=$PKGID") + if [ ! -z "$RESULTID" ] ; then + query_db "UPDATE results set package_id='$PKGID', version='$VERSION', status='blacklisted', build_date='$DATE', job='' WHERE id=$RESULTID;" + else + query_db "INSERT into results (package_id, version, status, build_date, job) VALUES ('$PKGID', '$VERSION', 'blacklisted', '$DATE', '');" + fi query_db "DELETE FROM schedule WHERE package_id='$PKGID'" done } -- cgit v1.2.3-54-g00ecf