lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 02 Dec 2013 16:16:28 +0100
From:	Michal Marek <mmarek@...e.cz>
To:	Franck Bui-Huu <fbuihuu@...il.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Fix detectition of kernel git repository in setlocalversion
 script

On 2.12.2013 16:14, Franck Bui-Huu wrote:
> On 12/02/2013 03:57 PM, Michal Marek wrote:
>> On 2.12.2013 14:21, Franck Bui-Huu wrote:
>>> diff --git a/scripts/setlocalversion b/scripts/setlocalversion
>>> index 0b5ccf3..c16e65d 100755
>>> --- a/scripts/setlocalversion
>>> +++ b/scripts/setlocalversion
>>> @@ -43,7 +43,8 @@ scm_version()
>>>  	fi
>>>  
>>>  	# Check for git and a git repo.
>>> -	if test -d .git && head=`git rev-parse --verify --short HEAD 2>/dev/null`; then
>>> +	if topdir=$(git rev-parse --show-cdup 2>/dev/null) && test -z "$topdir" &&
>>> +	   head=`git rev-parse --verify --short HEAD 2>/dev/null`; then
>>
>> You can do test -z "$(git rev-parse --show-cdup 2>/dev/null)" without
>> the $topdir variable.
> 
> No, "$(git rev-parse --show-cdup 2>/dev/null)" would also give the empty
> string if the git command fails (ie not inside a git repository at all).

Then git rev-parse will also fail.

Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ