83a5074
#!/usr/bin/bash
83a5074
83a5074
REPO_URI=https://github.com/github/hub
83a5074
OLD_COMMIT=$(grep "%global commit" hub.spec |cut -d ' ' -f3)
83a5074
HEAD_COMMIT=$(git ls-remote $REPO_URI HEAD | cut -f1)
83a5074
83a5074
sed -i "/%global commit/c\%global commit $HEAD_COMMIT" hub.spec
83a5074
83a5074
spectool -g hub.spec
83a5074
83a5074
CHANGELOG=$(/usr/bin/python3 hub-commits.py $OLD_COMMIT $HEAD_COMMIT 2>/dev/null)
83a5074
if [ $? ]; then
83a5074
    CHANGELOG=
83a5074
fi
83a5074
83a5074
rpmdev-bumpspec hub.spec -c "Updating to upstream commit $HEAD_COMMIT"
83a5074
83a5074
TARBALL=hub-prerelease-${HEAD_COMMIT:0:7}.tar.gz
83a5074
echo "Uploading $TARBALL to Fedora"
83a5074
83a5074
fedpkg new-sources $TARBALL
83a5074