diff options
author | Erich Eckner <git@eckner.net> | 2018-06-12 13:45:43 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-06-12 13:45:43 +0200 |
commit | 4cbf0bc8a48fd511e818875cb61bb5907bb68960 (patch) | |
tree | bbd76d85f5e27b5cbe6014ee112987544a85def8 /bin | |
parent | bbafb7963717b0a6b131f4acc789e695660b19c9 (diff) | |
download | builder-4cbf0bc8a48fd511e818875cb61bb5907bb68960.tar.xz |
bin/bootstrap-mysql: do not actually replace packages that are only being hidden
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/bootstrap-mysql | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/bin/bootstrap-mysql b/bin/bootstrap-mysql index 46f64f3..07e5f7d 100755 --- a/bin/bootstrap-mysql +++ b/bin/bootstrap-mysql @@ -304,6 +304,33 @@ fi printf 'UNTIL row_count_saved=0\n' printf 'END REPEAT;\n' + # we now need to remove the replaced_bpir which are not actually to be + # replaced, but simply hidden + + # refresh copies of our temporary tables *yuck* + for table in 'replaced' 'moveable'; do + for copy in '' '2'; do + if [ "${table}" = 'moveable' ] && \ + [ "${copy}" = '2' ]; then + continue + fi + printf 'DELETE FROM `%s_bpir_copy%s`;\n' "${table}" "${copy}" + printf 'INSERT IGNORE INTO `%s_bpir_copy%s`' "${table}" "${copy}" + printf ' SELECT `%s_bpir`.*' "${table}" + printf ' FROM `%s_bpir`;\n' "${table}" + done + done + + printf 'DELETE `replaced_bpir` FROM `replaced_bpir`' + printf ' JOIN `moveable_bpir`' + printf ' ON `replaced_bpir`.`replaced_by`=`moveable_bpir`.`id`' + printf ' JOIN `binary_packages_in_repositories` AS `r_bpir`' + printf ' ON `replaced_bpir`.`id`=`r_bpir`.`id`' + mysql_join_binary_packages_in_repositories_repositories 'r_bpir' 'r_r' + printf ' JOIN `repositories` AS `m_to_r`' + printf ' ON `m_to_r`.`id`=`moveable_bpir`.`to_repository`' + printf ' WHERE `m_to_r`.`stability`!=`r_r`.`stability`;\n' + for table in 'moveable' 'replaced'; do for copy in '' '2'; do if [ "${table}" = 'moveable' ] && \ |