scripts/kernel_bump: Always drop v prefix
authorOlliver Schinagl <oliver@schinagl.nl>
Fri, 22 Mar 2024 07:38:02 +0000 (08:38 +0100)
committerRobert Marko <robimarko@gmail.com>
Fri, 12 Apr 2024 16:20:52 +0000 (18:20 +0200)
Naivly and lazyly the leading v was only dropped from optarg, not from any
environment variable.

Lets do this properly and ensure a leading 'v' is always dropped.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
scripts/kernel_bump.sh

index bbf6747fc10c31baa50ecf4af939f81373841a6e..82ee3f3effd6c8defa7c5c7f1d02e24da0b11ffb 100755 (executable)
@@ -77,6 +77,9 @@ init()
        initial_branch="$(git rev-parse --abbrev-ref HEAD)"
        initial_commitish="$(git rev-parse HEAD)"
 
+       source_version="${source_version#v}"
+       target_version="${target_version#v}"
+
        trap cleanup EXIT HUP INT QUIT ABRT ALRM TERM
 }
 
@@ -180,10 +183,10 @@ main()
                        platform_name="${OPTARG}"
                        ;;
                's')
-                       source_version="${OPTARG#v}"
+                       source_version="${OPTARG}"
                        ;;
                't')
-                       target_version="${OPTARG#v}"
+                       target_version="${OPTARG}"
                        ;;
                ':')
                        e_err "Option -${OPTARG} requires an argument."