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
10 // Liste des versions installée de la toolbox "name"
12 function res = atomsGetInstalledStatus(name,version,section)
16 // Check number of input arguments
17 // =========================================================================
19 if rhs < 2 | rhs > 3 then
20 error(msprintf(gettext("%s: Wrong number of input argument: %d to %d expected.\n"),"atomsGetInstalledStatus",2,3));
23 // Check input parameters type
24 // =========================================================================
26 if type(name) <> 10 then
27 error(msprintf(gettext("%s: Wrong type for input argument #%d: A single string expected.\n"),"atomsGetInstalledStatus",1));
30 if type(version)<>10 then
31 error(msprintf(gettext("%s: Wrong type for input argument #%d: A single string expected.\n"),"atomsGetInstalledStatus",2));
34 // Check input parameters dimensions
35 // =========================================================================
37 if or( size(name,"*") <> size(version,"*")) then
38 error(msprintf(gettext("%s: Incompatible input arguments #%d and #%d: Same sizes expected.\n"),"atomsGetInstalledStatus",1,2));
41 // Allusers/user management
42 // =========================================================================
49 // Process the 2nd input argument : section
50 // Allusers can be a boolean or equal to "user" or "allusers"
52 if type(section) <> 10 then
53 error(msprintf(gettext("%s: Wrong type for input argument #%d: A boolean or a single string expected.\n"),"atomsGetInstalledDetails",3));
56 if and(section<>["user","allusers","all"]) then
57 error(msprintf(gettext("%s: Wrong value for input argument #%d: ''user'' or ''allusers'' or ''all'' expected.\n"),"atomsGetInstalledDetails",3));
62 // Get the list of installed packages
63 // =========================================================================
64 packages = atomsGetInstalled(section);
67 // =========================================================================
69 for i=1:size(name,"*")
72 packages_filtered = packages( find(packages(:,1) == name(i)) , : );
75 packages_filtered = packages_filtered( find(packages_filtered(:,2) == version(i)) , : );
77 if ~ isempty(packages_filtered) then
78 res(i) = packages_filtered(1,5);