]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
scripts: handle libnvme version update correctly
authorDaniel Wagner <wagi@kernel.org>
Thu, 31 Oct 2024 09:33:40 +0000 (10:33 +0100)
committerDaniel Wagner <wagi@kernel.org>
Thu, 31 Oct 2024 09:33:40 +0000 (10:33 +0100)
The pattern \([\.1-9]\+\) captures strings like .1, .9, or other
partial version numbers starting from 1. For full version formats, we
can update the pattern to capture more comprehensive version styles,
including major, minor, and patch levels (e.g., 1.0, 1.2.3, 10.3, etc.).

Exchange the match with:

\([0-9]\+\) matches the major version, consisting of one or more digits.

\(\.[0-9]\+\)* matches any additional minor or patch versions, capturing
optional segments starting with a dot and followed by one or more
digits.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
scripts/release.sh

index eb6eced4c25fef70dd61693ac32c409b86b85a00..10dcc0041e214c869d1aba93815a1896e200e083 100755 (executable)
@@ -135,7 +135,7 @@ fi
 # update meson.build
 sed -i -e "0,/[ \t]version: /s/\([ \t]version: \).*/\1\'$ver\',/" meson.build
 if [[ -n "$libnvme_VERSION" ]] && [[ -f subprojects/libnvme.wrap ]]; then
-    sed -i -e "s/\(dependency('libnvme', version: '>=\)\([\.1-9]\+\)/\1$libnvme_ver/" meson.build
+    sed -i -e "s/\(dependency('libnvme', version: '>=\)\([0-9]\+\(\.[0-9]\+\)*\)/\1$libnvme_ver/" meson.build
 fi
 
 git add meson.build