Merge pull request #36 from conserver/fix-sed-inplace-warning

Fix #35 - check for sed inplace style
This commit is contained in:
Bryan Stansell 2019-11-15 22:37:18 -08:00 committed by GitHub
commit 933f3271ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,6 +2,11 @@
set -e set -e
case $(sed --help 2>&1) in
*GNU*) sed_i () { sed -i "$@"; };;
*) sed_i () { sed -i '' "$@"; };;
esac
local=false && [ "$1" = "local" ] && local=true local=false && [ "$1" = "local" ] && local=true
[ -f conserver/version.h ] || { echo "you are in the wrong place" ; exit 1; } [ -f conserver/version.h ] || { echo "you are in the wrong place" ; exit 1; }
@ -27,8 +32,8 @@ if [ ! -f ../conserver-$ver.tar.gz ] || $local; then
cd build/conserver-$ver cd build/conserver-$ver
../../package/setup-configure ../../package/setup-configure
rm -rf package rm -rf package
sed -i "" -e "/^%define ver/s| ver.*| ver $ver|" contrib/redhat-rpm/conserver.spec sed_i -e "/^%define ver/s| ver.*| ver $ver|" contrib/redhat-rpm/conserver.spec
sed -i "" -e "/^VERSION=/s|.*|VERSION=\"$ver\"|" contrib/solaris-package/pkginfo sed_i -e "/^VERSION=/s|.*|VERSION=\"$ver\"|" contrib/solaris-package/pkginfo
) )
$local && exit $local && exit
echo "Creating ../conserver-$ver.tar.gz" echo "Creating ../conserver-$ver.tar.gz"