summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-11-06 16:15:26 +0100
committerErich Eckner <git@eckner.net>2017-11-06 16:15:26 +0100
commitbe5450c060ab4556a79b11852c3c3de34a2f0693 (patch)
tree9c584d30f4b01051b9efea7f5bfcd07af662cd8d
parent0b9304e309a4da488d6fa6686ebbd2326b988b33 (diff)
downloadbuilder-be5450c060ab4556a79b11852c3c3de34a2f0693.tar.xz
bin/common-functions, bin/db-update: print_list_of_archaic_packages new -- ignore archaic packages for dependency considerations
-rwxr-xr-xbin/common-functions54
-rwxr-xr-xbin/db-update19
2 files changed, 66 insertions, 7 deletions
diff --git a/bin/common-functions b/bin/common-functions
index ffc2c6f..81d4e8f 100755
--- a/bin/common-functions
+++ b/bin/common-functions
@@ -1120,3 +1120,57 @@ smoothen_namcap_log() {
sort | \
sponge "${file}"
}
+
+# print_list_of_archaic_packages $source1 $source2 ...
+# print a list of packages which have not been touched for a while,
+# but which are still in the pipeline, e.g. in $source1, $source2 or ...
+
+print_list_of_archaic_packages() {
+ for source in "$@"; do
+ case "${source}" in
+ 'testing')
+ # packages remaining longer than 7 days in testing
+ find "${work_dir}/package-states" -mindepth 1 -maxdepth 1 -name '*.testing' -mtime +7 \
+ -exec head -n1 {} \; | \
+ modify-package-state -n --tested /dev/stdin
+ ;;
+ 'build-list')
+ while read -r pkg rev mod_rev repo; do
+ git_repo=$(
+ find_repository_with_commit "${rev}"
+ )
+ eval repo_path='"${repo_paths__'"${git_repo}"'}"'
+ commit_date=$(
+ git -C "${repo_path}" show -s --format=%ct "${rev}"
+ )
+ mod_commit_date=$(
+ git -C "${repo_paths__archlinux32}" show -s --format=%ct "${mod_rev}"
+ )
+ if [ "${mod_commit_date}" -gt "${commit_date}" ]; then
+ commit_date="${mod_commit_date}"
+ fi
+ # packages remaining longer than 7 days on the build list
+ if [ "$((commit_date + 24*60*60*7))" -lt "$(date '+%s')" ]; then
+ printf '%s %s %s %s\n' \
+ "${pkg}" \
+ "${rev}" \
+ "${mod_rev}" \
+ "${repo}"
+ fi
+ done < \
+ "${work_dir}/build-list"
+ ;;
+ 'staging')
+ # packages remaining longer than 2 days in staging
+ find "${work_dir}/package-states" -mindepth 1 -maxdepth 1 -name '*.done' -mtime +2 -printf '%f\n' | \
+ sed '
+ s|\.done$||
+ '
+ ;;
+ *)
+ >&2 printf 'unknown archaic-source "%s" - skipped.\n' "${source}"
+ ;;
+ esac
+ done | \
+ sort -u
+}
diff --git a/bin/db-update b/bin/db-update
index 241acf0..279e44f 100755
--- a/bin/db-update
+++ b/bin/db-update
@@ -484,8 +484,11 @@ find "${work_dir}/package-infos" -name '*.groups' \
sort -u > \
"${tmp_dir}/base-packages"
-# shellcheck disable=SC2086
-printf '%s\n' ${packages_to_force_unstage} > \
+{
+ # shellcheck disable=SC2086
+ printf '%s\n' ${packages_to_force_unstage}
+ print_list_of_archaic_packages 'build-list'
+} > \
"${tmp_dir}/force-unstage-packages"
# calculate what packages should be unstaged:
@@ -501,17 +504,19 @@ if [ -z "$(
)" ]; then
>&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
+ sed '/ base$/d' "${s}" > \
+ "${s}.no-base"
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"
fi
-# shellcheck disable=SC2086
-printf '%s\n' ${packages_to_force_stabilize} > \
+{
+ # shellcheck disable=SC2086
+ printf '%s\n' ${packages_to_force_stabilize}
+ print_list_of_archaic_packages 'build-list' 'staging' 'testing'
+} > \
"${tmp_dir}/force-stabilize-packages"
# calculate what packages should be stabilized