Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/db-update
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-11-06 15:21:45 +0100
committerErich Eckner <git@eckner.net>2017-11-06 15:21:45 +0100
commit75f23a993db3427a216703659772793062496eb2 (patch)
tree3452ffcacef13e9c68e6b9192687b639592b24c6 /bin/db-update
parent7ee072973927941969cdd5a4246c442b224d7831 (diff)
bin/common-functions, bin/db-update: consider dependencies in both directions
Diffstat (limited to 'bin/db-update')
-rwxr-xr-xbin/db-update42
1 files changed, 27 insertions, 15 deletions
diff --git a/bin/db-update b/bin/db-update
index 7c26b9f..241acf0 100755
--- a/bin/db-update
+++ b/bin/db-update
@@ -490,27 +490,24 @@ printf '%s\n' ${packages_to_force_unstage} > \
# calculate what packages should be unstaged:
-find_biggest_subset_of_packages "${tmp_dir}/done-packages" "${tmp_dir}/build-list-packages" "${tmp_dir}/all-builds" "${tmp_dir}/force-unstage-packages" > \
+find_biggest_subset_of_packages "${tmp_dir}/done-packages" "${tmp_dir}/build-list-packages" "${tmp_dir}/all-builds" "${tmp_dir}/all-depends" "${tmp_dir}/force-unstage-packages" > \
"${tmp_dir}/unstage-packages"
-# no base / base-devel packages on the build list anymore?
+# no base packages on the build list anymore?
if [ -z "$(
join -j 1 \
"${tmp_dir}/base-packages" \
"${tmp_dir}/build-list-packages"
)" ]; then
-
- # we pretend, the group "base" does not exist, so we only fetch 'direct' dependencies on base-packages
-
- mv "${tmp_dir}/all-builds" "${tmp_dir}/really-all-builds"
- grep -v ' base$' "${tmp_dir}/really-all-builds" > \
- "${tmp_dir}/all-builds" || \
- true
-
- find_biggest_subset_of_packages "${tmp_dir}/done-packages" "${tmp_dir}/build-list-packages" "${tmp_dir}/all-builds" "${tmp_dir}/force-unstage-packages" > \
+ >&2 echo 'db-update unstage: we pretend, the group "base" does not exist, so we only fetch "direct" dependencies on base-packages'
+ for s in "${tmp_dir}/all-builds" "${tmp_dir}/all-depends"; do
+ grep -v ' base$' "${s}" > \
+ "${s}.no-base" || \
+ true
+ done
+
+ find_biggest_subset_of_packages "${tmp_dir}/done-packages" "${tmp_dir}/build-list-packages" "${tmp_dir}/all-builds.no-base" "${tmp_dir}/all-depends.no-base" "${tmp_dir}/force-unstage-packages" > \
"${tmp_dir}/unstage-packages"
-
- mv "${tmp_dir}/really-all-builds" "${tmp_dir}/all-builds"
fi
# shellcheck disable=SC2086
@@ -531,8 +528,23 @@ find "${work_dir}/package-states" -maxdepth 1 -type f -name '*.tested' -printf '
sed 's|\.tested$||' > \
"${tmp_dir}/stabilize-packages"
-find_biggest_subset_of_packages "${tmp_dir}/stabilize-packages" "${tmp_dir}/keep-packages" "${tmp_dir}/all-builds" "${tmp_dir}/force-stabilize-packages" | \
- sponge "${tmp_dir}/stabilize-packages"
+# no base packages on the build list or in staging anymore?
+if [ -z "$(
+ cat \
+ "${tmp_dir}/build-list-packages" \
+ "${tmp_dir}/done-packages" | \
+ sort -u | \
+ join -j 1 \
+ "${tmp_dir}/base-packages" \
+ -
+ )" ]; then
+ >&2 echo 'db-update stabilize: we pretend, the group "base" does not exist, so we only fetch "direct" dependencies on base-packages'
+ find_biggest_subset_of_packages "${tmp_dir}/stabilize-packages" "${tmp_dir}/keep-packages" "${tmp_dir}/all-builds.no-base" "${tmp_dir}/all-depends.no-base" "${tmp_dir}/force-stabilize-packages" | \
+ sponge "${tmp_dir}/stabilize-packages"
+else
+ find_biggest_subset_of_packages "${tmp_dir}/stabilize-packages" "${tmp_dir}/keep-packages" "${tmp_dir}/all-builds" "${tmp_dir}/all-depends" "${tmp_dir}/force-stabilize-packages" | \
+ sponge "${tmp_dir}/stabilize-packages"
+fi
# unlock build list