Re: [RFC] fix git detection code in newvers.sh when svn installe
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
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
討論串 (同標題文章)
完整討論串 (本文為第 4 之 4 篇):