5766b0
#!/bin/sh
5766b0
#
5766b0
# Trivial script to rebuild drivers for ABI changes in the server
5766b0
# Run me after a new xserver has hit the buildroot
5766b0
5766b0
builddir="abi-rebuild"
5766b0
5766b0
#if [ -e "$builddir" ]; then
5766b0
#    echo "Path '$builddir' exists. Move out of the way first"
5766b0
#    exit 1
5766b0
#fi
5766b0
5766b0
mkdir -p $builddir
5766b0
pushd $builddir
5766b0
5766b0
if git config --get remote.origin.url | grep -q redhat.com ; then
5766b0
    pkg=rhpkg
5766b0
else
5766b0
    pkg=fedpkg
5766b0
fi
5766b0
5766b0
# figure out the branch we're on
5766b0
branch=$(git branch | awk '/^\*/ { print $2 }' | grep -v '^master$')
5766b0
if [ $branch ]; then
5766b0
    branch="-b $branch"
5766b0
fi
5766b0
5766b0
$pkg co $branch xorg-x11-drivers
5766b0
pushd xorg-x11-drivers
5766b0
driverlist=$(grep ^Requires *.spec | awk '{ print $2 }')
5766b0
popd
5766b0
5766b0
# Things not in -drivers for whatever reason...
5766b0
extradrivers="xorg-x11-glamor xorg-x11-drv-ivtv"
5766b0
5766b0
rm -rf xorg-x11-drivers
5766b0
echo $driverlist $extradrivers | xargs -n1 $pkg co $branch
5766b0
5766b0
for i in xorg-x11-drv-*/ ; do
5766b0
    [ -e $i/dead.package ] && continue
5766b0
    pushd $i
5766b0
    rpmdev-bumpspec -c "- 1.15 ABI rebuild" *.spec
5766b0
    $pkg commit -c -p && $pkg build --nowait
5766b0
    #$pkg mockbuild
5766b0
    #$pkg srpm
5766b0
    #mockchain -r fedora-20-x86_64 -l $OLDPWD
5766b0
    #mockchain -r rhel-7.0-candidate-x86_64 -l $OLDPWD
5766b0
5766b0
    if [ $i = "xorg-x11-glamor" ]; then
5766b0
        koji wait-repo f21-build --build $($pkg verrel)
5766b0
    fi
5766b0
5766b0
    popd
5766b0
done
5766b0
5766b0
popd
5766b0
5766b0