Sophie

Sophie

distrib > Mageia > 5 > i586 > media > tainted-updates-src > by-pkgid > c15293ac49f373ffc6c635d388a71a9e > files > 3

dolphin-emu-4.0.2-8.5406.2.1.mga5.tainted.src.rpm

#!/bin/sh
# Make a snapshot for dolphin-emu from its git repo
# Optional argument: commit hash or tag

if [ ! -e dolphin.git ]; then
    echo "=== Cloning Git repository ==="
    git clone http://github.com/dolphin-emu/dolphin.git
    pushd dolphin.git
else
    echo "=== Updating Git clone ==="
    pushd dolphin.git
    git pull --rebase
fi

if [ $# == 0 ]; then
    rev="master"
    # The upstream dev snapshot version seems to be the number of commits
    # minus 10904 (most likely the first commit in the 4.0 branch)
    snapver="4.0.2+$(expr $(git rev-list HEAD | wc -l) - 10904)"
    echo -e "=== Exporting HEAD revision, dev snapshot number $snapver ==="
elif [ $# == 1 ]; then
    rev="$1"
    snapver=$rev
    echo -e "=== Exporting specified target revision: $1 ==="
fi

dirname="dolphin-emu-$snapver"
git checkout $rev
git checkout-index -a -f --prefix="../$dirname/"

echo "=== Unbundling unnecessary content ==="
popd && pushd $dirname
rm -rf .git* .mailmap Source/.clang-format Source/Android Installer/dxredist \
       Externals/{gettext,libiconv-1.14,libpng,libusbx,LZO,miniupnpc,msvcrt,OpenAL,polarssl,portaudio,Qt,SFML,soundtouch,wxWidgets3,XAudio2_7,zlib}
popd

echo "=== Generating the tarball ==="
tar cvJf $dirname.tar.xz $dirname

rm -rf $dirname