From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from 93-97-173-237.zone5.bethere.co.uk ([93.97.173.237] helo=tim.rpsys.net) by linuxtogo.org with esmtp (Exim 4.72) (envelope-from ) id 1SXXlQ-0004Ma-PB for bitbake-devel@lists.openembedded.org; Thu, 24 May 2012 15:07:37 +0200 Received: from localhost (localhost [127.0.0.1]) by tim.rpsys.net (8.13.6/8.13.8) with ESMTP id q4OCvQcU023782 for ; Thu, 24 May 2012 13:57:26 +0100 Received: from tim.rpsys.net ([127.0.0.1]) by localhost (tim.rpsys.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 23145-03 for ; Thu, 24 May 2012 13:57:22 +0100 (BST) Received: from [192.168.3.10] ([192.168.3.10]) (authenticated bits=0) by tim.rpsys.net (8.13.6/8.13.8) with ESMTP id q4OCvHNU023775 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 24 May 2012 13:57:18 +0100 Message-ID: <1337864236.8248.111.camel@ted> From: Richard Purdie To: bitbake-devel Date: Thu, 24 May 2012 13:57:16 +0100 X-Mailer: Evolution 3.2.2- Mime-Version: 1.0 X-Virus-Scanned: amavisd-new at rpsys.net Subject: [PATCH] bitbake/utils.py: Ensure utils.which() returns full paths X-BeenThere: bitbake-devel@lists.openembedded.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 13:07:37 -0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit If the path passed to which contains empty elements, it will search the current working directory for the file which is correct baheviour. Various pieces of code assume the path returned is a full path though. This commit ensures we don't return relative paths. Signed-off-by: Richard Purdie --- diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 7a73419..fc389a3 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py @@ -721,6 +721,8 @@ def which(path, item, direction = 0): for p in paths: next = os.path.join(p, item) if os.path.exists(next): + if not os.path.isabs(next): + next = os.path.abspath(next) return next return ""