summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-07-03 12:31:30 +0200
committerErich Eckner <git@eckner.net>2017-07-03 12:31:30 +0200
commit5284c12274f0d81dc2fac978cc703072897696fd (patch)
treed2a0283a1b22412be508558aabab9864f7582d73
parent935ecd4f59ca0da45bd5cd502f98c1b7006060b9 (diff)
downloadbuilder-5284c12274f0d81dc2fac978cc703072897696fd.tar.xz
bin/get-package-updates: do nothing if nothing changed
-rwxr-xr-xbin/get-package-updates11
1 files changed, 11 insertions, 0 deletions
diff --git a/bin/get-package-updates b/bin/get-package-updates
index b292932..12ae82f 100755
--- a/bin/get-package-updates
+++ b/bin/get-package-updates
@@ -101,6 +101,8 @@ done
# Read previous git revision numbers from files.
+something_new=false
+
for repo in ${repo_names}; do
eval "old_repo_revisions__${repo}='$(
cat "${work_dir}/${repo}.revision" 2> /dev/null || \
@@ -111,8 +113,17 @@ for repo in ${repo_names}; do
git -C "${repo_path}" rev-parse HEAD | \
tee "${work_dir}/${repo}.revision.new"
)'"
+ eval 'if ! [ "${new_repo_revisions__'"${repo}"'}" = "${old_repo_revisions__'"${repo}"'}" ]; then
+ something_new=true
+ fi'
done
+if ${pull} && \
+ ! ${something_new}; then
+ >&2 echo 'Nothing changed.'
+ exit
+fi
+
# Create a lock file for build list.
exec 9> "${build_list_lock_file}"