From owner-freebsd-current@FreeBSD.ORG Fri Jan 6 19:16:55 2012 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D71D1065678; Fri, 6 Jan 2012 19:16:55 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-tul01m020-f182.google.com (mail-tul01m020-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id D8DFE8FC18; Fri, 6 Jan 2012 19:16:54 +0000 (UTC) Received: by obbwd18 with SMTP id wd18so3172669obb.13 for ; Fri, 06 Jan 2012 11:16:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=MPjmpaZwc/8KSw0f7lvktWIRLGDDzv04h8AilE6phUU=; b=XBGhdI9+0HKVKiae3a56IWeTP0838Vt4N8N1TAtA8KUfRFnvKB9z5N9s5KOM1yRNjS QbWaKZfWRH+mWm40ZFGUOzCKjtLfUiNdiO85OcehoMnNI9PyY+zLLSv1NCicYA153f1L TOrXkI6G7eNkpkAInnsZnTYxL0hzYeJuOMuiA= MIME-Version: 1.0 Received: by 10.182.1.67 with SMTP id 3mr5869198obk.31.1325877414133; Fri, 06 Jan 2012 11:16:54 -0800 (PST) Received: by 10.182.152.6 with HTTP; Fri, 6 Jan 2012 11:16:54 -0800 (PST) In-Reply-To: <201201062002.29775.pinter@tresorium.hu> References: <201201061850.33863.pinter@tresorium.hu> <201201062002.29775.pinter@tresorium.hu> Date: Fri, 6 Jan 2012 11:16:54 -0800 Message-ID: From: Garrett Cooper To: Oliver Pinter Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: stable@freebsd.org, Sergey Kandaurov , current@freebsd.org Subject: Re: [RFC] fix git detection code in newvers.sh when svn installed X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2012 19:16:55 -0000 On Fri, Jan 6, 2012 at 11:02 AM, Oliver Pinter wrote: > On Friday 06 January 2012 19:35:31 Sergey Kandaurov wrote: >> On 6 January 2012 21:50, Oliver Pinter 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