lukegitupdate

PURPOSE ^

SYNOPSIS ^

function lukegitupdate(dkepath,debugmode,link_mode)

DESCRIPTION ^

 This function updates LUKE and associated toolboxes remotely for the profiles stored
 in dkepath. LUKE and related toolboxes must be under Git file system
 control.

    Input:

       - dkepath: path structure with remote profiles
           (default: if no input structure or empty, dkepath is automatically loaded from LUKE_PATH.mat
       - debugmode
       - link_mode : connection mode prescription
           o -2  : disable remote profiles
           o -1  : local profiles only
           o NaN : (default) use value from remote.link_mode
           o []  : give priority to (0) ssh key pair, (1) ssh bridge, (2) url/ftp bridge
           o 0   : ssh key pair enforced
           o 1   : ssh bridge enforced
           o 2   : url/ftp bridge enforced

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function lukegitupdate(dkepath,debugmode,link_mode)
0002 %
0003 % This function updates LUKE and associated toolboxes remotely for the profiles stored
0004 % in dkepath. LUKE and related toolboxes must be under Git file system
0005 % control.
0006 %
0007 %    Input:
0008 %
0009 %       - dkepath: path structure with remote profiles
0010 %           (default: if no input structure or empty, dkepath is automatically loaded from LUKE_PATH.mat
0011 %       - debugmode
0012 %       - link_mode : connection mode prescription
0013 %           o -2  : disable remote profiles
0014 %           o -1  : local profiles only
0015 %           o NaN : (default) use value from remote.link_mode
0016 %           o []  : give priority to (0) ssh key pair, (1) ssh bridge, (2) url/ftp bridge
0017 %           o 0   : ssh key pair enforced
0018 %           o 1   : ssh bridge enforced
0019 %           o 2   : url/ftp bridge enforced
0020 %
0021 if nargin < 3,
0022     link_mode = NaN;
0023 end
0024 if nargin < 2,
0025     debugmode = 0;  
0026 end
0027 if nargin < 1,
0028     dkepath = '';
0029 end
0030 %
0031 [dkepath] = load_structures_yp('dkepath','','');
0032 %
0033 if ~exist('dkepath','var'),
0034     dkepath = setpath_luke_jd('',link_mode,0,0,0);
0035 else
0036     dkepath = setpath_luke_jd(dkepath,link_mode,0,0,0);                         
0037 end
0038 %
0039 nrem = length(dkepath.remote);
0040 %
0041 disp (' ')
0042 info_dke_yp(2,'List of remote profiles tagged for git update :')
0043 disp(' ')
0044 %
0045 flag_gitupdate = false(1,nrem);
0046 %
0047 for irem = 1:nrem,
0048     if isfield(dkepath.remote(irem),'gitupdate') && ~isempty(dkepath.remote(irem).gitupdate) && dkepath.remote(irem).gitupdate,
0049         flag_gitupdate(irem) = true;
0050     end
0051 end
0052 remote_index = find(flag_gitupdate);
0053 nrem = length(remote_index);
0054 %
0055 for irem = 1:nrem,
0056     info_dke_yp(4,['#',num2str(irem),' : ',dkepath.profilestr{remote_index(irem)},' for LUKE root : ',dkepath.remote(remote_index(irem)).env.luke_root]);
0057 end
0058 disp(' ')
0059 %
0060 remlist = input_dke_yp('Please identify profiles to be updated',1:nrem,[1;nrem]);
0061 disp(' ')
0062 %
0063 remote = dkepath.remote(remote_index(remlist));
0064 nrem = length(remote);
0065 %
0066 for irem = 1:nrem,
0067     remote(irem).debugmode = debugmode;
0068 end
0069 %
0070 % ----------------------------
0071 %
0072 remotefunctions = {'select_LUKE.m','load_remoteprofiles_jd.m','make_help.m','lukegitupdate.m'};% update MatTools, MatRemote, MatHelp and LUKE
0073 %
0074 display_mode = 3;% show detailed results
0075 %
0076 exclude = {'.git','.mat','~','.mexa64','.mexglx','.mexmaci64','.o','.DS_Store'};
0077 %
0078 [profilestr,flag] = remotegitupdate(remote,remotefunctions,display_mode,exclude,debugmode);
0079 %
0080 disp('--------------------------------------')
0081 disp('           GLOBAL RESULTS             ')
0082 disp('--------------------------------------')
0083 disp(' ')
0084 disp('  -2 : the remote process failed')
0085 disp('  -1 : the git update process failed')
0086 disp('   0 : the git update succeeded')
0087 disp(' ')
0088 disp(' Results for : MatTools / MatRemote / MatHelp / LUKE ')
0089 disp(' ')
0090 disp('--------------------------------------')
0091 disp(' ')
0092 disp(' ')
0093 disp(' ')
0094 %
0095 if length(remotefunctions) >= 1,
0096     flag1 = num2str(flag(:,1));
0097 else
0098     flag1 = 'NaN';
0099 end
0100 if length(remotefunctions) >= 2,
0101     flag2 = num2str(flag(:,2));
0102 else
0103     flag2 = 'NaN';
0104 end
0105 if length(remotefunctions) >= 3,
0106     flag3 = num2str(flag(:,3));
0107 else
0108     flag3 = 'NaN';
0109 end
0110 if length(remotefunctions) >= 4,
0111     flag4 = num2str(flag(:,4));
0112 else
0113     flag4 = 'NaN';
0114 end
0115 %
0116 for irem = 1:size(flag1,1),
0117     disp([flag1(irem,:),' / ',flag2(irem,:),' / ',flag3(irem,:),' / ',flag4(irem,:),' : ',dkepath.profilestr{remote_index(remlist(irem))}])
0118 end
0119 %
0120 disp(' ');disp('----------------------------');disp(' ')
0121 %
0122 if size(flag1,1) < nrem,
0123     for ii = 1:nrem-size(flag1,1)
0124         disp(['WARNING: Git update missing for ',dkepath.profilestr{remote_index(remlist(size(flag1,1)+ii))}])
0125     end
0126 end
0127 %

Community support and wiki are available on Redmine. Last update: 18-Apr-2019.