forked from Seagate/opensea-common
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update-version.sh
executable file
·27 lines (26 loc) · 1019 Bytes
/
update-version.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
: '
//
// Do NOT modify or remove this copyright and license
//
// Copyright (c) 2012 - 2022 Seagate Technology LLC and/or its Affiliates, All Rights Reserved
//
// This software is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// ******************************************************************************************
//
// \file update-version.h
// \brief Update the version number & check in code.
//
'
VERSION_FILE=include/opensea_common_version.h
BASE=`awk '$2 == "OPENSEA_COMMON_PATCH_VERSION" {print $1 " " $2}' "$VERSION_FILE"`
CURRENT_VERSION=`awk '$2 == "OPENSEA_COMMON_PATCH_VERSION" {print $3}' "$VERSION_FILE"`
NEXT_VER=$((CURRENT_VERSION + 1))
echo $BASE $CURRENT_VERSION
echo $BASE $NEXT_VER
sed -i "/._PATCH_VERSION\s*/s/$CURRENT_VERSION/$NEXT_VER/" "$VERSION_FILE"
MAKE_FILE=Make/gcc/Makefile
sed -i "/PATCH=*/s/$CURRENT_VERSION/$NEXT_VER/" "$MAKE_FILE"