checkout directly from upstream git, including runtime files
This commit is contained in:
parent
e9cd821e44
commit
56ffd8ab42
@ -1,58 +1,57 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
debug=""
|
debug=""
|
||||||
#debug="echo"
|
#debug="echo "
|
||||||
|
|
||||||
cd `dirname $0`
|
cd `dirname $0`
|
||||||
LANG=C
|
LANG=C
|
||||||
SPEC=vim.spec
|
SPEC=vim.spec
|
||||||
|
CHANGES=1
|
||||||
|
|
||||||
DATE=`date +"%a %b %d %Y"`
|
DATE=`date +"%a %b %d %Y"`
|
||||||
MAJORVERSION=`grep "define baseversion" vim.spec | cut -d ' ' -f 3`
|
MAJORVERSION=`grep "define baseversion" vim.spec | cut -d ' ' -f 3`
|
||||||
CHLOG="* $DATE Karsten Hopp <karsten@redhat.com> $MAJORVERSION"
|
|
||||||
ORIGPL=`grep "define patchlevel" vim.spec | cut -d ' ' -f 3 | sed -e "s/^0*//g"`
|
ORIGPL=`grep "define patchlevel" vim.spec | cut -d ' ' -f 3 | sed -e "s/^0*//g"`
|
||||||
ORIGPLFILLED=`printf "%03d" $ORIGPL`
|
ORIGPLFILLED=`printf "%03d" $ORIGPL`
|
||||||
PL=$ORIGPL
|
PL=$ORIGPL
|
||||||
|
|
||||||
git pull
|
if [ ! -d vim-upstream ]; then
|
||||||
|
git clone https://github.com/vim/vim.git vim-upstream
|
||||||
while true; do
|
|
||||||
LASTPL=$PL
|
|
||||||
LASTPLFILLED=`printf "%03d" $LASTPL`
|
|
||||||
PL=$((PL+1))
|
|
||||||
PLFILLED=`printf "%03d" $PL`
|
|
||||||
PNAME="$MAJORVERSION.$PLFILLED"
|
|
||||||
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
|
|
||||||
PL=$LASTPL
|
|
||||||
PLFILLED=$LASTPLFILLED
|
|
||||||
LASTPL=$((LASTPL-1))
|
|
||||||
LASTPLFILLED=`printf "%03d" $LASTPL`
|
|
||||||
if [ "$PL" == "$ORIGPL" ]; then
|
|
||||||
echo "No new patchlevel available"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
break
|
|
||||||
else
|
|
||||||
# echo "Got patchlevel $MAJORVERSION.$PL, current CVS is at $MAJORVERSION.$ORIGPL"
|
|
||||||
$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
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
sed -i -e "/Release: /cRelease: 1%{?dist}" $SPEC
|
|
||||||
sed -i -e "s/define patchlevel $ORIGPLFILLED/define patchlevel $PLFILLED/" $SPEC
|
|
||||||
sed -i -e "/\%changelog/a$CHLOG.$PLFILLED-1\n- patchlevel $PLFILLED\n" $SPEC
|
|
||||||
wget ftp://ftp.vim.org/pub/vim/patches/$MAJORVERSION/README -O README.patches
|
|
||||||
$debug git add vim.spec README.patches
|
|
||||||
$debug git commit -m "- patchlevel $PL"
|
|
||||||
$debug git push
|
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
$debug rm -f $HOME/.koji/config
|
|
||||||
$debug fedpkg build
|
|
||||||
$debug ln -sf ppc-config $HOME/.koji/config
|
|
||||||
else
|
else
|
||||||
echo "GIT push failed"
|
pushd vim-upstream
|
||||||
|
git pull
|
||||||
|
popd
|
||||||
|
fi
|
||||||
|
|
||||||
|
pushd vim-upstream
|
||||||
|
LASTTAG=$(git describe --tags $(git rev-list --tags --max-count=1))
|
||||||
|
UPSTREAMMAJOR=$(echo $LASTTAG | sed -e 's/v\([0-9]*\.[0-9]*\).*/\1/')
|
||||||
|
LASTPL=`echo $LASTTAG| sed -e 's/.*\.//'`
|
||||||
|
LASTPLFILLED=`printf "%03d" $LASTPL`
|
||||||
|
if [ "$ORIGPLFILLED" == "$LASTPLFILLED" ]; then
|
||||||
|
echo "No new patchlevel available"
|
||||||
|
CHANGES=0
|
||||||
|
fi
|
||||||
|
rm -rf dist/* 2>/dev/null
|
||||||
|
make unixall
|
||||||
|
mv dist/vim-${UPSTREAMMAJOR}.tar.bz2 dist/vim-${UPSTREAMMAJOR}-${LASTPLFILLED}.tar.bz2
|
||||||
|
git log > dist/README.patches
|
||||||
|
popd
|
||||||
|
|
||||||
|
cp -f vim-upstream/dist/README.patches README.patches
|
||||||
|
cp -f vim-upstream/dist/vim-${UPSTREAMMAJOR}-${LASTPLFILLED}.tar.bz2 .
|
||||||
|
if [ $CHANGES ]; then
|
||||||
|
CHLOG="* $DATE Karsten Hopp <karsten@redhat.com> $UPSTREAMMAJOR"
|
||||||
|
sed -i -e "/Release: /cRelease: 1%{?dist}" $SPEC
|
||||||
|
sed -i -e "s/define patchlevel $ORIGPLFILLED/define patchlevel $LASTPLFILLED/" $SPEC
|
||||||
|
sed -i -e "/\%changelog/a$CHLOG.$LASTPLFILLED-1\n- patchlevel $LASTPLFILLED\n" $SPEC
|
||||||
|
$debug fedpkg new-sources vim-${UPSTREAMMAJOR}-${LASTPLFILLED}.tar.bz2
|
||||||
|
$debug git add vim.spec README.patches
|
||||||
|
$debug git commit -m "- patchlevel $LASTPL"
|
||||||
|
$debug git push
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
$debug rm -f $HOME/.koji/config
|
||||||
|
$debug fedpkg build
|
||||||
|
$debug ln -sf ppc-config $HOME/.koji/config
|
||||||
|
else
|
||||||
|
echo "GIT push failed"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user