WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 1/2] Make xencommons a bit more idiomatic

To: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 1/2] Make xencommons a bit more idiomatic
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Tue, 30 Aug 2011 10:47:26 -0700
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Tue, 30 Aug 2011 15:12:45 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20061.4783.289388.358884@xxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <4E4F0480.6030404@xxxxxxxx> <20061.4783.289388.358884@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20110816 Thunderbird/6.0
On 08/30/2011 09:41 AM, Ian Jackson wrote:
> Jeremy Fitzhardinge writes ("[Xen-devel] [PATCH 1/2] Make xencommons a bit 
> more idiomatic"):
>> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>
> ...
>> -if test "x$1" = xstart && \
>> -     test -d /proc/xen && \
>> -   ! test -f /proc/xen/capabilities && \
>> -   ! grep '^xenfs ' /proc/mounts >/dev/null;
>> -then
>> +if [ "x$1" = xstart -a -d /proc/xen -a \
>> +    ! -f /proc/xen/capabilities ] && \
>> +    ! grep -qw '^xenfs' /proc/mounts; then
>>      mount -t xenfs xenfs /proc/xen
> I'm afraid I'm reluctant to accept this purely stylistic change.  I
> might if it seemed to me to be a clear improvement, but I don't think
> that's the case.
>
> If anything we should be moving towards the use of && rather than -a,
> as that is harmless and will make the script depend less on /bin/bash.

No, you've misread it.  I'm changing it to use test for all the
file-existence checks in it's idiomatic form of '[', which implements
-a.  It is not at all bash-specific.

    J

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>