简体   繁体   English

检查倍频 package 版本

[英]Checking octave package version

I installed the dataframe package in Octave and would like to programmatically assert that the package version is at least 1.2.0.我在 Octave 中安装了 dataframe package 并希望以编程方式断言 package 版本至少为 1.2.0。 Does octave provide a way to check a package version programmatically?八度是否提供了一种以编程方式检查 package 版本的方法?

Version = ver('dataframe')
% Version =
%   scalar structure containing the fields:
%     Name = dataframe
%     Version = 1.2.0
%     Release = [](0x0)
%     Date = 2017-08-14

Obviously Version.Version is still a string, but you can process that further, eg with strsplit , to obtain the major-minor-patch numbers.显然Version.Version仍然是一个字符串,但您可以进一步处理它,例如使用strsplit ,以获得主要-次要补丁编号。

strsplit( Version.Version, '.' )
% ans =
% {
%   [1,1] = 1
%   [1,2] = 2
%   [1,3] = 0
% }

Alternatively you can also use或者,您也可以使用

Out = pkg('list', 'dataframe')

which also contains a 'version' field, as well as some extra information.其中还包含一个“版本”字段,以及一些额外的信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM