From patchwork Tue Aug 14 03:59:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 1318311 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 670963FC81 for ; Tue, 14 Aug 2012 06:42:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751950Ab2HNGmC (ORCPT ); Tue, 14 Aug 2012 02:42:02 -0400 Received: from lsd-gw.ic.unicamp.br ([143.106.7.165]:36868 "EHLO boneca.lsd.ic.unicamp.br" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751783Ab2HNGmB (ORCPT ); Tue, 14 Aug 2012 02:42:01 -0400 X-Greylist: delayed 2292 seconds by postgrey-1.27 at vger.kernel.org; Tue, 14 Aug 2012 02:42:01 EDT Received: from freie (gw-to-emilia.oliva.athome.lsd.ic.unicamp.br [172.31.160.17] (may be forged)) by boneca.lsd.ic.unicamp.br (8.14.5/8.14.5) with ESMTP id q7E63ieu016733 for ; Tue, 14 Aug 2012 03:03:45 -0300 Received: from livre.localdomain (livre-to-gw.oliva.athome.lsd.ic.unicamp.br [172.31.160.19]) by freie (8.14.5/8.14.5) with ESMTP id q7E63hWO012766 for ; Tue, 14 Aug 2012 03:03:44 -0300 Received: from livre.localdomain (aoliva@localhost.localdomain [127.0.0.1]) by livre.localdomain (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id q7E63hPw026286; Tue, 14 Aug 2012 03:03:43 -0300 Received: (from aoliva@localhost) by livre.localdomain (8.14.3/8.14.3/Submit) id q7E63g5a026284; Tue, 14 Aug 2012 03:03:42 -0300 X-Authentication-Warning: livre.localdomain: aoliva set sender to oliva@lsd.ic.unicamp.br using -f From: Alexandre Oliva To: ceph-devel@vger.kernel.org Subject: Search for srcdir/.git in check_version Date: Tue, 14 Aug 2012 00:59:42 -0300 Organization: Free thinker, not speaking for University of Campinas Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org Support srcdir != . looking for .git in srcdir when computing the ceph release and git tag. Signed-off-by: Alexandre Oliva --- src/check_version | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/check_version b/src/check_version index e31ca49..8600c55 100755 --- a/src/check_version +++ b/src/check_version @@ -1,12 +1,13 @@ #!/bin/sh -if [ ! -d ../.git ]; then - echo "not updating .git_version (no ../.git)" +dname=`dirname $0` + +if [ ! -d $dname/../.git ]; then + echo "not updating .git_version (no $dname/../.git)" exit 0 fi -dname=`dirname $0` -cur=`git rev-parse HEAD 2>/dev/null; git describe 2>/dev/null` +cur=`cd $dname && git rev-parse HEAD 2>/dev/null; git describe 2>/dev/null` [ -e $1 ] && old=`cat $1` if [ "$cur" != "$old" ]; then