4

我需要自动检查我的系统是否运行最新发布的 Qt 版本。在我的软件中,我QT_VERSION_STR用来获取 Qt 的编译版本。

但是如何确定 python 脚本中的最新发布版本?对于 Wordpress,有一个花哨的API 调用。有人知道Qt的等价物吗?

4

1 回答 1

3

Query the latest tag from git repository:

$ git ls-remote --tags https://gitorious.org/qt/qt5.git \
| awk '{print $2}' \
| grep -v '\^{}$' \
| grep -v '-' \
| sort | tail -1 \
| awk '{split($0,a,"/"); print a[3]}'   
于 2015-02-26T09:35:29.967 回答