[arvados] created: 2.5.0-283-g46883d9df
git repository hosting
git at public.arvados.org
Tue Mar 14 18:05:57 UTC 2023
at 46883d9df0b15d2114192a5f5bc738c6735d3ec0 (commit)
commit 46883d9df0b15d2114192a5f5bc738c6735d3ec0
Author: Lucas Di Pentima <lucas.dipentima at curii.com>
Date: Tue Mar 14 14:45:02 2023 -0300
19937: Only output development versions.
Also, fixed a previously existing issue where a release branch commit with
its nearest tag being older than the merge base commit was getting versioned
as the most newest development version of any given time.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima at curii.com>
diff --git a/build/version-at-commit.sh b/build/version-at-commit.sh
index e42b87539..50b1e300e 100755
--- a/build/version-at-commit.sh
+++ b/build/version-at-commit.sh
@@ -8,44 +8,36 @@ commit="$1"
versionglob="[0-9].[0-9]*.[0-9]*"
devsuffix="~dev"
-# automatically assign version
+# automatically assign *development* version
#
# handles the following cases:
#
-# 1. commit is directly tagged. print that.
-#
-# 2. commit is on main or a development branch, the nearest tag is older
+# * commit is on main or a development branch, the nearest tag is older
# than commit where this branch joins main.
# -> take greatest version tag in repo X.Y.Z and assign X.(Y+1).0
#
-# 3. commit is on a release branch, the nearest tag is newer
+# * commit is on a release branch, the nearest tag is newer
# than the commit where this branch joins main.
# -> take nearest tag X.Y.Z and assign X.Y.(Z+1)
-tagged=$(git tag --points-at "$commit")
-
-if [[ -n "$tagged" ]] ; then
- echo $tagged
-else
- # 1. get the nearest tag with 'git describe'
- # 2. get the merge base between this commit and main
- # 3. if the tag is an ancestor of the merge base,
- # (tag is older than merge base) increment minor version
- # else, tag is newer than merge base, so increment point version
+# 1. get the nearest tag with 'git describe'
+# 2. get the merge base between this commit and main
+# 3. if the tag is an ancestor of the merge base,
+# (tag is older than merge base) increment minor version
+# else, tag is newer than merge base, so increment point version
- nearest_tag=$(git describe --tags --abbrev=0 --match "$versionglob" "$commit")
- merge_base=$(git merge-base origin/main "$commit")
+nearest_tag=$(git describe --tags --abbrev=0 --match "$versionglob" "$commit")
+merge_base=$(git merge-base origin/main "$commit")
- if git merge-base --is-ancestor "$nearest_tag" "$merge_base" ; then
- # x.(y+1).0~devTIMESTAMP, where x.y.z is the newest version that does not contain $commit
- # grep reads the list of tags (-f) that contain $commit and filters them out (-v)
- # this prevents a newer tag from retroactively changing the versions of everything before it
- v=$(git tag | grep -vFf <(git tag --contains "$commit") | sort -Vr | head -n1 | perl -pe 's/(\d+)\.(\d+)\.\d+.*/"$1.".($2+1).".0"/e')
- else
- # x.y.(z+1)~devTIMESTAMP, where x.y.z is the latest released ancestor of $commit
- v=$(echo $nearest_tag | perl -pe 's/(\d+)$/$1+1/e')
- fi
- isodate=$(TZ=UTC git log -n1 --format=%cd --date=iso "$commit")
- ts=$(TZ=UTC date --date="$isodate" "+%Y%m%d%H%M%S")
- echo "${v}${devsuffix}${ts}"
+if git merge-base --is-ancestor "$nearest_tag" "$merge_base" ; then
+ # x.(y+1).0~devTIMESTAMP, where x.y.z is the newest version that does not contain $commit
+ # grep reads the list of tags (-f) that contain $commit and filters them out (-v)
+ # this prevents a newer tag from retroactively changing the versions of everything before it
+ v=$(git tag | grep -vFf <(git tag --contains "$merge_base") | sort -Vr | head -n1 | perl -pe 's/(\d+)\.(\d+)\.\d+.*/"$1.".($2+1).".0"/e')
+else
+ # x.y.(z+1)~devTIMESTAMP, where x.y.z is the latest released ancestor of $commit
+ v=$(echo $nearest_tag | perl -pe 's/(\d+)$/$1+1/e')
fi
+isodate=$(TZ=UTC git log -n1 --format=%cd --date=iso "$commit")
+ts=$(TZ=UTC date --date="$isodate" "+%Y%m%d%H%M%S")
+echo "${v}${devsuffix}${ts}"
commit 6897fc7ca3e02cbd444757b9829d0fccbcc1834d
Author: Lucas Di Pentima <lucas.dipentima at curii.com>
Date: Fri Jan 27 17:22:01 2023 -0300
19937: Avoids processing empty input (e.g: when statically linked).
This prevents red herring error messages like:
...
== Packages dependencies for ./usr/share/python3/dist/python3-arvados-cwl-runner/lib/python3.7/site-packages/schema_salad/ref_resolver.cpython-37m-x86_64-linux-gnu.so ==
dpkg-query: error: --search needs at least one file name pattern argument
Use --help for help about querying packages.
...
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima at curii.com>
diff --git a/build/package-testing/deb-common-test-packages.sh b/build/package-testing/deb-common-test-packages.sh
index 32fb2009e..cb9d538e8 100755
--- a/build/package-testing/deb-common-test-packages.sh
+++ b/build/package-testing/deb-common-test-packages.sh
@@ -50,7 +50,7 @@ if [[ "$DEBUG" != "0" ]]; then
while read so && [ -n "$so" ]; do
echo
echo "== Packages dependencies for $so =="
- ldd "$so" | awk '($3 ~ /^\//){print $3}' | sort -u | xargs dpkg -S | cut -d: -f1 | sort -u
+ ldd "$so" | awk '($3 ~ /^\//){print $3}' | sort -u | xargs -r dpkg -S | cut -d: -f1 | sort -u
done <<EOF
$(find -name '*.so')
EOF
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list