Browse code

Workaround openrc failure on zsh

The recent GIT_DEPTH change introduced a [[ ]] construct
which doesn't work for zsh 5.0.2. Workaround it by tweaking the test.

The following is a demonstration to show how zsh behaves:

% if [[ "" ]];then echo hoge;fi
zsh: parse error near `]]'
% if [[ "x" ]];then echo hoge;fi
zsh: parse error near `]]'
% if [[ -n "" ]];then echo hoge;fi
% if [[ -n "x" ]];then echo hoge;fi
hoge
%

Closes-Bug: #1387943
Change-Id: Ia88de876dacb3664a7c3d8f5a035e8e50fddb678

YAMAMOTO Takashi authored on 2014/10/31 13:48:58
Showing 1 changed files
... ...
@@ -575,7 +575,7 @@ function git_clone {
575 575
 
576 576
     RECLONE=$(trueorfalse False $RECLONE)
577 577
 
578
-    if [[ "$GIT_DEPTH" ]]; then
578
+    if [[ -n "${GIT_DEPTH}" ]]; then
579 579
         git_clone_flags="$git_clone_flags --depth $GIT_DEPTH"
580 580
     fi
581 581