File update.sh of Package valyriatear

#!/bin/sh
set -e
NAME="ValyriaTear"
BASE_VERSION="1.0.0"
GIT_URL="https://github.com/ValyriaTear/ValyriaTear.git"
# Remove old source tarball
osc rm --force "$NAME"*".tar.xz"
# Clone git repo and update submodules
git clone "$GIT_URL" "$NAME"
cd "$NAME"
# As we use system luabind we do not need the submodules, if you use this file in other packages, remove the `#`
# git submodule init && git submodule update
# Get date of last commit
DATE=$(git log -1 --format=%cI | grep -Po "^[0-9-]*" | sed "s/-//g")
export VERSION="$BASE_VERSION+$DATE"
echo "New date: $DATE New Version: $VERSION"
cd ..
# Create tarball
mv "$NAME" "$NAME-$VERSION"
tar --exclude-vcs -cJf "$NAME-$VERSION".tar.xz "$NAME-$VERSION"
rm -rf "$NAME-$VERSION/"
# Update version in spec file
sed -i "s/Version:.*/Version:        $VERSION/" valyriatear.spec
# Add files to obs
osc add "$NAME-$VERSION.tar.xz"
openSUSE Build Service is sponsored by