From cb4af716c525f90dd1e6d2df1f360c236f309717 Mon Sep 17 00:00:00 2001 From: Konrad Lipinski Date: Wed, 19 Feb 2020 12:02:47 +0100 Subject: [PATCH] Use more specific version regexp in release.sh Change-Id: I651cc7e75153f0dcddbf6a77330c3094af028373 --- release.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/release.sh b/release.sh index 755cf29..1849509 100755 --- a/release.sh +++ b/release.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved +# Copyright (c) 2019-2020 Samsung Electronics Co., Ltd. All rights reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ echo "Alfa-version of release script. Use on your own responsibility ;)" CURRENT_MAJOR=($(cat packaging/askuser-notification.spec | grep Version | awk -F ":" '{print $2}' | awk -F "." '{print $2}')) CURRENT_MINOR=($(cat packaging/askuser-notification.spec | grep Version | awk -F ":" '{print $2}' | awk -F "." '{print $3}')) CURRENT_VERSION="$CURRENT_MAJOR.$CURRENT_MINOR" +CURRENT_VERSION_RE="\\<$CURRENT_MAJOR\\.$CURRENT_MINOR\\>" # A POSIX variable OPTIND=1 # Reset in case getopts has been used previously in the shell. @@ -64,12 +65,12 @@ echo if [[ $REPLY =~ ^[Yy]$ ]] then echo "Updating CMakeLists.txt files..." - find . -name "CMakeLists.txt" -type f -print0 | xargs -0 sed -i "s/${CURRENT_VERSION}/${NEW_VERSION}/g" + find . -name "CMakeLists.txt" -type f -print0 | xargs -0 sed -i "s/${CURRENT_VERSION_RE}/${NEW_VERSION}/g" echo "Updating spec files..." - find . -name "*.spec" -type f -print0 | xargs -0 sed -i "s/${CURRENT_VERSION}/${NEW_VERSION}/g" + find . -name "*.spec" -type f -print0 | xargs -0 sed -i "s/${CURRENT_VERSION_RE}/${NEW_VERSION}/g" echo "Checking left files..." - left_files=($(git grep -IF "${CURRENT_VERSION}" | awk -F ":" '{print $1}' | sort -u)) + left_files=($(git grep -I "${CURRENT_VERSION_RE}" | awk -F ":" '{print $1}' | sort -u)) CHANGELOG_FILE="packaging/askuser.changes" if [ ${#left_files[*]} -ne 1 ] -- 2.34.1