diff options
author | Zeno Albisser <zeno.albisser@digia.com> | 2013-08-17 20:31:40 +0200 |
---|---|---|
committer | Zeno Albisser <zeno.albisser@digia.com> | 2013-08-19 20:27:13 +0200 |
commit | fada4c705acff45be8418f20d28f1a091e6afe47 (patch) | |
tree | 1a724178b9f6b38026f15182a5c46cbfa82ca6bc /tools | |
parent | b9a97b2c4dca50f0c13a1006130e095e85936a2a (diff) |
Update init-repository.py to allow using upstream chromium repository.
The regular workflow now is just to clone the qtwebengine repository
and then execute the following commands.
git submodule init && git submodule update --recursive && qmake && make
This will also clone a submodule called 3rdparty which contains the
chromium and ninja sources without pulling in further submodules
and without a complete history.
Developers that do want to have a complete chromium checkout instead
should not use the above command sequence.
Instead they should just clone qtwebengine, execute the
init-repository.py script, run qmake and make.
The init-repository.py script will then checkout the complete
chromium sources into a subdirectory called 3rdparty_upstream.
The location of these sources will be picked up by qmake automatically.
Change-Id: I0fa4f1d554bdca2e852b6a97aa2e5462d90d8664
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/git_submodule.py | 66 |
1 files changed, 34 insertions, 32 deletions
diff --git a/tools/git_submodule.py b/tools/git_submodule.py index d158af635..5188ef390 100644 --- a/tools/git_submodule.py +++ b/tools/git_submodule.py @@ -65,6 +65,8 @@ class Submodule: return False def findSha(self): + if self.shasum != '': + return line = subprocess.check_output(['git', 'submodule', 'status', self.path]) line = line.lstrip(' -') self.shasum = line.split(' ')[0] @@ -106,7 +108,7 @@ class Submodule: val = subprocess.call(['git', 'checkout', self.shasum]) if val != 0: sys.exit("!!! initialization failed !!!") - initSubmodules() + self.initSubmodules() os.chdir(currentDir) else: print '-- skipping ' + self.path + ' for this operating system. --' @@ -123,36 +125,36 @@ class Submodule: return [] -def readSubmodules(): - currentDir = os.getcwd() - if not os.path.isfile('.gitmodules'): - return [] - gitmodules_file = open('.gitmodules') - gitmodules_lines = gitmodules_file.readlines() - gitmodules_file.close() + def readSubmodules(self): + currentDir = os.getcwd() + if not os.path.isfile('.gitmodules'): + return [] + gitmodules_file = open('.gitmodules') + gitmodules_lines = gitmodules_file.readlines() + gitmodules_file.close() - submodules = [] - currentSubmodule = None - for line in gitmodules_lines: - if line.find('[submodule') == 0: - if currentSubmodule: - submodules.append(currentSubmodule) - currentSubmodule = Submodule() - tokens = line.split('=') - if len(tokens) >= 2: - key = tokens[0].strip() - value = tokens[1].strip() - if key == 'path': - currentSubmodule.path = value - elif key == 'url': - currentSubmodule.url = value - elif key == 'os': - currentSubmodule.os = value.split(',') - if currentSubmodule: - submodules.append(currentSubmodule) - return submodules + submodules = [] + currentSubmodule = None + for line in gitmodules_lines: + if line.find('[submodule') == 0: + if currentSubmodule: + submodules.append(currentSubmodule) + currentSubmodule = Submodule() + tokens = line.split('=') + if len(tokens) >= 2: + key = tokens[0].strip() + value = tokens[1].strip() + if key == 'path': + currentSubmodule.path = value + elif key == 'url': + currentSubmodule.url = value + elif key == 'os': + currentSubmodule.os = value.split(',') + if currentSubmodule: + submodules.append(currentSubmodule) + return submodules -def initSubmodules(): - submodules = readSubmodules() - for submodule in submodules: - submodule.initialize() + def initSubmodules(self): + submodules = self.readSubmodules() + for submodule in submodules: + submodule.initialize() |