Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/delete-packages
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/delete-packages
parent294c66ccc56ee6200b288585833cae1d1bfc3ea8 (diff)
style: WHERE,ON,FROM,SELECT,JOIN should be on beginning of source lines
Diffstat (limited to 'bin/delete-packages')
-rwxr-xr-xbin/delete-packages30
1 files changed, 20 insertions, 10 deletions
diff --git a/bin/delete-packages b/bin/delete-packages
index 103288a..daa281d 100755
--- a/bin/delete-packages
+++ b/bin/delete-packages
@@ -190,7 +190,8 @@ export TMPDIR="${tmp_dir}"
printf ' AND `repositories`.`is_on_master_mirror`'
printf ' AND NOT EXISTS ('
# no packages depending on that one exist
- printf 'SELECT 1 FROM `dependencies`'
+ printf 'SELECT 1'
+ printf ' FROM `dependencies`'
mysql_join_dependencies_dependency_types
printf ' AND `dependency_types`.`relevant_for_binary_packages`'
mysql_join_dependencies_binary_packages '' 'd_bp'
@@ -206,7 +207,8 @@ export TMPDIR="${tmp_dir}"
printf ' WHERE `install_target_providers`.`install_target`=`dependencies`.`depending_on`'
printf ' AND `d_r`.`architecture`=`repositories`.`architecture`'
printf ' AND NOT EXISTS ('
- printf 'SELECT 1 FROM `binary_packages` AS `s_bp`'
+ printf 'SELECT 1'
+ printf ' FROM `binary_packages` AS `s_bp`'
mysql_join_binary_packages_binary_packages_in_repositories 's_bp' 's_bpir'
printf ' AND NOT `s_bpir`.`is_to_be_deleted`'
mysql_join_binary_packages_install_target_providers 's_bp' 's_itp'
@@ -226,11 +228,14 @@ export TMPDIR="${tmp_dir}"
printf 'INSERT IGNORE INTO `bp_to_delete`'
printf ' SELECT `binary_packages_in_repositories`.`package`'
printf ' FROM `bpir_to_delete`'
- printf ' JOIN `binary_packages_in_repositories` ON `bpir_to_delete`.`id`=`binary_packages_in_repositories`.`id`;\n'
+ printf ' JOIN `binary_packages_in_repositories`'
+ printf ' ON `bpir_to_delete`.`id`=`binary_packages_in_repositories`.`id`;\n'
# then remove all bp_to_delete which are actually still needed
- printf 'DELETE `bp_to_delete` FROM `bp_to_delete`'
- printf ' JOIN `binary_packages` ON `binary_packages`.`id`=`bp_to_delete`.`id`'
+ printf 'DELETE `bp_to_delete`'
+ printf ' FROM `bp_to_delete`'
+ printf ' JOIN `binary_packages`'
+ printf ' ON `binary_packages`.`id`=`bp_to_delete`.`id`'
mysql_join_binary_packages_binary_packages_in_repositories
printf ' WHERE NOT EXISTS ('
printf 'SELECT 1'
@@ -243,7 +248,8 @@ export TMPDIR="${tmp_dir}"
printf '`architectures`.`name`,'
printf '`repositories`.`name`'
printf ' FROM `bpir_to_delete`'
- printf ' JOIN `binary_packages_in_repositories` ON `bpir_to_delete`.`id`=`binary_packages_in_repositories`.`id`'
+ printf ' JOIN `binary_packages_in_repositories`'
+ printf ' ON `bpir_to_delete`.`id`=`binary_packages_in_repositories`.`id`'
mysql_join_binary_packages_in_repositories_binary_packages
mysql_join_binary_packages_in_repositories_repositories
mysql_join_repositories_architectures
@@ -255,7 +261,8 @@ export TMPDIR="${tmp_dir}"
printf '`repositories`.`name`,'
printf '`binary_packages`.`pkgname`'
printf ' FROM `bpir_to_delete`'
- printf ' JOIN `binary_packages_in_repositories` ON `bpir_to_delete`.`id`=`binary_packages_in_repositories`.`id`'
+ printf ' JOIN `binary_packages_in_repositories`'
+ printf ' ON `bpir_to_delete`.`id`=`binary_packages_in_repositories`.`id`'
mysql_join_binary_packages_in_repositories_binary_packages
mysql_join_binary_packages_in_repositories_repositories
mysql_join_repositories_architectures
@@ -266,7 +273,8 @@ export TMPDIR="${tmp_dir}"
printf '`repositories`.`name`,"/",'
mysql_package_name_query
printf ') FROM `bpir_to_delete`'
- printf ' JOIN `binary_packages_in_repositories` ON `bpir_to_delete`.`id`=`binary_packages_in_repositories`.`id`'
+ printf ' JOIN `binary_packages_in_repositories`'
+ printf ' ON `bpir_to_delete`.`id`=`binary_packages_in_repositories`.`id`'
mysql_join_binary_packages_in_repositories_binary_packages
mysql_join_binary_packages_in_repositories_repositories
mysql_join_binary_packages_architectures
@@ -281,7 +289,8 @@ export TMPDIR="${tmp_dir}"
printf '"pool/",'
mysql_package_name_query
printf ') FROM `bp_to_delete`'
- printf ' JOIN `binary_packages` ON `bp_to_delete`.`id`=`binary_packages`.`id`'
+ printf ' JOIN `binary_packages`'
+ printf ' ON `bp_to_delete`.`id`=`binary_packages`.`id`'
mysql_join_binary_packages_architectures
printf ';\n'
@@ -398,7 +407,8 @@ fi
printf 'DELETE `binary_packages`'
printf ' FROM `binary_packages`'
printf ' WHERE NOT EXISTS ('
- printf 'SELECT 1 FROM `binary_packages_in_repositories`'
+ printf 'SELECT 1'
+ printf ' FROM `binary_packages_in_repositories`'
printf ' WHERE `binary_packages_in_repositories`.`package`=`binary_packages`.`id`'
printf ');\n'
} | \