lukecvsupdate

PURPOSE ^

SYNOPSIS ^

function lukecvsupdate(dkepath,debugmode,link_mode)

DESCRIPTION ^

 This function updates LUKE and associated toolboxes remotely for the profiles stored
 in dkepath

    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 lukecvsupdate(dkepath,debugmode,link_mode)
0002 %
0003 % This function updates LUKE and associated toolboxes remotely for the profiles stored
0004 % in dkepath
0005 %
0006 %    Input:
0007 %
0008 %       - dkepath: path structure with remote profiles
0009 %           (default: if no input structure or empty, dkepath is automatically loaded from LUKE_PATH.mat
0010 %       - debugmode
0011 %       - link_mode : connection mode prescription
0012 %           o -2  : disable remote profiles
0013 %           o -1  : local profiles only
0014 %           o NaN : (default) use value from remote.link_mode
0015 %           o []  : give priority to (0) ssh key pair, (1) ssh bridge, (2) url/ftp bridge
0016 %           o 0   : ssh key pair enforced
0017 %           o 1   : ssh bridge enforced
0018 %           o 2   : url/ftp bridge enforced
0019 %
0020 if nargin < 3,
0021     link_mode = NaN;
0022 end
0023 if nargin < 2,
0024     debugmode = 0;  
0025 end
0026 if nargin < 1,
0027     dkepath = '';
0028 end
0029 %
0030 if isempty(dkepath)
0031     dkepath = setpath_luke_jd(dkepath,link_mode);
0032 end
0033 %
0034 nrem = length(dkepath.remote);
0035 %
0036 disp (' ')
0037 info_dke_yp(2,'List of remote profiles tagged for cvs update :')
0038 disp(' ')
0039 %
0040 flag_cvsupdate = false(1,nrem);
0041 %
0042 for irem = 1:nrem,
0043     if isfield(dkepath.remote(irem),'cvsupdate') && ~isempty(dkepath.remote(irem).cvsupdate) && dkepath.remote(irem).cvsupdate,
0044         flag_cvsupdate(irem) = true;
0045     end
0046 end
0047 remote_index = find(flag_cvsupdate);
0048 nrem = length(remote_index);
0049 %
0050 for irem = 1:nrem,
0051     info_dke_yp(4,['#',num2str(irem),' : ',dkepath.profilestr{remote_index(irem)},' for LUKE root : ',dkepath.remote(remote_index(irem)).env.luke_root]);
0052 end
0053 disp(' ')
0054 %
0055 remlist = input_dke_yp('Please identify profiles to be updated',1:nrem,[1;nrem]);
0056 disp(' ')
0057 %
0058 remote = dkepath.remote(remote_index(remlist));
0059 nrem = length(remote);
0060 %
0061 for irem = 1:nrem,
0062     remote(irem).debugmode = debugmode;
0063 end
0064 %
0065 % ----------------------------
0066 %
0067 remotefunctions = {'select_LUKE.m','load_remoteprofiles_jd.m','make_help.m','luke_root'};% update MatTools, MatRemote, MatHelp and LUKE
0068 %
0069 display_mode = 3;% show detailed results
0070 %
0071 exclude = {'.mat','~','.mexa64','.mexglx','.mexmaci64','.o','.DS_Store'};
0072 %
0073 flag = remotecvsupdate(remote,remotefunctions,display_mode,exclude);
0074 %
0075 disp('--------------------------------------')
0076 disp('           GLOBAL RESULTS             ')
0077 disp('--------------------------------------')
0078 disp(' ')
0079 disp('  -2 : the remote process failed')
0080 disp('  -1 : the cvs update process failed')
0081 disp('   0 : the cvs update succeeded without remote conflicts or remote modified files')
0082 disp('   1 : the cvs update succeeded without remote conflicts and with remote modified files')
0083 disp('   2 : the cvs update succeeded with remote conflicts')
0084 disp(' ')
0085 disp(' Results for : MatTools / MatRemote / MatHelp / LUKE ')
0086 disp(' ')
0087 disp('--------------------------------------')
0088 disp(' ')
0089 disp(' ')
0090 disp(' ')
0091 %
0092 flag1 = num2str(flag(:,1));
0093 flag2 = num2str(flag(:,2));
0094 flag3 = num2str(flag(:,3));
0095 flag4 = num2str(flag(:,4));
0096 %
0097 for irem = 1:nrem,
0098     disp([flag1(irem,:),' / ',flag2(irem,:),' / ',flag3(irem,:),' / ',flag4(irem,:),' : ',dkepath.profilestr{remote_index(remlist(irem))}])
0099 end
0100 %

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