index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2017-11-01 09:59:45 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2017-11-01 09:59:45 +0100 |
commit | 05a43c23b36c4b68a246bc69fa0d699a3ec469fb (patch) | |
tree | 026314699b7f4de4f7bd52f00d2a1e13ea06d5db /bin | |
parent | 4e67e6d62a91cba3f2f54401bba073b601db82d5 (diff) |
-rwxr-xr-x | bin/build-master-status | 15 | ||||
-rwxr-xr-x | bin/calculate-dependent-packages | 4 | ||||
-rwxr-xr-x | bin/get-assignment | 4 | ||||
-rwxr-xr-x | bin/get-package-updates | 29 |
diff --git a/bin/build-master-status b/bin/build-master-status index f901d0a..0e83d5b 100755 --- a/bin/build-master-status +++ b/bin/build-master-status @@ -122,7 +122,7 @@ testing=$( ( find "${work_dir}/build-list.loops" -maxdepth 1 -regextype grep \ -regex '.*/loop_[0-9]\+' \ - -exec cat {} \; | \ + -exec cat '{}' \; | \ sort -u find "${work_dir}/package-states/" -maxdepth 1 -name '*.broken' -printf '%f\n' | \ sed 's|\(\.[^.]\+\)\{4\}||' | \ @@ -146,13 +146,14 @@ locked=$( wc -l ) loops=$( - find "${work_dir}/build-list.loops" -maxdepth 1 | \ - grep -c '/loop_[0-9]\+$' -) || true + find "${work_dir}/build-list.loops" -maxdepth 1 -regextype grep \ + -regex '.*/loop_[0-9]\+' | \ + wc -l +) looped_packages=$( - find "${work_dir}/build-list.loops" -maxdepth 1 | \ - grep '/loop_[0-9]\+$' | \ - xargs -r cat | \ + find "${work_dir}/build-list.loops" -maxdepth 1 -regextype grep \ + -regex '.*/loop_[0-9]\+' \ + -exec cat '{}' \; | \ sort -u | \ wc -l ) diff --git a/bin/calculate-dependent-packages b/bin/calculate-dependent-packages index 6f3ec98..d4791b0 100755 --- a/bin/calculate-dependent-packages +++ b/bin/calculate-dependent-packages @@ -20,8 +20,8 @@ done < \ "${tmp_dir}/build-list" mkdir "${tmp_dir}/loops" -find "${work_dir}/build-list.loops" -maxdepth 1 | \ - grep '/loop_[0-9]\+$' | \ +find "${work_dir}/build-list.loops" -maxdepth 1 -regextype grep \ + -regex '.*/loop_[0-9]\+' | \ while read -r loop; do sort -u "${loop}" | \ join -j 1 - "${tmp_dir}/build-list" | \ diff --git a/bin/get-assignment b/bin/get-assignment index 099f8b6..e662eef 100755 --- a/bin/get-assignment +++ b/bin/get-assignment @@ -45,9 +45,7 @@ hand_out_assignment() { find "${work_dir}/build-list.loops" -maxdepth 1 -regextype grep \ -regex '.*/loop_[0-9]\+' \ -exec grep -qxF "$1" '{}' \; \ - -exec touch '{}.locked' \; \ - -print >> \ - "${work_dir}/package-states/$1.$2.$3.$4.locked" + -exec touch '{}.locked' \; exit 0 diff --git a/bin/get-package-updates b/bin/get-package-updates index 90b8033..059630a 100755 --- a/bin/get-package-updates +++ b/bin/get-package-updates @@ -4,13 +4,6 @@ # Details: # https://github.com/archlinux32/builder/wiki/Build-system#get-package-updates -# TODO: be more secure in case of update while build(s) is/are still in -# progress -> (stale) lock files, moving (or changing content of) loop -# lock files - -# TODO: (might be connected to above): find out who deletes loop-files which -# should not be deleted - # shellcheck source=conf/default.conf . "${0%/*}/../conf/default.conf" @@ -461,20 +454,18 @@ if [ -s "${work_dir}/tsort.error" ]; then ' "${work_dir}/tsort.error" # remove lines from loop files which are no packages - find "${work_dir}/build-list.loops.new" -maxdepth 1 -printf '%f\n' | \ - grep '^loop_[0-9]\+$' | \ + find "${work_dir}/build-list.loops.new" -maxdepth 1 -regextype grep \ + -regex '.*/loop_[0-9]\+' \ + -printf '%p\n' | \ while read -r loop; do - ( - sort -u "${work_dir}/build-list.loops.new/${loop}" + { + sort -u "${loop}" cut -d' ' -f1 "${work_dir}/build-list.new.new" | \ sort -u - ) | \ + } | \ sort | \ - uniq -d > \ - "${work_dir}/build-list.loops.new/${loop}.new" - mv \ - "${work_dir}/build-list.loops.new/${loop}.new" \ - "${work_dir}/build-list.loops.new/${loop}" + uniq -d | \ + sponge "${loop}" done else rm "${work_dir}/tsort.error" @@ -483,11 +474,11 @@ fi # Move the .new-files to the actual files rm -rf --one-file-system "${work_dir}/build-list.loops" -( +{ printf '%s\n' "build-list.loops" "build-list.new" "build-list" "deletion-list" # shellcheck disable=SC2086 printf '%s.revision\n' ${repo_names} -) | \ +} | \ while read -r file; do mv "${work_dir}/${file}.new" "${work_dir}/${file}" done |