some cleanups in the update script
This commit is contained in:
parent
cd22a8b86a
commit
8710382fb4
@ -11,7 +11,6 @@ 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`
|
||||||
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
|
|
||||||
|
|
||||||
if [ ! -d vim-upstream ]; then
|
if [ ! -d vim-upstream ]; then
|
||||||
git clone https://github.com/vim/vim.git vim-upstream
|
git clone https://github.com/vim/vim.git vim-upstream
|
||||||
@ -22,37 +21,44 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
pushd vim-upstream
|
pushd vim-upstream
|
||||||
|
# get the latest tag. Might be tricky with other packages, but upstream vim uses just a single branch:
|
||||||
LASTTAG=$(git describe --tags $(git rev-list --tags --max-count=1))
|
LASTTAG=$(git describe --tags $(git rev-list --tags --max-count=1))
|
||||||
|
# vim upstream tags have the form v7.4.123. Remove the 'v' and get major release and patchlevel:
|
||||||
UPSTREAMMAJOR=$(echo $LASTTAG | sed -e 's/v\([0-9]*\.[0-9]*\).*/\1/')
|
UPSTREAMMAJOR=$(echo $LASTTAG | sed -e 's/v\([0-9]*\.[0-9]*\).*/\1/')
|
||||||
LASTPL=`echo $LASTTAG| sed -e 's/.*\.//'`
|
LASTPL=`echo $LASTTAG| sed -e 's/.*\.//'`
|
||||||
LASTPLFILLED=`printf "%03d" $LASTPL`
|
LASTPLFILLED=`printf "%03d" $LASTPL`
|
||||||
echo "$ORIGPLFILLED" == "$LASTPLFILLED"
|
|
||||||
if [ "$ORIGPLFILLED" == "$LASTPLFILLED" ]; then
|
if [ "$ORIGPLFILLED" == "$LASTPLFILLED" ]; then
|
||||||
echo "No new patchlevel available"
|
echo "No new patchlevel available"
|
||||||
CHANGES=0
|
CHANGES=0
|
||||||
fi
|
fi
|
||||||
rm -rf dist/* 2>/dev/null
|
rm -rf dist/* 2>/dev/null
|
||||||
make unixall
|
make unixall
|
||||||
|
# include patchlevel in tarball name so that older sources won't get overwritten:
|
||||||
mv dist/vim-${UPSTREAMMAJOR}.tar.bz2 dist/vim-${UPSTREAMMAJOR}-${LASTPLFILLED}.tar.bz2
|
mv dist/vim-${UPSTREAMMAJOR}.tar.bz2 dist/vim-${UPSTREAMMAJOR}-${LASTPLFILLED}.tar.bz2
|
||||||
|
# We don't include the full upstream changelog in the rpm changelog, just ship a file with
|
||||||
|
# the changes:
|
||||||
git log > dist/README.patches
|
git log > dist/README.patches
|
||||||
popd
|
popd
|
||||||
|
|
||||||
cp -f vim-upstream/dist/README.patches README.patches
|
cp -f vim-upstream/dist/README.patches README.patches
|
||||||
cp -f vim-upstream/dist/vim-${UPSTREAMMAJOR}-${LASTPLFILLED}.tar.bz2 .
|
cp -f vim-upstream/dist/vim-${UPSTREAMMAJOR}-${LASTPLFILLED}.tar.bz2 .
|
||||||
if [ $CHANGES -ne 0 ]; then
|
if [ $CHANGES -ne 0 ]; then
|
||||||
CHLOG="* $DATE Karsten Hopp <karsten@redhat.com> $UPSTREAMMAJOR"
|
CHLOG="* $DATE Karsten Hopp <karsten@redhat.com> $UPSTREAMMAJOR"
|
||||||
$debug sed -i -e "/Release: /cRelease: 1%{?dist}" $SPEC
|
$debug sed -i -e "/Release: /cRelease: 1%{?dist}" $SPEC
|
||||||
$debug sed -i -e "s/define patchlevel $ORIGPLFILLED/define patchlevel $LASTPLFILLED/" $SPEC
|
if [ "x$MAJORVERSION" != "x$UPSTREAMMAJOR" ]; then
|
||||||
$debug sed -i -e "/\%changelog/a$CHLOG.$LASTPLFILLED-1\n- patchlevel $LASTPLFILLED\n" $SPEC
|
$debug sed -i -s "s/define baseversion: $MAJORVERSION/define baseversion: $UPSTREAMMAJOR=/" $SPEC
|
||||||
$debug fedpkg new-sources vim-${UPSTREAMMAJOR}-${LASTPLFILLED}.tar.bz2
|
fi
|
||||||
$debug git add vim.spec README.patches
|
$debug sed -i -e "s/define patchlevel $ORIGPLFILLED/define patchlevel $LASTPLFILLED/" $SPEC
|
||||||
$debug git commit -m "- patchlevel $LASTPL"
|
$debug sed -i -e "/\%changelog/a$CHLOG.$LASTPLFILLED-1\n- patchlevel $LASTPLFILLED\n" $SPEC
|
||||||
$debug git push
|
$debug fedpkg new-sources vim-${UPSTREAMMAJOR}-${LASTPLFILLED}.tar.bz2
|
||||||
if [ $? -eq 0 ]; then
|
$debug git add vim.spec README.patches
|
||||||
$debug rm -f $HOME/.koji/config
|
$debug git commit -m "- patchlevel $LASTPL"
|
||||||
$debug fedpkg build
|
$debug git push
|
||||||
$debug ln -sf ppc-config $HOME/.koji/config
|
if [ $? -eq 0 ]; then
|
||||||
else
|
$debug rm -f $HOME/.koji/config
|
||||||
echo "GIT push failed"
|
$debug fedpkg build
|
||||||
fi
|
$debug ln -sf ppc-config $HOME/.koji/config
|
||||||
|
else
|
||||||
|
echo "GIT push failed"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user