Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/get-package-updates
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-03-23 21:43:58 +0100
committerErich Eckner <git@eckner.net>2017-03-23 21:43:58 +0100
commit64b76d4fa7fa02ada7f9325b2bfa3cd71d77f2d3 (patch)
tree5885e38f87aa213aac2c589133f53aa40d2580b5 /bin/get-package-updates
parent1e9eff62b3b490935f61ecceda1a601821d0336d (diff)
bin/get-package-updates: distinguish between make-depends and depends to break (some) cyclic dependencies
Diffstat (limited to 'bin/get-package-updates')
-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