我正在尝试从git源构建Qt5的修订版5.9但是更新子模块失败了:
git clone https://github.com/qt/qt5.git
cd qt5
git checkout 5.9
./init-repository
...
... lots of submodules being updated successfully
...
fatal: Needed a single revision
Unable to find current revision in submodule path 'qtnetworkauth'
git submodule update --force --no-fetch exited with status 256 at ./init-repository line 198.
Qt::InitRepository::exe(Qt::InitRepository=HASH(0x1fa94b0), "git", "submodule", "update", "--force", "--no-fetch") called at ./init-repository line 429
Qt::InitRepository::git_clone_all_submodules(Qt::InitRepository=HASH(0x1fa94b0), "qt/qt5", 0, "preview", "essential", "addon", "deprecated") called at ./init-repository line 644
Qt::InitRepository::run(Qt::InitRepository=HASH(0x1fa94b0)) called at ./init-repository line 655
所以看起来qtnetworkauth
在某种程度上错误配置但我不知道如何解决它。
我尝试通过删除qtnetworkauth
,.gitmodules
内的引用和文件夹本身删除qtdoc
模块,但其他模块失败。
奇怪 - 当我删除并添加对./init-repository -f
的引用后运行qtnetworkauth
时,我可以看到它被检出,但子模块文件夹仍为空:
...
+ git clone --no-checkout https://github.com/qt/qtnetworkauth qtnetworkauth
Cloning into 'qtnetworkauth'...
remote: Counting objects: 283, done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 283 (delta 3), reused 0 (delta 0), pack-reused 269
Receiving objects: 100% (283/283), 200.12 KiB | 0 bytes/s, done.
Resolving deltas: 100% (139/139), done.
Checking connectivity... done.
+ git config commit.template /home/frans/_HOME/0000_android_dev/qt5/.commit-template
+ git config remote.gerrit.url ssh://codereview.qt-project.org/qt/qtnetworkauth
...
我做错了什么?或者,如果这是一个Qt错误 - 我该如何解决它?
答案 0 :(得分:1)
在实际获取所有存储库之前,您正在更改分支。这可能会破坏./init-repository
脚本中的某些内容。
我检查过这个序列有效:
git clone git://code.qt.io/qt/qt5.git
cd qt5/
./init-repository
git checkout 5.9
git submodule update