Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/return-assignment
diff options
context:
space:
mode:
Diffstat (limited to 'bin/return-assignment')
-rwxr-xr-xbin/return-assignment9
1 files changed, 5 insertions, 4 deletions
diff --git a/bin/return-assignment b/bin/return-assignment
index e71680d..9a999ae 100755
--- a/bin/return-assignment
+++ b/bin/return-assignment
@@ -160,10 +160,10 @@ if [ "$6" = 'ERROR' ]; then
done
done | \
sed '
- 1 s/^/INSERT INTO `failures` (`date`,`reason`,`log_file`) VALUES /
+ 1 s/^/INSERT IGNORE INTO `failures` (`date`,`reason`,`log_file`) VALUES /
s/,$/;\n/
'
- printf 'INSERT INTO `failed_builds` (`build_slave`,`build_assignment`,`date`,`reason`,`log_file`,`log_file_exists`)'
+ printf 'INSERT IGNORE INTO `failed_builds` (`build_slave`,`build_assignment`,`date`,`reason`,`log_file`,`log_file_exists`)'
printf ' SELECT '
printf 'from_base64("%s"),' \
"$(printf '%s' "${slave_id}" | base64 -w0)" \
@@ -753,8 +753,9 @@ trigger_mirror_refreshs
# insert into appropriate repositories and retrieve ids
while read -r package_id _ repository_id _; do
printf 'INSERT INTO `binary_packages_in_repositories` (`package`,`repository`,`is_to_be_deleted`) VALUES '
- printf '(%s,%s,0);\n' \
+ printf '(%s,%s,0)' \
"${package_id}" "${repository_id}"
+ printf ' ON DUPLICATE KEY UPDATE `id`=LAST_INSERT_ID(`binary_packages_in_repositories`.`id`);\n'
printf 'SELECT LAST_INSERT_ID();\n'
done < \
"${tmp_dir}/repository-ids"
@@ -892,7 +893,7 @@ trigger_mirror_refreshs
# remove broken loops
printf 'CREATE TEMPORARY TABLE `loops_to_delete` (`loop` MEDIUMINT);\n'
- printf 'INSERT INTO `loops_to_delete`'
+ printf 'INSERT IGNORE INTO `loops_to_delete`'
printf ' SELECT `build_dependency_loops`.`loop` FROM `build_dependency_loops`'
mysql_join_build_dependency_loops_binary_packages
mysql_join_binary_packages_binary_packages_in_repositories