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