Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/get-package-updates73
1 files changed, 72 insertions, 1 deletions
diff --git a/bin/get-package-updates b/bin/get-package-updates
index e43535a..ee97c8f 100755
--- a/bin/get-package-updates
+++ b/bin/get-package-updates
@@ -98,6 +98,7 @@ done | \
declare -A packages_built
declare -A packages_needed
+declare -A packages_needed_for_make
while read -r package dummy repository; do
PKGBUILD="$(find_pkgbuild "${package}" "${repository}")"
@@ -131,7 +132,22 @@ while read -r package dummy repository; do
packages_needed["${package}"]="$(
(
echo "${content}" | \
- grep '^depends=\|^makedepends=' | \
+ grep '^depends=' | \
+ sed 's|^[^=]\+=||; s|>\?=.*$||' | \
+ tr "' ()\"" '\n' | \
+ sort -u | \
+ sed '/^$/d'
+ echo "${packages_built["${package}"]}" | \
+ sed 'p'
+ ) | \
+ sort | \
+ uniq -u
+ )"
+
+ packages_needed_for_make["${package}"]="$(
+ (
+ echo "${content}" | \
+ grep '^makedepends=' | \
sed 's|^[^=]\+=||; s|>\?=.*$||' | \
tr "' ()\"" '\n' | \
sort -u | \
@@ -156,6 +172,55 @@ while [ ${#packages_built[@]} -gt 0 ]; do
if [ -z "$(
(
echo "${packages_needed["${package}"]}"
+ echo "${packages_needed_for_make["${package}"]}"
+ echo "${!packages_built[@]}" | \
+ tr ' ' '\n'
+ ) | \
+ sort | \
+ uniq -d
+ )" ]; then
+ grep "^${package} " "${base_dir}/work/build-list" >> \
+ "${base_dir}/work/build-list.new"
+ unset packages_built["${package}"]
+ unset packages_needed["${package}"]
+ unset packages_needed_for_make["${package}"]
+ found_something=true
+ fi
+ done
+
+ if ${found_something}; then
+ continue
+ fi
+
+ for package in "${!packages_built[@]}"; do
+
+ if [ -z "$(
+ (
+ echo "${packages_needed["${package}"]}"
+ echo "${!packages_built[@]}" | \
+ tr ' ' '\n'
+ ) | \
+ sort | \
+ uniq -d
+ )" ]; then
+ grep "^${package} " "${base_dir}/work/build-list" >> \
+ "${base_dir}/work/build-list.new"
+ unset packages_built["${package}"]
+ unset packages_needed["${package}"]
+ unset packages_needed_for_make["${package}"]
+ found_something=true
+ fi
+ done
+
+ if ${found_something}; then
+ continue
+ fi
+
+ for package in "${!packages_built[@]}"; do
+
+ if [ -z "$(
+ (
+ echo "${packages_needed_for_make["${package}"]}"
echo "${!packages_built[@]}" | \
tr ' ' '\n'
) | \
@@ -166,6 +231,7 @@ while [ ${#packages_built[@]} -gt 0 ]; do
"${base_dir}/work/build-list.new"
unset packages_built["${package}"]
unset packages_needed["${package}"]
+ unset packages_needed_for_make["${package}"]
found_something=true
fi
done
@@ -177,6 +243,11 @@ while [ ${#packages_built[@]} -gt 0 ]; do
>&2 echo 'uaagh: there seem to be cyclic dependencies - I give up.'
>&2 echo "packages left: ${!packages_built[@]}"
+ for pkg in "${!packages_built[@]}"; do
+ echo "${pkg}:"
+ echo ${packages_needed["${pkg}"]}
+ done
+
# TODO: Break circular dependencies
exit 1