File get_from_git.sh of Package raspberrypi-userland
#!/bin/bash
# this is a huge hunk of stuff, so reuse the local repo if possible
if [ -d userland/.git ]; then
cd userland
git pull
cd ..
else
set -e
git clone --depth 1 https://github.com/raspberrypi/userland.git
set +e
fi
TOPDIR=$(pwd)
cd userland
LINE=$(git show --format=format:"%h %ai"|head -n 1)
set -- $LINE
REV=$1
DATE=$2
VER=0.0~git${DATE//-/.}
set -e
git archive --prefix=raspberrypi-userland-$VER/ -o $TOPDIR/raspberrypi-userland-${VER}.tar master
cd $TOPDIR
osc rm -f raspberrypi-userland-*.tar.bz2 || true
bzip2 raspberrypi-userland-${VER}.tar
osc add raspberrypi-userland-${VER}.tar.bz2
sed -i "s/^Version:.*/Version: $VER/" raspberrypi-userland.spec
osc vc -m "Update to $REV ($DATE)"