Use more specific version regexp in release.sh 89/225389/3
authorKonrad Lipinski <k.lipinski2@samsung.com>
Wed, 19 Feb 2020 11:02:47 +0000 (12:02 +0100)
committerZofia Abramowska <z.abramowska@samsung.com>
Mon, 30 Mar 2020 10:42:03 +0000 (10:42 +0000)
Change-Id: I651cc7e75153f0dcddbf6a77330c3094af028373

release.sh

index 755cf2915ff1b398765360e839ef74c06f6677b9..1849509abb50c47ba3ccec159cdccf53cb6c90cd 100755 (executable)
@@ -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 ]