LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File get-from-git.sh of Package dcadec (Project home:smarty12)

#!/bin/bash

NAME=dcadec
# this is a huge hunk of stuff, so reuse the local repo if possible
if [ -d ${NAME}/.git ]; then
	cd ${NAME}
	git pull
	cd ..
else
	set -e
	git clone https://github.com/foo86/dcadec.git
	set +e
fi

TOPDIR=$(pwd)
cd ${NAME}
LINE=$(git show --format=format:"%h %ai"|head -n 1)
set -- $LINE
REV=$1
DATE=$2
VER=${DATE//-/.}
set -e
git archive --prefix=${NAME}-${VER}/ -o $TOPDIR/${NAME}-${VER}.tar master
cd $TOPDIR
bzip2 -9 ${NAME}-${VER}.tar
sed -i "s/^Version:.*/Version:        ${VER}/" ${NAME}.spec
osc vc -m "Update to $REV ($DATE)"