Changeset 78 for an2_check_updates.m


Ignore:
Timestamp:
Feb 17, 2009, 3:00:56 PM (10 years ago)
Author:
tjniskan
Message:
  • 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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • an2_check_updates.m

    r45 r78  
    1 function [isUpdateAvailable,HeadRev,WorkingCopyRev]=an2_check_updates()
     1function [isUpdateAvailable,HeadRev,WorkingCopyRev,error_msg]=an2_check_updates()
    22% AN2_CHECK_UPDATES - Check if Aedes updates are available
    33%
     
    3838isUpdateAvailable = false;
    3939HeadRev = [];
     40error_msg = '';
    4041
    4142% Get current revision and repository URL
     
    4849
    4950% Get head repository revision
    50 HeadRev=l_GetHeadRevision(repo);
     51[HeadRev,msg]=l_GetHeadRevision(repo);
    5152if isempty(HeadRev)
    5253  % Something wrong with running SVN commands. Perhaps SVN is not
    53   % installed?
    54 elseif HeadRev<0
    55   % Something wrong with detecting network. Perhaps not inside University
    56   % network or not connected to the network at all...
     54  % installed? Network problems?
     55  error_msg = msg;
    5756else
    5857  if rev<HeadRev
    59         isUpdateAvailable = true;
     58    isUpdateAvailable = true;
    6059  end
    6160end
     
    7069  msg = '';
    7170 
    72   % Try to determine if the computer is connected to the network and is
    73   % inside University network... If this checking fails and the user has no
    74   % network, the svn will wait for timeout...
    75   % Check if we are inside university firewalls
    76   if isunix
    77         % Unix/Linux
    78         [s,w]=unix('ifconfig');
    79         if ~isempty(w)
    80           ind = strfind(w,'inet addr:');
    81           if ~isempty(ind)
    82                 try
    83                   if ~strcmpi(w(ind(1)+10:ind(1)+16),'193.167')
    84                         HeadRev = -1;
    85                         return
    86                   end
    87                 catch
    88                   HeadRev = -1;
    89                   return
    90                 end
    91           else
    92                 HeadRev = -1;
    93                 return
    94           end
    95         else
    96           HeadRev = -1;
    97           return
    98         end
    99   elseif ispc
    100         % Windows
    101         [s,w]=dos('ipconfig');
    102         if isempty(findstr(w,'uku.fi'))
    103           HeadRev = -1;
    104           return
    105         end
    106   else
    107         % Mac OS X
    108   end
    109  
    110  
    11171  % Try to determine the head revision in svn
    11272  if isunix
    113         % Unix/Linux
    114         [s,w] = unix(['svn info ',repo_url]);
    115         if s~=0
    116           return
    117         end
     73    % Unix/Linux
     74    [s,w] = unix(['svn info ',repo_url]);
     75    if s~=0
     76      msg=w;
     77      return
     78    end
    11879  elseif ispc
    119         % Windows
    120         [s,w] = dos(['svn info ',repo_url]);
    121         if s~=0
    122           return
    123         end
     80    % Windows
     81    [s,w] = dos(['svn info ',repo_url]);
     82    if s~=0
     83      msg=w;
     84      return
     85    end
    12486  else
    125         % Mac OS X
     87    % Mac OS X
     88    [s,w] = unix(['svn info ',repo_url]);
     89    if s~=0
     90      msg=w;
     91      return
     92    end
    12693  end
    12794 
     
    12996  C=textscan(w,'%s','delimiter','\n');
    13097  if ~isempty(C)
    131         C=C{:};
     98    C=C{:};
    13299  else
    133         return
     100    return
    134101  end
    135102 
     
    137104  rev_ind = find(strncmpi(C,'Revision:',4));
    138105  if ~isempty(rev_ind)
    139         rev_str = C{rev_ind};
     106    rev_str = C{rev_ind};
    140107  else
    141         return
     108    return
    142109  end
    143110  HeadRev=str2num(rev_str(11:end));
Note: See TracChangeset for help on using the changeset viewer.

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