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
This commit is contained in:
YAMAMOTO Takashi 2014-10-31 13:48:58 +09:00
parent bd5263cd37
commit 292b2a7ee6

View File

@ -575,7 +575,7 @@ function git_clone {
RECLONE=$(trueorfalse False $RECLONE)
if [[ "$GIT_DEPTH" ]]; then
if [[ -n "${GIT_DEPTH}" ]]; then
git_clone_flags="$git_clone_flags --depth $GIT_DEPTH"
fi