From ef56e1e1cce9e8d8b147778424667ccf1fc56ac7 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 10 Aug 2017 10:55:25 +0200 Subject: bin/db-update: also accept package file names instead of package state file names --- bin/db-update | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'bin/db-update') diff --git a/bin/db-update b/bin/db-update index 7c60df7..48e0eb0 100755 --- a/bin/db-update +++ b/bin/db-update @@ -381,6 +381,37 @@ if [ -s "${work_dir}/build-master-sanity" ]; then exit 1 fi +tmp_dir=$(mktemp -d "${work_dir}/tmp.XXXXXX") +trap 'rm -rf --one-file-system "${tmp_dir}"' EXIT + +packages_to_stabilize=$( + ( + printf '%s\n' ${packages_to_stabilize} | \ + sort -u | \ + sed ' + /\.pkg\.tar\.xz$/{ + w '"${tmp_dir}/packages-to-stabilize"' + d + } + ' > /dev/null + ls "${work_dir}/package-states" | \ + sed -n ' + /\.testing$/{ + s|^|'"${work_dir}"'/package-states/| + p + } + ' | \ + xargs -r grep -HF '' | \ + sed ' + s|^.*/|| + s|^\([^:]\+\)\.testing:|\1 | + ' | \ + sort -k2,2 | \ + join -1 2 -2 1 -o 1.1 - "${tmp_dir}/packages-to-stabilize" + ) | \ + sort -u +) + for package in ${packages_to_stabilize}; do # some sanity checks if [ ! -f "${work_dir}/package-states/${package}.testing" ]; then @@ -403,8 +434,6 @@ if ! flock ${block_flag} 8; then exit 1 fi -tmp_dir=$(mktemp -d "${work_dir}/tmp.XXXXXX") - clean_up_lock_file() { rm -f "${package_database_lock_file}" "${build_list_lock_file}" rm -rf --one-file-system "${tmp_dir}" -- cgit v1.2.3-70-g09d2