git: 266f919b0bb0 - main - Tools/scripts: Improvements in hackage-get-latest-version.sh: Add examples and shortened comparisons

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Wed, 01 Oct 2025 08:44:35 UTC
The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=266f919b0bb04bf43593c0cf089b444e73339d3c

commit 266f919b0bb04bf43593c0cf089b444e73339d3c
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2025-10-01 03:42:48 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2025-10-01 08:44:28 +0000

    Tools/scripts: Improvements in hackage-get-latest-version.sh: Add examples and shortened comparisons
---
 Tools/scripts/hackage-get-latest-version.sh | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/Tools/scripts/hackage-get-latest-version.sh b/Tools/scripts/hackage-get-latest-version.sh
index 3b46a809d986..3ad21fcbd73a 100755
--- a/Tools/scripts/hackage-get-latest-version.sh
+++ b/Tools/scripts/hackage-get-latest-version.sh
@@ -17,6 +17,8 @@ PACKAGE_NAME="$1"
 
 if [ -z "$PACKAGE_NAME" ]; then
 	echo "Usage: $0 <package-name>"
+	echo "Example: $0 cryptol"
+	echo "Example: $0 ShellCheck"
 	exit 1
 fi
 
@@ -25,11 +27,11 @@ fi
 for dep in curl jq version_sort; do
 	if ! which -s $dep; then
 		echo "error: the '$dep' dependency is missing"
-		if [ $dep == "curl" ]; then
+		if [ $dep = "curl" ]; then
 			echo "... please install the 'curl' package"
-		elif [ $dep == "jq" ]; then
+		elif [ $dep = "jq" ]; then
 			echo "... please install the 'jq' package"
-		elif [ $dep == "version_sort" ]; then
+		elif [ $dep = "version_sort" ]; then
 			echo "... please install the 'libversion' package"
 		fi
 		exit 1