index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2017-07-03 11:37:21 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2017-07-03 11:37:21 +0200 |
commit | c673d3efc212a4362a9a3a413c0b6b097a4e9353 (patch) | |
tree | e582a264aa077674227f637fa2693b429deca0ea /bin | |
parent | 37278efe090185b497234e75ce90c7980f50d976 (diff) |
-rwxr-xr-x | bin/get-assignment | 75 |
diff --git a/bin/get-assignment b/bin/get-assignment index e46dd39..2ef8556 100755 --- a/bin/get-assignment +++ b/bin/get-assignment @@ -108,41 +108,54 @@ fi # Find first package of build-list whose dependencies are all met -while read -r package git_revision mod_git_revision repository; do +for hand_out_broken in false true; do + + while read -r package git_revision mod_git_revision repository; do + + if [ -z "${git_revision}${mod_git_revision}${repository}" ] && \ + [ "${package}" = 'break_loops' ]; then + if ${hand_out_broken}; then + sed -i \ + '/^break_loops$/d' \ + "${work_dir}/build-list" + echo 'break_loops' >> \ + "${work_dir}/build-list" + break + else + continue + fi + fi - if [ -z "${git_revision}${mod_git_revision}${repository}" ] && \ - [ "${package}" = 'break_loops' ]; then - sed -i \ - '/^break_loops$/d' \ - "${work_dir}/build-list" - echo 'break_loops' >> \ - "${work_dir}/build-list" - break - fi + if package_locked_or_blocked "${package}" "${git_revision}" "${mod_git_revision}" "${repository}"; then + continue + fi - if package_locked_or_blocked "${package}" "${git_revision}" "${mod_git_revision}" "${repository}"; then - continue - fi + if ! ${hand_out_broken} && \ + [ -f "${work_dir}/package-states/${package}.${git_revision}.${mod_git_revision}.${repository}.broken" ]; then + continue + fi - [ -z "$( - ( - cat "${work_dir}/package-infos/${package}.${git_revision}.${mod_git_revision}.needs" - grep -vxF 'break_loops' "${work_dir}/build-list" | \ - awk '{print $1 "." $2 "." $3}' | \ - sed " - s|^|${work_dir}/package-infos/| - s|\$|\.builds| - " | \ - xargs -r cat | \ - sort -u - ) | \ - sort | \ - uniq -d - )" ] || continue - - hand_out_assignment "${package}" "${git_revision}" "${mod_git_revision}" "${repository}" + [ -z "$( + ( + cat "${work_dir}/package-infos/${package}.${git_revision}.${mod_git_revision}.needs" + grep -vxF 'break_loops' "${work_dir}/build-list" | \ + awk '{print $1 "." $2 "." $3}' | \ + sed " + s|^|${work_dir}/package-infos/| + s|\$|\.builds| + " | \ + xargs -r cat | \ + sort -u + ) | \ + sort | \ + uniq -d + )" ] || continue + + hand_out_assignment "${package}" "${git_revision}" "${mod_git_revision}" "${repository}" + + done < "${work_dir}/build-list" -done < "${work_dir}/build-list" +done # Find package (of all packages which are not locked and have been broken the least times) # which breaks the most unlocked loops |