Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/get-assignment
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-05-22 09:11:41 +0200
committerErich Eckner <git@eckner.net>2017-05-22 09:11:41 +0200
commit79764faba92e79080331e49159d1d2d22b7bec49 (patch)
tree100dbe24b667d3da852e6d4d7b61c5e80ec5db13 /bin/get-assignment
parentc7895f146cc68a5e66a834d65d89bdef45326b63 (diff)
bin/get-assignment: extract information about locked loops from package infos rather than loop files
Diffstat (limited to 'bin/get-assignment')
-rwxr-xr-xbin/get-assignment33
1 files changed, 26 insertions, 7 deletions
diff --git a/bin/get-assignment b/bin/get-assignment
index 091c634..18c8bc2 100755
--- a/bin/get-assignment
+++ b/bin/get-assignment
@@ -106,21 +106,40 @@ done < "${work_dir}/build-list"
# Find package (of all packages which are not locked)
# which breaks the most unlocked loops
+locked_packages="$(
+ ls "${work_dir}/package-states/" | \
+ grep '\(\.[0-9a-f]\{40\}\)\{2\}\.[^\.\]\+\.locked$' | \
+ sed 's|\(\.[0-9a-f]\{40\}\)\{2\}\.[^\.\]\+\.locked$||'
+)"
+
+unlocked_loops="$(
+ ls "${work_dir}/build-list.loops/" | \
+ grep '^loop_[0-9]\+$' | \
+ while read -r loop; do
+ if [ -z "$(
+ (
+ cat "${work_dir}/build-list.loops/${loop}"
+ echo "${locked_packages}"
+ ) | \
+ sort | \
+ uniq -d
+ )" ]; then
+ echo "${loop}"
+ fi
+ done
+)"
+
for package in $(
- ls "${work_dir}/build-list.loops/"loop_* | \
- sed 's|\.locked$||' | \
- sort | \
- uniq -u | \
- # now, we have all unlocked loops
+ echo "${unlocked_loops}" | \
+ sed "s|^|${work_dir}/build-list.loops/|" | \
xargs cat | \
- # now, we have their content
sort | \
uniq -c | \
sort -k1nr,1 | \
awk '{print $2}'
); do
- if assignment="$(grep "^${package} " "${work_dir}/build-list")"; then
+ if assignment="$(grep "^${package//./\\.} " "${work_dir}/build-list")"; then
hand_out_assignment ${assignment}
fi