From 684bc6b908330aa4b28c9b5fff749849382b0bdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciro=20Santilli=20=E5=85=AD=E5=9B=9B=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=E6=B3=95=E8=BD=AE=E5=8A=9F?= Date: Tue, 14 May 2019 00:00:07 +0000 Subject: [PATCH] build: log warning on git too old for --update --- build | 4 ++++ common.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/build b/build index 1d42d8c..9954590 100755 --- a/build +++ b/build @@ -556,6 +556,10 @@ Which components to build. Default: qemu-buildroot # * https://stackoverflow.com/questions/2155887/git-submodule-head-reference-is-not-a-tree-error/25875273#25875273 # * https://github.com/boostorg/boost/issues/245 cmd.extend(['--depth', '1', LF]) + else: + self.log_warn('your git is too old for git submodule update --depth 1') + self.log_warn('update to git 2.17 or newer and you will save clone time') + self.log_warn('see: https://github.com/cirosantilli/linux-kernel-module-cheat/issues/44') self.sh.run_cmd(cmd + ['--', LF] + submodule_ids_to_cmd(submodules_shallow)) # Do the build. diff --git a/common.py b/common.py index e260e85..de61efc 100644 --- a/common.py +++ b/common.py @@ -1117,6 +1117,10 @@ lunch aosp_{}-eng if flush: sys.stdout.flush() + def log_warn(self, msg): + with self.print_lock: + print('warning: {}'.format(msg), file=sys.stdout) + def is_subpath(self, subpath, parent): ''' https://stackoverflow.com/questions/3812849/how-to-check-whether-a-directory-is-a-sub-directory-of-another-directory