我在 metadata.json 中看到了几种方法,有些只指定整个版本,例如“3.22”,而有些则更具体,例如“3.22.1”。我遇到了一个问题,其中我有“3.24”、“3.24.1”和“3.24.2”,但在我指定之前,扩展无法在“3.24.3”中工作。
是否有必要列出支持的 gnome-shell 的所有特定“点”版本,或者仅当指定了至少一个“点”版本时 gnome-shell 才关心?
我在 metadata.json 中看到了几种方法,有些只指定整个版本,例如“3.22”,而有些则更具体,例如“3.22.1”。我遇到了一个问题,其中我有“3.24”、“3.24.1”和“3.24.2”,但在我指定之前,扩展无法在“3.24.3”中工作。
是否有必要列出支持的 gnome-shell 的所有特定“点”版本,或者仅当指定了至少一个“点”版本时 gnome-shell 才关心?
从 GNOME 40 开始,每个稳定版本都是简单的增量,1
奇数不再不稳定(例如40
, 41
, 42
)并且次要版本被忽略。
直到 version 3.38
,版本检查有点复杂:
/**
* versionCheck:
* @required: an array of versions we're compatible with
* @current: the version we have
*
* Check if a component is compatible for an extension.
* @required is an array, and at least one version must match.
* @current must be in the format <major>.<minor>.<point>.<micro>
* <micro> is always ignored
* <point> is ignored if <minor> is even (so you can target the
* whole stable release)
* <minor> and <major> must match
* Each target version must be at least <major> and <minor>
*/