summaryrefslogtreecommitdiff
path: root/bin/common-functions
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 /bin/common-functions
parent0b9304e309a4da488d6fa6686ebbd2326b988b33 (diff)
downloadbuilder-be5450c060ab4556a79b11852c3c3de34a2f0693.tar.xz
bin/common-functions, bin/db-update: print_list_of_archaic_packages new -- ignore archaic packages for dependency considerations
Diffstat (limited to 'bin/common-functions')
-rwxr-xr-xbin/common-functions54
1 files changed, 54 insertions, 0 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
+}