|
Karsten Hopp |
16bcfe |
#!/bin/bash
|
|
Karsten Hopp |
4a08e5 |
debug=""
|
|
Karsten Hopp |
4a08e5 |
#debug="echo"
|
|
Karsten Hopp |
16bcfe |
|
|
Karsten Hopp |
16bcfe |
LANG=C
|
|
Karsten Hopp |
16bcfe |
SPEC=vim.spec
|
|
Karsten Hopp |
16bcfe |
|
|
Karsten Hopp |
16bcfe |
DATE=`date +"%a %b %d %Y"`
|
|
Karsten Hopp |
16bcfe |
MAJORVERSION=`grep "define baseversion" vim.spec | cut -d ' ' -f 3`
|
|
Karsten Hopp |
16bcfe |
CHLOG="* $DATE Karsten Hopp <karsten@redhat.com> $MAJORVERSION"
|
|
Karsten Hopp |
4a08e5 |
ORIGPL=`grep "define patchlevel" vim.spec | cut -d ' ' -f 3 | sed -e "s/^0*//g"`
|
|
Karsten Hopp |
4a08e5 |
ORIGPLFILLED=`printf "%03d" $ORIGPL`
|
|
Karsten Hopp |
16bcfe |
PL=$ORIGPL
|
|
Karsten Hopp |
16bcfe |
|
|
Karsten Hopp |
5a0d8b |
git pull
|
|
Karsten Hopp |
9d2110 |
|
|
Karsten Hopp |
16bcfe |
while true; do
|
|
Karsten Hopp |
5a0d8b |
LASTPL=$PL
|
|
Karsten Hopp |
5a0d8b |
LASTPLFILLED=`printf "%03d" $LASTPL`
|
|
Karsten Hopp |
16bcfe |
PL=$((PL+1))
|
|
Karsten Hopp |
5a0d8b |
PLFILLED=`printf "%03d" $PL`
|
|
Karsten Hopp |
5a0d8b |
PNAME="$MAJORVERSION.$PLFILLED"
|
|
Karsten Hopp |
16bcfe |
URL="ftp://ftp.vim.org/pub/vim/patches/$MAJORVERSION/$PNAME"
|
|
Karsten Hopp |
16bcfe |
wget -nc $URL 2>/dev/null
|
|
Karsten Hopp |
16bcfe |
if [ "$?" -ne "0" ]; then
|
|
Karsten Hopp |
16bcfe |
# Patchlevel not yet available, back down
|
|
Karsten Hopp |
5a0d8b |
PL=$LASTPL
|
|
Karsten Hopp |
5a0d8b |
PLFILLED=$LASTPLFILLED
|
|
Karsten Hopp |
5a0d8b |
LASTPL=$((LASTPL-1))
|
|
Karsten Hopp |
5a0d8b |
LASTPLFILLED=`printf "%03d" $LASTPL`
|
|
Karsten Hopp |
16bcfe |
if [ "$PL" == "$ORIGPL" ]; then
|
|
Karsten Hopp |
16bcfe |
echo "No new patchlevel available"
|
|
Karsten Hopp |
16bcfe |
exit
|
|
Karsten Hopp |
16bcfe |
fi
|
|
Karsten Hopp |
16bcfe |
break
|
|
Karsten Hopp |
16bcfe |
else
|
|
Karsten Hopp |
16bcfe |
# echo "Got patchlevel $MAJORVERSION.$PL, current CVS is at $MAJORVERSION.$ORIGPL"
|
|
Karsten Hopp |
4a08e5 |
$debug git add $PNAME
|
|
Karsten Hopp |
4a08e5 |
$debug git commit -m "- patchlevel $PLFILLED" $PNAME
|
|
Karsten Hopp |
4a08e5 |
sed -i -e "/Patch$LASTPLFILLED: ftp:\/\/ftp.vim.org\/pub\/vim\/patches\/$MAJORVERSION\/$MAJORVERSION.$LASTPLFILLED/aPatch$PLFILLED: ftp:\/\/ftp.vim.org\/pub\/vim\/patches\/$MAJORVERSION\/$MAJORVERSION.$PLFILLED" $SPEC
|
|
Karsten Hopp |
4a08e5 |
sed -i -e "/patch$LASTPLFILLED -p0/a%patch$PLFILLED -p0" $SPEC
|
|
Karsten Hopp |
16bcfe |
fi
|
|
Karsten Hopp |
16bcfe |
done
|
|
Karsten Hopp |
0dbda4 |
sed -i -e "/Release: /cRelease: 1%{?dist}" $SPEC
|
|
Karsten Hopp |
4a08e5 |
sed -i -e "s/define patchlevel $ORIGPLFILLED/define patchlevel $PLFILLED/" $SPEC
|
|
Karsten Hopp |
4a08e5 |
sed -i -e "/\%changelog/a$CHLOG.$PLFILLED-1\n- patchlevel $PLFILLED\n" $SPEC
|
|
Karsten Hopp |
16bcfe |
wget ftp://ftp.vim.org/pub/vim/patches/$MAJORVERSION/README -O README.patches
|
|
Karsten Hopp |
a998f9 |
$debug git add vim.spec README.patches
|
|
Karsten Hopp |
4a08e5 |
$debug git commit -m "- patchlevel $PL"
|
|
Karsten Hopp |
bba8e9 |
$debug git push
|
|
Karsten Hopp |
bba8e9 |
if [ $? -eq 0 ]; then
|
|
Karsten Hopp |
bba8e9 |
$debug rm -f $HOME/.koji/config
|
|
Karsten Hopp |
bba8e9 |
$debug fedpkg build
|
|
Karsten Hopp |
bba8e9 |
$debug ln -sf $HOME/.koji/s390-config config
|
|
Karsten Hopp |
bba8e9 |
else
|
|
Karsten Hopp |
bba8e9 |
echo "GIT push failed"
|
|
Karsten Hopp |
bba8e9 |
fi
|