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