diff options
Diffstat (limited to '')
-rwxr-xr-x | scripts/release.sh (renamed from release.sh) | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/release.sh b/scripts/release.sh index b4ae81c..dad3f25 100755 --- a/release.sh +++ b/scripts/release.sh @@ -44,29 +44,35 @@ fi # expected version regex re='^v([0-9]+\.[0-9]+(\.[0-9]+)?)(-rc[0-9]+)?$' -# use the version string provided from the command line for nvme-cli +# use the version string provided from the command line if [[ "$VERSION" =~ ${re} ]]; then - echo "nvme-cli: valid version $VERSION string" + echo "valid version $VERSION string" # remove the leading 'v' ver="${VERSION#v}" else - echo "nvme-cli: invalid version string ${VERSION}" + echo "invalid version string $VERSION" exit 1 fi -# extract the vesion string from libnvme by using the ref -# defined in libnvme.wrap. -libnvme_ref=$(sed -n "s/revision = \([0-9a-z]\+\)/\1/p" subprojects/libnvme.wrap) -libnvme_VERSION=$(git -C subprojects/libnvme describe "${libnvme_ref}") -if [[ "${libnvme_VERSION}" =~ ${re} ]]; then - echo "libnvme: valid version ${libnvme_VERSION} string" +cd "$(git rev-parse --show-toplevel)" || exit 1 - # remove the leading 'v' - libnvme_ver="${libnvme_VERSION#v}" -else - echo "libnvme: invalid version string ${libnvme_VERSION}" - exit 1 +if [[ -f subprojects/libnvme.wrap ]]; then + git -C subprojects/libnvme fetch --all + + # extract the vesion string from libnvme by using the ref + # defined in libnvme.wrap. + libnvme_ref=$(sed -n "s/revision = \([0-9a-z]\+\)/\1/p" subprojects/libnvme.wrap) + libnvme_VERSION=$(git -C subprojects/libnvme describe "${libnvme_ref}") + if [[ "${libnvme_VERSION}" =~ ${re} ]]; then + echo "libnvme: valid version ${libnvme_VERSION} string" + + # remove the leading 'v' + libnvme_ver="${libnvme_VERSION#v}" + else + echo "libnvme: invalid version string ${libnvme_VERSION}" + exit 1 + fi fi if [[ -n $(git status -s) ]]; then @@ -94,7 +100,10 @@ fi # update meson.build sed -i -e "0,/[ \t]version: /s/\([ \t]version: \).*/\1\'$ver\',/" meson.build -sed -i -e "s/\(dependency('libnvme', version: '>=\)\([\.1-9]\+\)/\1$libnvme_ver/" meson.build +if [[ -f subprojects/libnvme.wrap ]]; then + sed -i -e "s/\(dependency('libnvme', version: '>=\)\([\.1-9]\+\)/\1$libnvme_ver/" meson.build +fi + if [[ "${dry_run}" = false ]]; then git add meson.build git commit -s -m "build: Update version to $VERSION" @@ -102,7 +111,7 @@ fi if [ "$build_doc" = true ]; then # update documentation - ./$doc_dir/update-docs.sh + ./scripts/update-docs.sh if [[ "${dry_run}" = false ]]; then git add $doc_dir git commit -s -m "doc: Regenerate all docs for $VERSION" |