commit:     5ddaec4db70483bff1a83cef04af84cee7e5e1c1
Author:     Yuan Liao <liaoyuan <AT> gmail <DOT> com>
AuthorDate: Mon Jun 14 20:22:34 2021 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Tue Jun 15 06:55:31 2021 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=5ddaec4d

scripts/setup-and-run-repoman.sh: use 'sort -V' to get latest tag

Without the -V flag to enable version sort, 'sort' can falsely identify
a version string like 3.0.9 to be greater than 3.0.10.  This can be
shown by running 'git tag | grep portage | sort -u' in the Portage Git
tree.  This issue is not so prominent for repoman yet because the latest
version of repoman as of now is 3.0.3, but it will surface when repoman
3.0.10 is released.

Signed-off-by: Yuan Liao <liaoyuan <AT> gmail.com>
Closes: https://github.com/gentoo/sci/pull/1094
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>

 scripts/setup-and-run-repoman.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/setup-and-run-repoman.sh b/scripts/setup-and-run-repoman.sh
index f9e45a9cf..471a05181 100755
--- a/scripts/setup-and-run-repoman.sh
+++ b/scripts/setup-and-run-repoman.sh
@@ -16,7 +16,7 @@ git clone https://github.com/gentoo/portage.git
 cd portage
 
 # Get all versions, and read into array
-mapfile -t RM_VERSIONS < <( git tag | grep repoman | sort -u )
+mapfile -t RM_VERSIONS < <( git tag | grep repoman | sort -uV )
 
 # Select latests version (last element in array)
 RM_VERS="${RM_VERSIONS[-1]}"

Reply via email to