Repository: incubator-impala Updated Branches: refs/heads/branch-2.7.0 fcb5c6821 -> 586ae2d7f
IMPALA-4096: Allow clean.sh to work from snapshots buildall.sh calls bin/clean.sh, which fails when not in a git directory. This skips the "git clean" steps when not in a git checkout. Todd Lipcon found this when testing a snapshot created using git archive. Change-Id: I12dd9035298151557491009680d66d25c8f58c1d Reviewed-on: http://gerrit.cloudera.org:8080/4336 Tested-by: Internal Jenkins Reviewed-by: Jim Apple <[email protected]> Conflicts: bin/clean.sh Project: http://git-wip-us.apache.org/repos/asf/incubator-impala/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-impala/commit/9f08d1ab Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/9f08d1ab Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/9f08d1ab Branch: refs/heads/branch-2.7.0 Commit: 9f08d1ab3c876dc1fc92c9decb8104400eaeec7c Parents: fcb5c68 Author: Jim Apple <[email protected]> Authored: Thu Sep 8 08:59:59 2016 -0700 Committer: Jim Apple <[email protected]> Committed: Tue Sep 13 08:13:12 2016 -0700 ---------------------------------------------------------------------- bin/clean.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/9f08d1ab/bin/clean.sh ---------------------------------------------------------------------- diff --git a/bin/clean.sh b/bin/clean.sh index 00d02b3..610bb1e 100755 --- a/bin/clean.sh +++ b/bin/clean.sh @@ -52,13 +52,13 @@ popd # clean be pushd $IMPALA_HOME/be # remove everything listed in .gitignore -git clean -Xdfq +git rev-parse 2>/dev/null && git clean -Xdfq popd # clean shell build artifacts pushd $IMPALA_HOME/shell # remove everything listed in .gitignore -git clean -Xdfq +git rev-parse 2>/dev/null && git clean -Xdfq popd # Clean stale .pyc, .pyo files and __pycache__ directories. @@ -72,8 +72,10 @@ rm -f $IMPALA_HOME/llvm-ir/impala*.ll rm -f $IMPALA_HOME/be/generated-sources/impala-ir/* # Cleanup Impala-lzo -if [ -e $IMPALA_LZO ]; then - pushd $IMPALA_LZO; git clean -fdx .; popd +if [ -e "$IMPALA_LZO" ]; then + pushd "$IMPALA_LZO" + git rev-parse 2>/dev/null && git clean -fdx + popd fi # When switching to and from toolchain, make sure to remove all CMake generated files
