From e029dd74065a58b4c5fdf7dbab369804fddb2683 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 4 Sep 2017 09:36:36 +0200 Subject: bin/build-packages: accept "$git_repo-HEAD" as revision for package repository $git_repo --- bin/build-packages | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bin/build-packages b/bin/build-packages index a286ff8..0ba4a57 100755 --- a/bin/build-packages +++ b/bin/build-packages @@ -189,6 +189,18 @@ while [ "${count}" -ne 0 ]; do git_revision="${package##* }" package="${package% *}" + if [ "${git_revision##*-}" = 'HEAD' ]; then + git_revision=$( + repo_name="${git_revision%-*}" + eval repo_path='"${repo_paths__'"${repo_name}"'}"' + if [ -z "${repo_path}" ]; then + >&2 printf 'Unknown git repository "%s".\n' "${repo_name}" + exit 2 + fi + git -C "${repo_path}" rev-parse HEAD + ) + fi + if [ "${mod_git_revision}" = 'work-tree' ]; then mod_git_revision=$( # we can't just create an empty index-file with mktemp, because git doesn't like it -- cgit v1.2.3-70-g09d2