summaryrefslogtreecommitdiff
path: root/bin/return-assignment
diff options
context:
space:
mode:
Diffstat (limited to 'bin/return-assignment')
-rwxr-xr-xbin/return-assignment28
1 files changed, 23 insertions, 5 deletions
diff --git a/bin/return-assignment b/bin/return-assignment
index ec7db45..213d4f0 100755
--- a/bin/return-assignment
+++ b/bin/return-assignment
@@ -48,10 +48,12 @@ if [ "$5" = 'ERROR' ]; then
exit 0
fi
- mv \
- "${work_dir}/package-states/$1.$2.$3.$4.locked" \
+ cat \
+ "${work_dir}/package-states/$1.$2.$3.$4.locked" >> \
"${work_dir}/package-states/$1.$2.$3.$4.broken"
+ rm "${work_dir}/package-states/$1.$2.$3.$4.locked"
+
# unlock every loop this package would have broken and which is not
# broken by another locked package
locked_packages="$(
@@ -74,6 +76,14 @@ if [ "$5" = 'ERROR' ]; then
fi
done
+ # move build order to end of build list
+
+ sed -i \
+ "/^$(str_to_regex "$1 $2 $3 $4")\$/d" \
+ "${work_dir}/build-list"
+ echo "$1 $2 $3 $4" >> \
+ "${work_dir}/build-list"
+
exit 0
fi
@@ -152,8 +162,8 @@ repo-add "${destination}.db.tar.gz" ${packages}
${master_mirror_command} \
"${destination}.db."* \
- *".pkg.tar.xz" \
- *".pkg.tar.xz.sig" \
+ ./*".pkg.tar.xz" \
+ ./*".pkg.tar.xz.sig" \
"${master_mirror_directory}/i686/${destination}/"
for package in ${packages}; do
@@ -175,10 +185,18 @@ grep -xF "$1" "${work_dir}/build-list.loops/loop_"* 2> /dev/null | \
sed 'p;s|$|.locked|' | \
xargs -rn1 rm -f
+if ! ls "${work_dir}/build-list.loops" | \
+ grep -q '^loop_[0-9]\+$'; then
+ # no loops left
+ sed -i '/^break_loops$/d' "${work_dir}/build-list"
+fi
+
# remove package from build list
sed -i "/^$(str_to_regex "$1 $2 $3 $4")\$/d" "${work_dir}/build-list"
# remove package lock file
printf '%s\n' ${packages} > \
"${work_dir}/package-states/$1.$2.$3.$4.done"
-rm "${work_dir}/package-states/$1.$2.$3.$4.locked"
+rm -f \
+ "${work_dir}/package-states/$1.$2.$3.$4.locked" \
+ "${work_dir}/package-states/$1.$2.$3.$4.broken"