forked from cpp-netlib/cpp-netlib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.sh
executable file
·47 lines (39 loc) · 2.09 KB
/
package.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh
#
# Copyright 2012 Dean Michael Berris <[email protected]>
# Copyright 2012 Google, Inc.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
VERSION="$1"
if [ "$VERSION" = "" ]; then
VERSION="`git log --format=oneline | awk '{print $1}' | head -1`"
fi
# Break down the version in form "M.m.p" into individual variables.
BOOST_NETLIB_VERSION_MAJOR=`echo $VERSION | sed 's/[\._\-]/ /g' | awk '{print $1}'`
BOOST_NETLIB_VERSION_MINOR=`echo $VERSION | sed 's/[\._\-]/ /g' | awk '{print $2}'`
BOOST_NETLIB_VERSION_INCREMENT=`echo $VERSION | sed 's/[\._\-]/ /g' | awk '{print $3}'`
echo $BOOST_NETLIB_VERSION_MAJOR
echo $BOOST_NETLIB_VERSION_MINOR
echo $BOOST_NETLIB_VERSION_INCREMENT
# Then update the version.
sed -i '' 's/BOOST_NETLIB_VERSION_MAJOR [0-9]*/BOOST_NETLIB_VERSION_MAJOR '$BOOST_NETLIB_VERSION_MAJOR'/g' boost/network/version.hpp
sed -i '' 's/BOOST_NETLIB_VERSION_MINOR [0-9]*/BOOST_NETLIB_VERSION_MINOR '$BOOST_NETLIB_VERSION_MINOR'/g' boost/network/version.hpp
sed -i '' 's/BOOST_NETLIB_VERSION_INCREMENT [0-9]*/BOOST_NETLIB_VERSION_INCREMENT '$BOOST_NETLIB_VERSION_INCREMENT'/g' boost/network/version.hpp
sed -i '' 's/CPPNETLIB_VERSION_MAJOR [0-9]*/CPPNETLIB_VERSION_MAJOR '$BOOST_NETLIB_VERSION_MAJOR'/g' CMakeLists.txt
sed -i '' 's/CPPNETLIB_VERSION_MINOR [0-9]*/CPPNETLIB_VERSION_MINOR '$BOOST_NETLIB_VERSION_MINOR'/g' CMakeLists.txt
sed -i '' 's/CPPNETLIB_VERSION_PATCH [0-9]*/CPPNETLIB_VERSION_PATCH '$BOOST_NETLIB_VERSION_INCREMENT'/g' CMakeLists.txt
# Show the diff
git diff boost/network/version.hpp CMakeLists.txt
# Commit the change
git add boost/network/version.hpp
git add CMakeLists.txt
git commit -m"Bumping release number to $VERSION"
TAG="cpp-netlib-$VERSION"
git tag $TAG
echo "Tagged $TAG."
git-archive-all --prefix=cpp-netlib-$VERSION/ --force-submodules cpp-netlib-$VERSION.zip
git-archive-all --prefix=cpp-netlib-$VERSION/ --force-submodules cpp-netlib-$VERSION.tar.gz
git-archive-all --prefix=cpp-netlib-$VERSION/ --force-submodules cpp-netlib-$VERSION.tar.bz2
echo "Packaged $TAG."