summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-02-04 12:07:03 +0100
committerErich Eckner <git@eckner.net>2018-02-04 12:07:03 +0100
commit27106d9e0c70524a42cad4b2d662177c8490c174 (patch)
treefcdbeb070381ce571984d861ac73483c7b17e5b7
parentc3279084e8f93a9f2f0488c3f78b72b8df3c65e4 (diff)
downloadbuilder-27106d9e0c70524a42cad4b2d662177c8490c174.tar.xz
bin/build-master-status: only add not-yet-existent todos newly to database
-rwxr-xr-xbin/build-master-status11
1 files changed, 10 insertions, 1 deletions
diff --git a/bin/build-master-status b/bin/build-master-status
index ce49332..0e80bd6 100755
--- a/bin/build-master-status
+++ b/bin/build-master-status
@@ -584,7 +584,16 @@ if ${web}; then
printf ';\n'
printf 'INSERT IGNORE INTO `todos` (`file`,`line`,`description`) '
printf 'SELECT `td`.`file`,`td`.`line`,`td`.`description` '
- printf 'FROM `td`;\n'
+ printf 'FROM `td` '
+ printf 'WHERE NOT EXISTS ('
+ printf 'SELECT * FROM `todos`'
+ printf ' AND `td`.`%s`=`todos`.`%s`' \
+ 'file' 'file' \
+ 'line' 'line' \
+ 'description' 'description' | \
+ sed 's/^ AND / WHERE /'
+ printf ');\n'
+
printf 'DELETE FROM `todos` WHERE NOT EXISTS ('
printf 'SELECT * FROM `td`'
printf ' AND `td`.`%s`=`todos`.`%s`' \