From fcfd7abfeb7dda72de365eb20038a9378301ccc5 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 3 Jul 2017 10:14:14 +0200 Subject: bin/seed-build-list: actually append new content to build-list (and get a lock for that) --- bin/seed-build-list | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'bin/seed-build-list') diff --git a/bin/seed-build-list b/bin/seed-build-list index b69eaef..a744380 100755 --- a/bin/seed-build-list +++ b/bin/seed-build-list @@ -224,6 +224,11 @@ done < \ awk '{print "append " $1 " " $2 " " $3 " " $4 " " $1}' > \ "${tmp_dir}/build-list.append" +# Create a lock file for build list. + +exec 9> "${build_list_lock_file}" +flock 9 + # ignore packages already on the build list awk '{print "old " $1 " " $2 " " $3 " " $4 " " $1}' "${work_dir}/build-list" > \ "${tmp_dir}/build-list.old" @@ -232,5 +237,9 @@ cat "${tmp_dir}/build-list.append" "${tmp_dir}/build-list.old" | \ sort -k6,6 | \ uniq -uf5 | \ grep '^append ' | \ - awk '{print $2 " " $3 " " $4 " " $5}' > \ - "${work_dir}/build-list.new" + awk '{print $2 " " $3 " " $4 " " $5}' >> \ + "${work_dir}/build-list" + +# Remove the lock file + +rm -f "${build_list_lock_file}" -- cgit v1.2.3-70-g09d2