|
|
f19595c |
#!/bin/bash
|
|
|
f19595c |
|
|
|
b4471e4 |
LANG=C.utf8
|
|
|
f19595c |
set -ex
|
|
|
304215e |
|
|
|
f19595c |
version="$1"
|
|
|
f19595c |
bug="$2"
|
|
|
c1597f7 |
args="$3"
|
|
|
f19595c |
ts="$(date '+%a %b %d %Y') $(git config user.name) <$(git config user.email)>"
|
|
|
f19595c |
|
|
|
f19595c |
sed -i "s/%changelog/%changelog\n* $ts - $version-1\n- New upstream release (#$bug).\n/" *.spec
|
|
|
f19595c |
sed -i -r "s/(^Version: *) .+/\1 $version/" *.spec
|
|
|
f19595c |
sed -i -r "s/(^Release: *) [0-9]+/\1 1/" *.spec
|
|
|
f19595c |
spectool -g *.spec
|
|
|
f19595c |
fedpkg local
|
|
|
c1597f7 |
spectool -l -S *.spec | awk '{print $2}' | sed s:.*/:: | xargs fedpkg new-sources
|
|
|
f19595c |
git add *.spec
|
|
|
725394c |
git commit -a -m "Upstream release $version"
|
|
|
c1597f7 |
|
|
|
d37219e |
if [ -d "archlinux-keyring" ]; then
|
|
|
6148ce5 |
(cd archlinux-keyring && git pull)
|
|
|
d37219e |
else
|
|
|
d37219e |
git clone https://projects.archlinux.org/archlinux-keyring.git/
|
|
|
d37219e |
fi
|
|
|
c1597f7 |
GIT_DIR=archlinux-keyring/.git git tag --verify "$version"
|
|
|
c1597f7 |
|
|
|
d37219e |
sum1=$(GIT_DIR=archlinux-keyring/.git git archive --prefix=archlinux-keyring-$version/ "$version"|md5sum -)
|
|
|
d37219e |
sum2=$(zcat archlinux-keyring-$version.tar.gz| md5sum -)
|
|
|
d37219e |
if [ "$sum1" != "$sum2" ]; then
|
|
|
d37219e |
echo "Checksums don't match!"
|
|
|
d37219e |
exit 1
|
|
|
d37219e |
fi
|
|
|
d37219e |
|
|
|
c1597f7 |
if [ "$args" = "-u" ]; then
|
|
|
c1597f7 |
git push
|
|
|
c1597f7 |
fedpkg build
|
|
|
c1597f7 |
fi
|