sys/conf/newvers.sh broken for work with git
Maciej Milewski
milu at dat.pl
Sat Nov 19 00:21:09 UTC 2011
Hi,
I encountered newvers.sh issue while working locally with git tree.
The last patch broke correct versioning. The issue is the "break" after
checking the svnversion cmd.
I use git for local work and have svnversion cmd too. So the first check
is true and break makes exit from further processing for loop. This way
there is no check if git is in path.
Quick hack would be changing the order of this "if" to first check if
there is .git dir and git cmd and then go further to check svnversion.
This solution might be not perfect but atleast is working for me.
Greetings,
Maciek
Quick patch is attached.
-------------- next part --------------
--- sys/conf/newvers.sh 2011-11-19 00:56:50.795815738 +0100
+++ sys/conf/newvers-patched.sh 2011-11-19 00:58:21.187818982 +0100
@@ -88,14 +88,14 @@
i=`${MAKE:-make} -V KERN_IDENT`
for dir in /bin /usr/bin /usr/local/bin; do
- if [ -x "${dir}/svnversion" ] ; then
- svnversion=${dir}/svnversion
- break
- fi
if [ -d "${SYSDIR}/../.git" -a -x "${dir}/git" ] ; then
git_cmd="${dir}/git --git-dir=${SYSDIR}/../.git"
break
fi
+ if [ -x "${dir}/svnversion" ] ; then
+ svnversion=${dir}/svnversion
+ break
+ fi
done
if [ -n "$svnversion" ] ; then
More information about the freebsd-current
mailing list