source: an2_check_updates.m @ 78

Last change on this file since 78 was 78, checked in by tjniskan, 10 years ago
  • Moved fMRI related plugins to their own subdirectories
  • Created a subdirectory for map calculation plugins and added a few

basic plugins for those. At the moment these plugins do not support
masking etc. and I didn't test them at all so be cautious...

  • Made a minor memory optimation to an2_readfid.m
  • Fixed a few issues in files related updating via SVN
  • Disabled some annoying warnings that Matlab R2008a and higher

generate from uitree and uitreenode functions inan2_juigetfiles.m

  • Coded something minor to an2_maptool.m. This is still stub and does

not work at all. Please don't try to use it.

  • Fixed a bug that caused Aedes to fail without generating an error

when reading VNMR FID-files that don't have PROCPAR in the same folder.

  • Fixed a javaFrame -warning (with R2008a and higher) in aedes.m

M an2_revision.m
M an2_data_read.m
M an2_maptool.m
M aedes.m
D plugins/calculate_t2_map.m
D plugins/calculate_t1r_map.m
D plugins/basic_fmri_analysis.m
D plugins/resting_state_fc.m
A plugins/fmri_plugins
A plugins/fmri_plugins/basic_fmri_analysis.m
A plugins/fmri_plugins/resting_state_fc.m
A plugins/map_plugins
A plugins/map_plugins/t2.m
A plugins/map_plugins/t1_3_parameter_fit.m
A plugins/map_plugins/t1_saturation_recovery.m
A plugins/map_plugins/t1_rho.m
A plugins/map_plugins/t2_rho.m
A plugins/map_plugins/t1_inversion_recovery.m
M an2_readfid.m
M an2_check_updates.m
M an2_juigetfiles.m
M an2_update.m

  • Property svn:executable set to *
File size: 2.6 KB
RevLine 
[78]1function [isUpdateAvailable,HeadRev,WorkingCopyRev,error_msg]=an2_check_updates()
[37]2% AN2_CHECK_UPDATES - Check if Aedes updates are available
[25]3%
4% Synopsis:
5%       [isUpdateAvailable,HeadRev,WorkingCopyRev] = an2_check_updates()
6%
7% Description:
[37]8%       Checks if there are updates available for Aedes. The
[25]9%       "isUpdateAvailable" output argument is true if the head revision number
10%   in SVN repository is larger than working copy revision. If the
11%   "HeadRev" output argument is -1, there is a problem with the network.
12%   If "HeadRev" is empty, there is a problem running SVN commands.
13%
14% Examples:
15%       
16%
17% See also:
[37]18%       AEDES, AN2_UPDATE
[25]19
[37]20% This function is a part of Aedes - A graphical tool for analyzing
[36]21% medical images
[25]22%
[36]23% Copyright (C) 2006 Juha-Pekka Niskanen <Juha-Pekka.Niskanen@uku.fi>
24%
[45]25% Department of Physics, Department of Neurobiology
[39]26% University of Kuopio, FINLAND
[36]27%
28% This program may be used under the terms of the GNU General Public
29% License version 2.0 as published by the Free Software Foundation
30% and appearing in the file LICENSE.TXT included in the packaging of
31% this program.
32%
33% This program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
34% WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
[25]35
[36]36
37
[25]38isUpdateAvailable = false;
39HeadRev = [];
[78]40error_msg = '';
[25]41
42% Get current revision and repository URL
43[rev,repo,workingcopy] = an2_revision;
44if isempty(repo)
45  WorkingCopyRev = rev;
46  return
47end
48WorkingCopyRev = rev;
49
50% Get head repository revision
[78]51[HeadRev,msg]=l_GetHeadRevision(repo);
[25]52if isempty(HeadRev)
53  % Something wrong with running SVN commands. Perhaps SVN is not
[78]54  % installed? Network problems?
55  error_msg = msg;
[25]56else
57  if rev<HeadRev
[78]58    isUpdateAvailable = true;
[25]59  end
60end
61 
62 
63  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
64  % Get Head Repository Revision
65  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
66  function [HeadRev,msg]=l_GetHeadRevision(repo_url)
67 
68  HeadRev = [];
69  msg = '';
70 
71  % Try to determine the head revision in svn
72  if isunix
[78]73    % Unix/Linux
74    [s,w] = unix(['svn info ',repo_url]);
75    if s~=0
76      msg=w;
77      return
78    end
[25]79  elseif ispc
[78]80    % Windows
81    [s,w] = dos(['svn info ',repo_url]);
82    if s~=0
83      msg=w;
84      return
85    end
[25]86  else
[78]87    % Mac OS X
88    [s,w] = unix(['svn info ',repo_url]);
89    if s~=0
90      msg=w;
91      return
92    end
[25]93  end
94 
95  % Scan the lines from the output
96  C=textscan(w,'%s','delimiter','\n');
97  if ~isempty(C)
[78]98    C=C{:};
[25]99  else
[78]100    return
[25]101  end
102 
103  % Get revision line
104  rev_ind = find(strncmpi(C,'Revision:',4));
105  if ~isempty(rev_ind)
[78]106    rev_str = C{rev_ind};
[25]107  else
[78]108    return
[25]109  end
110  HeadRev=str2num(rev_str(11:end));
111 
112 
Note: See TracBrowser for help on using the repository browser.

Powered by Trac 1.0.9.Copyright © Juha-Pekka Niskanen 2008