index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2019-07-10 13:22:51 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-07-10 13:22:51 +0200 |
commit | 12a44751d35ac4a63a0bb522370f75a69816f0bf (patch) | |
tree | 9eb68753bb6053142115a0e0d12f2dada534dc8c /bin | |
parent | 0c16f57f82a0940aab8539eecd0ab7953e804287 (diff) |
-rwxr-xr-x | bin/return-assignment | 19 |
diff --git a/bin/return-assignment b/bin/return-assignment index 01aa6d7..e73bec4 100755 --- a/bin/return-assignment +++ b/bin/return-assignment @@ -86,6 +86,14 @@ if ! verbose_flock -s -n 8; then exit 1 fi +clean_up_tmp_dir() { + cd "${base_dir}" + rm -rf --one-file-system "${tmp_dir}" +} + +tmp_dir=$(mktemp -d "${work_dir}/tmp.return-assignment.XXXXXXXXXX") +trap clean_up_tmp_dir EXIT + if [ "$6" = 'ERROR' ]; then # the build failed on the build slave @@ -261,7 +269,7 @@ if [ "$6" = 'ERROR' ]; then done | \ sort -k2,2 -k1nr,1 | \ uniq -f1 > \ - "${broken_haskell_packages}" + "${tmp_dir}/broken-haskell-packages" # now we look if the broken packages have been rebuilt in the meantime haskell_rebuild_packages=$( @@ -269,7 +277,7 @@ if [ "$6" = 'ERROR' ]; then { printf 'CREATE TEMPORARY TABLE `broken`(`time_stamp` BIGINT,`pkgname` VARCHAR(64),UNIQUE KEY `pkgname`(`pkgname`),KEY `time_stamp`(`time_stamp`));\n' printf 'LOAD DATA LOCAL INFILE "%s" INTO TABLE `broken`(`time_stamp`,`pkgname`);\n' \ - "${broken_haskell_packages}" + "${tmp_dir}/broken-haskell-packages" printf 'SELECT DISTINCT `broken`.`pkgname`' printf ' FROM `broken`' printf ' WHERE NOT EXISTS (' @@ -446,14 +454,7 @@ if [ -z "${build_assignment_id}" ]; then exit 2 fi -clean_up_tmp_dir() { - cd "${base_dir}" - rm -rf --one-file-system "${tmp_dir}" -} - -tmp_dir=$(mktemp -d "${work_dir}/tmp.return-assignment.XXXXXXXXXX") cd "${tmp_dir}" -trap clean_up_tmp_dir EXIT export TMPDIR="${tmp_dir}" |