From 7238c1d5b6c23e3227ebf4e10ba99eff46775fe9 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 4 Jul 2017 11:55:18 +0200 Subject: bin/get-assignment, bin/get-package-updates: adding "break_loops" order enhanced and extracted to a function --- bin/get-assignment | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'bin/get-assignment') diff --git a/bin/get-assignment b/bin/get-assignment index 2ef8556..64f6046 100755 --- a/bin/get-assignment +++ b/bin/get-assignment @@ -115,11 +115,18 @@ for hand_out_broken in false true; 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" + first=true + while read -r s; do + if [ "${s}" = 'break_loops' ] && \ + ${first}; then + first=false + continue + fi + printf '%s\n' "${s}" + done < \ + "${work_dir}/build-list" | \ + sponge "${work_dir}/build-list" + insert_break_loops_orders "${work_dir}/build-list" break else continue -- cgit v1.2.3-70-g09d2