2010-01-28 20:14:29 +00:00
|
|
|
#!/bin/bash
|
2010-09-30 14:31:17 +00:00
|
|
|
debug=""
|
|
|
|
#debug="echo"
|
2010-01-28 20:14:29 +00:00
|
|
|
|
2012-11-12 14:31:27 +00:00
|
|
|
cd `dirname $0`
|
2010-01-28 20:14:29 +00:00
|
|
|
LANG=C
|
|
|
|
SPEC=vim.spec
|
|
|
|
|
|
|
|
DATE=`date +"%a %b %d %Y"`
|
|
|
|
MAJORVERSION=`grep "define baseversion" vim.spec | cut -d ' ' -f 3`
|
|
|
|
CHLOG="* $DATE Karsten Hopp <karsten@redhat.com> $MAJORVERSION"
|
2010-09-30 14:31:17 +00:00
|
|
|
ORIGPL=`grep "define patchlevel" vim.spec | cut -d ' ' -f 3 | sed -e "s/^0*//g"`
|
|
|
|
ORIGPLFILLED=`printf "%03d" $ORIGPL`
|
2010-01-28 20:14:29 +00:00
|
|
|
PL=$ORIGPL
|
|
|
|
|
2010-09-22 15:20:30 +00:00
|
|
|
git pull
|
2010-01-28 20:33:41 +00:00
|
|
|
|
2010-01-28 20:14:29 +00:00
|
|
|
while true; do
|
2010-09-22 15:20:30 +00:00
|
|
|
LASTPL=$PL
|
|
|
|
LASTPLFILLED=`printf "%03d" $LASTPL`
|
2010-01-28 20:14:29 +00:00
|
|
|
PL=$((PL+1))
|
2010-09-22 15:20:30 +00:00
|
|
|
PLFILLED=`printf "%03d" $PL`
|
|
|
|
PNAME="$MAJORVERSION.$PLFILLED"
|
2010-01-28 20:14:29 +00:00
|
|
|
URL="ftp://ftp.vim.org/pub/vim/patches/$MAJORVERSION/$PNAME"
|
|
|
|
wget -nc $URL 2>/dev/null
|
|
|
|
if [ "$?" -ne "0" ]; then
|
|
|
|
# Patchlevel not yet available, back down
|
2010-09-22 15:20:30 +00:00
|
|
|
PL=$LASTPL
|
|
|
|
PLFILLED=$LASTPLFILLED
|
|
|
|
LASTPL=$((LASTPL-1))
|
|
|
|
LASTPLFILLED=`printf "%03d" $LASTPL`
|
2010-01-28 20:14:29 +00:00
|
|
|
if [ "$PL" == "$ORIGPL" ]; then
|
|
|
|
echo "No new patchlevel available"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
break
|
|
|
|
else
|
|
|
|
# echo "Got patchlevel $MAJORVERSION.$PL, current CVS is at $MAJORVERSION.$ORIGPL"
|
2010-09-30 14:31:17 +00:00
|
|
|
$debug git add $PNAME
|
|
|
|
$debug git commit -m "- patchlevel $PLFILLED" $PNAME
|
|
|
|
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
|
|
|
|
sed -i -e "/patch$LASTPLFILLED -p0/a%patch$PLFILLED -p0" $SPEC
|
2010-01-28 20:14:29 +00:00
|
|
|
fi
|
|
|
|
done
|
2010-01-28 23:24:56 +00:00
|
|
|
sed -i -e "/Release: /cRelease: 1%{?dist}" $SPEC
|
2010-09-30 14:31:17 +00:00
|
|
|
sed -i -e "s/define patchlevel $ORIGPLFILLED/define patchlevel $PLFILLED/" $SPEC
|
|
|
|
sed -i -e "/\%changelog/a$CHLOG.$PLFILLED-1\n- patchlevel $PLFILLED\n" $SPEC
|
2010-01-28 20:14:29 +00:00
|
|
|
wget ftp://ftp.vim.org/pub/vim/patches/$MAJORVERSION/README -O README.patches
|
2010-09-30 14:34:13 +00:00
|
|
|
$debug git add vim.spec README.patches
|
2010-09-30 14:31:17 +00:00
|
|
|
$debug git commit -m "- patchlevel $PL"
|
2010-09-30 14:36:37 +00:00
|
|
|
$debug git push
|
|
|
|
if [ $? -eq 0 ]; then
|
|
|
|
$debug rm -f $HOME/.koji/config
|
|
|
|
$debug fedpkg build
|
|
|
|
$debug ln -sf $HOME/.koji/s390-config config
|
|
|
|
else
|
|
|
|
echo "GIT push failed"
|
|
|
|
fi
|