diff options
author | Valerie R Young <spectranaut@riseup.net> | 2016-09-16 21:09:49 -0400 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2016-11-08 16:53:29 +0100 |
commit | 21ce98cd746a35df07891084baea6bbde1876166 (patch) | |
tree | 8e27f66673e78ba9d573d417f4953e66af7b9d19 /bin/reproducible_blacklist.sh | |
parent | 464d96e0aea8158077777ddd42cd2cc3d6bbd01a (diff) | |
download | jenkins.debian.net-21ce98cd746a35df07891084baea6bbde1876166.tar.xz |
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 <mattia@debian.org>
Signed-off-by: Holger Levsen <holger@layer-acht.org>
Diffstat (limited to 'bin/reproducible_blacklist.sh')
-rwxr-xr-x | bin/reproducible_blacklist.sh | 7 |
1 files changed, 6 insertions, 1 deletions
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 } |