1 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2 // Copyright (C) 2009 - DIGITEO - Pierre MARECHAL <pierre.marechal@scilab.org>
4 // This file must be used under the terms of the CeCILL.
5 // This source file is licensed as described in the file COPYING, which
6 // you should have received as part of this distribution. The terms
7 // are also available at
8 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
12 // Return the sorted list of the versions compatible with this version of Scilab
14 function versions = atomsCompatibleVersions(name)
19 // Check input parameters
20 // =========================================================================
25 error(msprintf(gettext("%s: Wrong number of input argument: %d to %d expected.\n"),"atomsCompatibleVersions",1));
28 if type(name) <> 10 then
29 error(msprintf(gettext("%s: Wrong type for input argument #%d: String expected.\n"),"atomsCompatibleVersions",1));
32 // Get all package description
33 // =========================================================================
34 allpackages = atomsGetTOOLBOXES();
36 // Check if it's a Atoms package
37 // =========================================================================
38 if ~ isfield(allpackages,name) then
39 error(msprintf(gettext("%s: Wrong value for input argument #%d: Must be a atoms package name.\n"),"atomsCompatibleVersions",1));
43 // =========================================================================
44 package_versions = allpackages(name);
45 package_versions_tab = getfield(1,package_versions);
46 package_versions_tab(1:2) = [];
48 // Loop on package_versions_tab
49 // =========================================================================
51 for i=1:size(package_versions_tab,"*")
52 this_version = package_versions(package_versions_tab(i));
53 if atomsIsCompatible(this_version("ScilabVersion")) then
54 versions = [ versions ; package_versions_tab(i) ];
58 // Sort the version matrix
59 // =========================================================================
60 versions = atomsVersionSort(versions,"DESC");