summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-10-10 13:15:26 +0200
committerErich Eckner <git@eckner.net>2017-10-10 13:15:26 +0200
commit6bbcc70c01bf1436b6b0aa8e564f553bf6e1eb04 (patch)
tree333f05a27c95a23c8834a72b009cecb4a888b34b /bin
parentfb90fdd796f1598a30a8293226a652f0a3631fc5 (diff)
downloadbuilder-6bbcc70c01bf1436b6b0aa8e564f553bf6e1eb04.tar.xz
bin/get-package-updates: if PKGBUILD gets deleted, but is still present elsewhere, package should be considered "changed"
Diffstat (limited to 'bin')
-rwxr-xr-xbin/get-package-updates79
1 files changed, 38 insertions, 41 deletions
diff --git a/bin/get-package-updates b/bin/get-package-updates
index e0209b8..d5bd4b8 100755
--- a/bin/get-package-updates
+++ b/bin/get-package-updates
@@ -189,51 +189,48 @@ done | \
sort -k1,1 | \
sed 's|^[012] ||' | \
while read -r mode package git_revision repository; do
- case "${mode}" in
-
- # new or modified PKGBUILD
- "A"|"M")
- sed -i "/^$(str_to_regex "${package}") /d" "${work_dir}/build-list.new"
- # shellcheck disable=SC2154
- echo "${package} ${git_revision} ${new_repo_revisions__archlinux32} ${repository}" >> \
- "${work_dir}/build-list.new"
- sed -i "/^$(str_to_regex "${package}")\$/d" "${work_dir}/deletion-list.new"
- ;;
-
+ if [ "${mode}" = 'D' ]; then
# deleted PKGBUILD
- "D")
- found_package=false
- for repository in ${repo_names}; do
- eval 'repo_path="${repo_paths__'"${repository}"'}"'
- if [ "${repository}" = "archlinux32" ]; then
- if git -C "${repo_path}" archive "$(cat "${work_dir}/${repository}.revision")" 2> /dev/null | \
- tar -t 2> /dev/null | \
- grep -q "$(str_to_regex "${package}")/PKGBUILD$"; then
- found_package=true
- break;
- fi
- else
- if git -C "${repo_path}" archive "$(cat "${work_dir}/${repository}.revision")" -- "${package}/repos" 2> /dev/null | \
- tar -t --wildcards "${package}/repos/*/PKGBUILD" 2> /dev/null | \
- cut -d/ -f3 | \
- grep -v 'staging\|testing\|-unstable' | \
- grep -vq -- '-i686$'; then
- found_package=true
- break;
- fi
+ found_package=false
+ for repository in ${repo_names}; do
+ eval 'repo_path="${repo_paths__'"${repository}"'}"'
+ if [ "${repository}" = "archlinux32" ]; then
+ if git -C "${repo_path}" archive "$(cat "${work_dir}/${repository}.revision")" 2> /dev/null | \
+ tar -t 2> /dev/null | \
+ grep -q "$(str_to_regex "${package}")/PKGBUILD$"; then
+ found_package=true
+ break;
+ fi
+ else
+ if git -C "${repo_path}" archive "$(cat "${work_dir}/${repository}.revision")" -- "${package}/repos" 2> /dev/null | \
+ tar -t --wildcards "${package}/repos/*/PKGBUILD" 2> /dev/null | \
+ cut -d/ -f3 | \
+ grep -v 'staging\|testing\|-unstable' | \
+ grep -vq -- '-i686$'; then
+ found_package=true
+ break;
fi
- done
- if ! ${found_package}; then
- delete_package "${package}"
fi
- ;;
-
- *)
- >&2 echo "unknown git diff mode '${mode}'"
- exit 1
- ;;
+ done
+ if ${found_package}; then
+ mode='M'
+ else
+ delete_package "${package}"
+ continue
+ fi
+ fi
+ if [ "${mode}" = 'A' ] || [ "${mode}" = 'M' ]; then
+ # new or modified PKGBUILD
+ sed -i "/^$(str_to_regex "${package}") /d" "${work_dir}/build-list.new"
+ # shellcheck disable=SC2154
+ echo "${package} ${git_revision} ${new_repo_revisions__archlinux32} ${repository}" >> \
+ "${work_dir}/build-list.new"
+ sed -i "/^$(str_to_regex "${package}")\$/d" "${work_dir}/deletion-list.new"
+ continue
+ fi
- esac
+ >&2 echo "unknown git diff mode '${mode}'"
+ exit 1
done
sort -u "${work_dir}/deletion-list.new" | \