提交 c204243b authored 作者: Travis Cross's avatar Travis Cross

tagscript: reindent

上级 a511ff30
#!/bin/bash #!/bin/bash
##### -*- mode:shell-script; indent-tabs-mode:nil; sh-basic-offset:2 -*-
##### release a version of FreeSWITCH
src_repo="$(pwd)" src_repo="$(pwd)"
if [ ! -d .git ]; then if [ ! -d .git ]; then
echo "error: must be run from within the top level of a FreeSWITCH git tree." 1>&2 echo "error: must be run from within the top level of a FreeSWITCH git tree." 1>&2
exit 1; exit 1;
fi fi
showusage() { showusage() {
echo "usage: ./scripts/tagscript.sh [-s] MAJOR.MINOR.MICRO[.REVISION]" 1>&2 echo "usage: ./scripts/tagscript.sh [-s] MAJOR.MINOR.MICRO[.REVISION]" 1>&2
exit 1; exit 1;
} }
while getopts "s" o; do while getopts "s" o; do
case "$o" in case "$o" in
s) opts="-s" ;; s) opts="-s" ;;
esac esac
done done
shift $(($OPTIND-1)) shift $(($OPTIND-1))
if [ -z "$1" ]; then if [ -z "$1" ]; then
showusage showusage
fi fi
ver="$1" ver="$1"
...@@ -33,26 +35,26 @@ dst_name="freeswitch-$major.$minor.$micro" ...@@ -33,26 +35,26 @@ dst_name="freeswitch-$major.$minor.$micro"
dst_dir="$src_repo/../$dst_name" dst_dir="$src_repo/../$dst_name"
if [ -d "$dst_dir" ]; then if [ -d "$dst_dir" ]; then
echo "error: destination directory $dst_dir already exists." 1>&2 echo "error: destination directory $dst_dir already exists." 1>&2
exit 1; exit 1;
fi fi
# save local changes # save local changes
ret=$(git stash save "Save uncommitted changes before tagging.") ret=$(git stash save "Save uncommitted changes before tagging.")
if echo $ret | grep "^Saved"; then if echo $ret | grep "^Saved"; then
stash_saved=1 stash_saved=1
fi fi
sed -e "s|\(AC_SUBST(SWITCH_VERSION_MAJOR, \[\).*\(\])\)|\1$major\2|" \ sed -e "s|\(AC_SUBST(SWITCH_VERSION_MAJOR, \[\).*\(\])\)|\1$major\2|" \
-e "s|\(AC_SUBST(SWITCH_VERSION_MINOR, \[\).*\(\])\)|\1$minor\2|" \ -e "s|\(AC_SUBST(SWITCH_VERSION_MINOR, \[\).*\(\])\)|\1$minor\2|" \
-e "s|\(AC_SUBST(SWITCH_VERSION_MICRO, \[\).*\(\])\)|\1$micro\2|" \ -e "s|\(AC_SUBST(SWITCH_VERSION_MICRO, \[\).*\(\])\)|\1$micro\2|" \
-e "s|\(AC_INIT(\[freeswitch\], \[\).*\(\], BUG-REPORT-ADDRESS)\)|\1$major.$minor.$micro\2|" \ -e "s|\(AC_INIT(\[freeswitch\], \[\).*\(\], BUG-REPORT-ADDRESS)\)|\1$major.$minor.$micro\2|" \
-i configure.in -i configure.in
if [ -n "$rev" ]; then if [ -n "$rev" ]; then
sed -e "s|\(AC_SUBST(SWITCH_VERSION_REVISION, \[\).*\(\])\)|\1$rev\2|" \ sed -e "s|\(AC_SUBST(SWITCH_VERSION_REVISION, \[\).*\(\])\)|\1$rev\2|" \
-e "s|#\(AC_SUBST(SWITCH_VERSION_REVISION\)|\1|" \ -e "s|#\(AC_SUBST(SWITCH_VERSION_REVISION\)|\1|" \
-i configure.in -i configure.in
fi fi
git add configure.in git add configure.in
...@@ -61,7 +63,7 @@ git tag -a ${opts} -m "freeswitch-$ver release" v$ver ...@@ -61,7 +63,7 @@ git tag -a ${opts} -m "freeswitch-$ver release" v$ver
git clone $src_repo $dst_dir git clone $src_repo $dst_dir
if [ -n "$stash_saved" ]; then if [ -n "$stash_saved" ]; then
git stash pop git stash pop
fi fi
cd $dst_dir cd $dst_dir
...@@ -87,3 +89,4 @@ server (I didn't do that for you, as you might want to review first). ...@@ -87,3 +89,4 @@ server (I didn't do that for you, as you might want to review first).
---------------------------------------------------------------------- ----------------------------------------------------------------------
EOF EOF
exit 0
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论