mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 07:39:25 +02:00
Use GetRemoteString function in TransferRemote
git-svn-id: trunk@28924 -
This commit is contained in:
parent
c228424fc9
commit
8e5835a3bd
@ -14,46 +14,26 @@
|
||||
**********************************************************************}
|
||||
|
||||
{$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;
|
||||
var
|
||||
S,SendCommand : string;
|
||||
DoSendCommand : string;
|
||||
Executed : boolean;
|
||||
begin
|
||||
SendCommand:=GetRemoteString;
|
||||
if SendCommand<>'' then
|
||||
DoSendCommand:=TransformRemoteString(RemoteSendCommand);
|
||||
if DoSendCommand<>'' then
|
||||
begin
|
||||
s:='scp'+exeext;
|
||||
if LocateExeFile(s) then
|
||||
Executed:=DoExecute(s,SendCommand,'','','',exNormal)
|
||||
else
|
||||
Executed:=DoExecute('scp',SendCommand,'','','',exNormal);
|
||||
Executed:=DoExecute(DoSendCommand,'','','send___.out','send___.err',exNormal);
|
||||
if Executed then
|
||||
begin
|
||||
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);
|
||||
ProcessMessageFile('send___.out');
|
||||
ProcessMessageFile('send___.err');
|
||||
UpdateToolMessages;
|
||||
end
|
||||
else
|
||||
ErrorBox(#3'Unable to execute'#13#3+s+' '+SendCommand,nil);
|
||||
ErrorBox(#3'Unable to execute'#13#3+DoSendCommand,nil);
|
||||
|
||||
end
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user