Use GetRemoteString function in TransferRemote

git-svn-id: trunk@28924 -
This commit is contained in:
pierre 2014-10-24 22:05:00 +00:00
parent c228424fc9
commit 8e5835a3bd

View File

@ -14,46 +14,26 @@
**********************************************************************} **********************************************************************}
{$ifdef SUPPORT_REMOTE} {$ifdef SUPPORT_REMOTE}
function GetRemoteString : string;
var
St : string;
begin
St:=RemoteSendCommand;
If RemoteConfig<>'' then
ReplaceStrI(St,'$CONFIG','-F '+RemoteConfig)
else
ReplaceStrI(St,'$CONFIG','');
If RemoteIdent<>'' then
ReplaceStrI(St,'$IDENT','-i '+RemoteIdent)
else
ReplaceStrI(St,'$IDENT','');
ReplaceStrI(St,'$LOCALFILE',GDBFileName(ExeFile));
ReplaceStrI(St,'$REMOTEDIR',RemoteDir);
ReplaceStrI(St,'$REMOTEMACHINE',RemoteMachine);
GetRemoteString:=st;
end;
procedure TIDEApp.TransferRemote; procedure TIDEApp.TransferRemote;
var var
S,SendCommand : string; DoSendCommand : string;
Executed : boolean; Executed : boolean;
begin begin
SendCommand:=GetRemoteString; DoSendCommand:=TransformRemoteString(RemoteSendCommand);
if SendCommand<>'' then if DoSendCommand<>'' then
begin begin
s:='scp'+exeext; Executed:=DoExecute(DoSendCommand,'','','send___.out','send___.err',exNormal);
if LocateExeFile(s) then
Executed:=DoExecute(s,SendCommand,'','','',exNormal)
else
Executed:=DoExecute('scp',SendCommand,'','','',exNormal);
if Executed then if Executed then
begin begin
if (DosError<>0) or (DosExitCode<>0) then if (DosError<>0) or (DosExitCode<>0) then
ErrorBox(#3'Execution of'#13#3+s+' '+SendCommand+#13#3+ ErrorBox(#3'Execution of'#13#3+DoSendCommand+#13#3+
'returned ('+inttostr(DosError)+','+inttostr(DosExitCode)+')',nil); 'returned ('+inttostr(DosError)+','+inttostr(DosExitCode)+')',nil);
ProcessMessageFile('send___.out');
ProcessMessageFile('send___.err');
UpdateToolMessages;
end end
else else
ErrorBox(#3'Unable to execute'#13#3+s+' '+SendCommand,nil); ErrorBox(#3'Unable to execute'#13#3+DoSendCommand,nil);
end end
else else