By: fu linux
E-mail: fulinux@sina.com
Blog: https://blog.csdn.net/fulinus
喜欢的盆友欢迎点赞和订阅!
你的喜欢就是我写作的动力!
问题导向
我们通常不清楚recipe(或者说软件工程)有没有最新的版本,然后我也不知道去哪里查看,此时有相应的命令可以查看某个软件工程有哪些版本,以及当前在哪个版本上面
devtool latest-version命令
帮助信息
[build]$ devtool latest-version --help
NOTE: Starting bitbake server...
usage: devtool latest-version [-h] recipename
Queries the upstream server for what the latest upstream release is (for git,
tags are checked, for tarballs, a list of them is obtained, and one with the
highest version number is reported)
arguments:
recipename Name of recipe to query (just name - no version, path or
extension)
options:
-h, --help show this help message and exit
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
看帮助信息知,改名了参数带上recipe的名字就可以。
使用实例
我查看当前learnyocto项目是在哪个版本,以及有哪些版本,使用参考如下:
[build]$ devtool latest-version learnyocto
NOTE: Starting bitbake server...
NOTE: Reconnecting to bitbake server...
NOTE: Retrying server connection (#1)...
Loading cache: 100% |################################################################################| Time: 0:00:00
Loaded 1322 entries from dependency cache.
Parsing recipes: 100% |##############################################################################| Time: 0:00:00
Parsing of 783 .bb files complete (780 cached, 3 parsed). 1324 targets, 46 skipped, 0 masked, 0 errors.
INFO: Current version: 1.0
INFO: Latest version: 1.1
INFO: Latest version's commit: cac0e57e2f8d79daf03dbe2a1dd477a93298d363
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
由此快捷键当前learnyocto项目处于1.0版本,有个新的版本是1.1。学习了上一篇的朋友会发现,我们不是升级到v1.1版本了吗?怎么当前版本还是1.0呢?
当时我们看最后一行commit id确实最新的。说明我们前面使用:
devtool upgrade -S 1.1 learnyocto
- 1
我看该命令的帮助信息和官方的一些举例内容,推断当recipe为git项目时使用的是"-S",如果是软件包形式后面带版本的话那么就用"-V"指定版本。
devtool upgrade -V命令
例如dbus项目:
[build]$ devtool latest-version dbus
NOTE: Starting bitbake server...
NOTE: Reconnecting to bitbake server...
NOTE: Retrying server connection (#1)...
Loading cache: 100% |################################################################################| Time: 0:00:00
Loaded 1322 entries from dependency cache.
Parsing recipes: 100% |##############################################################################| Time: 0:00:00
Parsing of 782 .bb files complete (780 cached, 2 parsed). 1323 targets, 46 skipped, 0 masked, 0 errors.
--2020-11-10 20:01:57-- https://dbus.freedesktop.org/releases/dbus/
正在解析主机 dbus.freedesktop.org (dbus.freedesktop.org)... 131.252.210.176, 2610:10:20:722:a800:ff:feda:470f
正在连接 dbus.freedesktop.org (dbus.freedesktop.org)|131.252.210.176|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度: 未指定 [text/html]
正在保存至: “/tmp/wget-index-ky1n3hff/wget-listing-2lclb7km”
0K .......... .......... .......... .......... .......... 94.0K
50K .......... ..... 86.4K=0.7s
2020-11-10 20:01:59 (92.1 KB/s) - “/tmp/wget-index-ky1n3hff/wget-listing-2lclb7km” 已保存 [66651]
INFO: Current version: 1.12.16
INFO: Latest version: 1.12.20
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
通过https://dbus.freedesktop.org/releases/dbus/连接得知如下:
从图片上看有比1.12.20还要新的版本,为啥说最新的版本是1.12.20呢?注意看时间,我们发现当前1.12.20更新的时间最新,所以就显示当前最新的版本是1.12.20。由此并不是单纯的看版本,也要看下更新时间。
因此如果需要更新软包版本的话可以使用devtool upgrade -V命令来指定版本。
通过项目的命令,也可以看到对应的版本文件名会带有版本信息:
[build]$ devtool edit-recipe dbus
~/poky/meta/recipes-core/dbus/dbus_1.12.16.bb #会打开该文件
- 1
- 2