Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/why_dont_you
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-07-28 10:45:14 +0200
committerErich Eckner <git@eckner.net>2017-07-28 10:45:14 +0200
commit8e6b99b7ee6bd8589c4f005315e4657c95f182b5 (patch)
tree0e41e7bbeeaa4419d4ff30219a80c00d81453793 /bin/why_dont_you
parent3b94ae7c0a8ba7513830158f357113618adba9c8 (diff)
files in package-infos contain the repository now, too
Diffstat (limited to 'bin/why_dont_you')
-rwxr-xr-xbin/why_dont_you37
1 files changed, 14 insertions, 23 deletions
diff --git a/bin/why_dont_you b/bin/why_dont_you
index aa4c4b0..443a803 100755
--- a/bin/why_dont_you
+++ b/bin/why_dont_you
@@ -26,11 +26,11 @@ case "${action}" in
continue
fi
- if [ -n "$(
+ unmet_dependencies="$(
(
- cat "${work_dir}/package-infos/${package}.${git_revision}.${mod_git_revision}.needs"
+ cat "${work_dir}/package-infos/${package}.${git_revision}.${mod_git_revision}.${repository}.needs"
grep -vxF 'break_loops' "${work_dir}/build-list" | \
- awk '{print $1 "." $2 "." $3}' | \
+ awk '{print $1 "." $2 "." $3 "." $4}' | \
sed "
s|^|${work_dir}/package-infos/|
s|\$|\.builds|
@@ -40,26 +40,15 @@ case "${action}" in
) | \
sort | \
uniq -d
- )" ]; then
+ )"
+ if [ -n "${unmet_dependencies}" ]; then
printf '"%s" has unmet dependencies:\n' "${package}"
- (
- cat "${work_dir}/package-infos/${package}.${git_revision}.${mod_git_revision}.needs"
- grep -vxF 'break_loops' "${work_dir}/build-list" | \
- awk '{print $1 "." $2 "." $3}' | \
- sed "
- s|^|${work_dir}/package-infos/|
- s|\$|\.builds|
- " | \
- xargs -r cat | \
- sort -u
- ) | \
- sort | \
- uniq -d | \
+ echo "${unmet_dependencies}" | \
while read -r dep; do
grep -lxF "${dep}" "${work_dir}/package-infos/"*".builds" | \
sed '
s|^.*/||
- s|\(\.[^.]\+\)\{3\}||
+ s|\(\.[^.]\+\)\{4\}||
'
done | \
sort -u
@@ -103,7 +92,7 @@ case "${action}" in
dependent_packages_file="$(mktemp)"
grep -vxF 'break_loops' "${work_dir}/build-list" | \
- awk '{print $1 "." $2 "." $3 " " $4}' | \
+ awk '{print $1 "." $2 "." $3 "." $4}' | \
sort -u > \
"${build_list_items_file}"
@@ -112,7 +101,7 @@ case "${action}" in
"${dependent_packages_file}"
dependent_still_on_build_list="$(
- join -1 1 -2 1 -o 1.1,1.2 \
+ join -1 1 -2 1 -o 1.1 \
"${build_list_items_file}" \
"${dependent_packages_file}"
)"
@@ -131,7 +120,7 @@ case "${action}" in
dependent_still_in_staging="$(
echo "${dependent_packages}" | \
while read -r sf; do
- if [ -f "${work_dir}/package-states/$sf."*".done" ]; then
+ if [ -f "${work_dir}/package-states/${sf}.done" ]; then
echo "${sf}"
fi
done
@@ -159,10 +148,12 @@ case "${action}" in
if builds_file="$(
ls "${work_dir}/package-infos" | \
- grep -m1 "^$(str_to_regex "${pkg}")\.[^.]\+\.[^.]\+\.builds\$"
+ grep -m1 "^$(str_to_regex "${pkg}")\(\.[^.]\+\)\{3\}\.builds\$"
)"; then
builds_file="${builds_file%.*}"
+ prepo="${builds_file##*.}"
+ builds_file="${builds_file%.*}"
mod_rev="${builds_file##*.}"
builds_file="${builds_file%.*}"
rev="${builds_file##*.}"
@@ -211,7 +202,7 @@ case "${action}" in
fi
- sed "s|^|${pkg} builds |" "${work_dir}/package-infos/${pkg}.${rev}.${mod_rev}.builds" >> \
+ sed "s|^|${pkg} builds |" "${work_dir}/package-infos/${pkg}.${rev}.${mod_rev}.${prepo}.builds" >> \
"${tmp_file}"
done < \