components/golang/patches/0004-release-branch.go1.5-build-Fix-bootstrap.bash-for-of.patch
changeset 5331 9c955076ffe3
equal deleted inserted replaced
5330:c36e3195e3e9 5331:9c955076ffe3
       
     1 From c20b8e145a471f242fba18f30dc830dac71ce50e Mon Sep 17 00:00:00 2001
       
     2 From: Dave Cheney <[email protected]>
       
     3 Date: Fri, 4 Sep 2015 08:47:40 +1000
       
     4 Subject: [PATCH 04/63] [release-branch.go1.5] build: Fix bootstrap.bash for
       
     5  official source tarballs
       
     6 
       
     7 At the moment, bootstrap.bash assumes it is called from a git working
       
     8 copy. Hence, it fails to complete when running in an unpacked official
       
     9 source tarball where .git and .gitignore do not exist. This fix adds a
       
    10 test for existence for .git and a -f switch for the removal of
       
    11 .gitignore.
       
    12 
       
    13 Fixes #12223
       
    14 
       
    15 Change-Id: I7f305b83b38d5115504932bd38dadb7bdeb5d487
       
    16 Reviewed-on: https://go-review.googlesource.com/13770
       
    17 Reviewed-by: Dave Cheney <[email protected]>
       
    18 Reviewed-by: Andrew Gerrand <[email protected]>
       
    19 Reviewed-on: https://go-review.googlesource.com/14281
       
    20 ---
       
    21  src/bootstrap.bash | 6 ++++--
       
    22  1 file changed, 4 insertions(+), 2 deletions(-)
       
    23 
       
    24 diff --git a/src/bootstrap.bash b/src/bootstrap.bash
       
    25 index 60d6151..1b5ba7c 100755
       
    26 --- a/src/bootstrap.bash
       
    27 +++ b/src/bootstrap.bash
       
    28 @@ -35,8 +35,10 @@ cp -R "$src" "$targ"
       
    29  cd "$targ"
       
    30  echo
       
    31  echo "#### Cleaning $targ"
       
    32 -rm .gitignore
       
    33 -git clean -f -d
       
    34 +rm -f .gitignore
       
    35 +if [ -e .git ]; then
       
    36 +	git clean -f -d
       
    37 +fi
       
    38  echo
       
    39  echo "#### Building $targ"
       
    40  echo
       
    41 -- 
       
    42 2.6.1
       
    43