summaryrefslogtreecommitdiff
path: root/bin/build-master-status
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-01-17 15:24:40 +0100
committerErich Eckner <git@eckner.net>2019-01-17 15:24:40 +0100
commitc9f55c95cb382e22c41a310c1005e3de43379ae9 (patch)
tree38210b816af5645dad7fad10b1de6a32fe89c76b /bin/build-master-status
parent294c66ccc56ee6200b288585833cae1d1bfc3ea8 (diff)
downloadbuilder-c9f55c95cb382e22c41a310c1005e3de43379ae9.tar.xz
style: WHERE,ON,FROM,SELECT,JOIN should be on beginning of source lines
Diffstat (limited to 'bin/build-master-status')
-rwxr-xr-xbin/build-master-status28
1 files changed, 17 insertions, 11 deletions
diff --git a/bin/build-master-status b/bin/build-master-status
index 3605a02..cb18280 100755
--- a/bin/build-master-status
+++ b/bin/build-master-status
@@ -62,7 +62,8 @@ if [ -s "${tmp_dir}/todos" ]; then
done
printf 'UPDATE `todos`'
- printf ' JOIN `td` ON `todos`.`id`=`td`.`id`'
+ printf ' JOIN `td`'
+ printf ' ON `todos`.`id`=`td`.`id`'
printf ',`todos`.`%s`=`td`.`%s`' \
'file' 'file' \
'line' 'line' \
@@ -75,20 +76,25 @@ if [ -s "${tmp_dir}/todos" ]; then
printf ' FROM `td`'
printf ' WHERE `td`.`id` IS NULL;\n'
- printf 'DELETE FROM `todos` WHERE NOT EXISTS ('
- printf 'SELECT 1 FROM `td`'
- printf ' AND `td`.`%s`=`todos`.`%s`' \
- 'file' 'file' \
- 'line' 'line' \
- 'description' 'description' | \
- sed 's/^ AND / WHERE /'
+ printf 'DELETE FROM `todos`'
+ printf ' WHERE NOT EXISTS ('
+ printf 'SELECT 1'
+ printf ' FROM `td`'
+ printf ' AND `td`.`%s`=`todos`.`%s`' \
+ 'file' 'file' \
+ 'line' 'line' \
+ 'description' 'description' | \
+ sed 's/^ AND / WHERE /'
printf ');\n'
printf 'DROP TEMPORARY TABLE `td`;\n'
- printf 'DELETE FROM `todo_links` WHERE NOT EXISTS ('
- printf 'SELECT 1 FROM `todos` '
+ printf 'DELETE FROM `todo_links`'
+ printf ' WHERE NOT EXISTS ('
+ printf 'SELECT 1'
+ printf ' FROM `todos` '
printf 'WHERE `todos`.`id`=`todo_links`.`depending_on`'
printf ') OR NOT EXISTS ('
- printf 'SELECT 1 FROM `todos` '
+ printf 'SELECT 1'
+ printf ' FROM `todos` '
printf 'WHERE `todos`.`id`=`todo_links`.`dependent`'
printf ');\n'
} | \