File update.sh of Package R-shinyIncubator
#! /bin/bash
NAME=shinyIncubator
PKGNAME=R-$NAME
git clone --depth 1 https://github.com/rstudio/shiny-incubator ${NAME}
osc rm $NAME-*.tar.bz2
pushd ${NAME}
date=`date +"%Y%m%d"`
ver=`sed -n 's/Version: \([0-9.]\+\)/\1/p' DESCRIPTION`
VER=${ver}_$date
ARC=$NAME-$VER.tar.bz2
echo ".gitignore export-ignore" >.gitattributes
echo ".gitattributes export-ignore" >>.gitattributes
echo ".Rbuildignore export-ignore" >>.gitattributes
git add .gitattributes
git commit -m "add ignores"
git archive --prefix=$NAME/ master | bzip2 >../$ARC
popd
echo "New date $date, version $ver"
sed -i "s/\(Version: \+\).\+/\1$VER/" $PKGNAME.spec
rm -rf $NAME
osc add $ARC