summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/build-master-status15
-rwxr-xr-xbin/calculate-dependent-packages4
-rwxr-xr-xbin/get-assignment4
-rwxr-xr-xbin/get-package-updates29
4 files changed, 21 insertions, 31 deletions
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