Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Jan 2012 11:16:54 -0800
From:      Garrett Cooper <yanegomi@gmail.com>
To:        Oliver Pinter <pinter@tresorium.hu>
Cc:        stable@freebsd.org, Sergey Kandaurov <pluknet@gmail.com>, current@freebsd.org
Subject:   Re: [RFC] fix git detection code in newvers.sh when svn installed
Message-ID:  <CAGH67wT7MY3wR%2B1ndJ=x=dfdzW-YNz=j5PydzgptihGG3E4U5Q@mail.gmail.com>
In-Reply-To: <201201062002.29775.pinter@tresorium.hu>
References:  <201201061850.33863.pinter@tresorium.hu> <CAE-mSOKaUZ-RJpaYVbQDvXp9dM9o7grbDL6U-TJ8jLBK9K%2BuQQ@mail.gmail.com> <201201062002.29775.pinter@tresorium.hu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jan 6, 2012 at 11:02 AM, Oliver Pinter <pinter@tresorium.hu> wrote:
> On Friday 06 January 2012 19:35:31 Sergey Kandaurov wrote:
>> On 6 January 2012 21:50, Oliver Pinter <pinter@tresorium.hu> wrote:
>> > Hi All!
>> >
>> > When svn installed and the source stored in git, then now the version
>> > detection failed. The attached patch fixed this situation.
>>
>> FWIW, a different version proposed by Maciej Milewski on -current
>> some time ago. I don't have/use git, so I cannot test these changes.
>> It is good in the sense that it doesn't duplicate a search path.
>> The patch is below for reference:
>>
>> --- sys/conf/newvers.sh =A0 =A0 =A0 2011-11-19 00:56:50.795815738 +0100
>> +++ sys/conf/newvers-patched.sh =A0 =A0 =A0 2011-11-19 00:58:21.18781898=
2 +0100
>> @@ -88,14 +88,14 @@
>> =A0i=3D`${MAKE:-make} -V KERN_IDENT`
>>
>> =A0for dir in /bin /usr/bin /usr/local/bin; do
>> - =A0 =A0 if [ -x "${dir}/svnversion" ] ; then
>> - =A0 =A0 =A0 =A0 =A0 =A0 svnversion=3D${dir}/svnversion
>> - =A0 =A0 =A0 =A0 =A0 =A0 break
>> - =A0 =A0 fi
>> =A0 =A0 =A0 if [ -d "${SYSDIR}/../.git" -a -x "${dir}/git" ] ; then
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 git_cmd=3D"${dir}/git --git-dir=3D${SYSDIR}/=
../.git"
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 break
>> =A0 =A0 =A0 fi
>> + =A0 =A0 if [ -x "${dir}/svnversion" ] ; then
>> + =A0 =A0 =A0 =A0 =A0 =A0 svnversion=3D${dir}/svnversion
>> + =A0 =A0 =A0 =A0 =A0 =A0 break
>> + =A0 =A0 fi
>> =A0done
>>
>> =A0if [ -n "$svnversion" ] ; then
>
> The problem with this, when git founded first and the source not stored i=
n
> git, then the svn version not correctly set, due the loop first found git=
,
> and than breaked out.
>
> The same situation as my patch fixed, but from svn viewpoint.

This detection method might be worth mentioning as well (look for
SVNVERSION: http://freenas.svn.sourceforge.net/viewvc/freenas/trunk/build/n=
ano_env?revision=3D9392&view=3Dmarkup
).
Cheers,
-Garrett



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGH67wT7MY3wR%2B1ndJ=x=dfdzW-YNz=j5PydzgptihGG3E4U5Q>