mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: MultiArc - check exitstatus on list parsing (#1936)
This commit is contained in:
parent
edb8bab9f4
commit
fd70dbe29a
5 changed files with 13 additions and 4 deletions
|
|
@ -292,7 +292,7 @@ begin
|
|||
Result:= False;
|
||||
ShowError(Format(rsMsgLogError + rsMsgLogPack,
|
||||
[FileName +
|
||||
' - Exit status: ' + IntToStr(ExitStatus)]), [log_arc_op]);
|
||||
' - ' + rsMsgExitStatusCode + ' ' + IntToStr(ExitStatus)]), [log_arc_op]);
|
||||
end
|
||||
else
|
||||
begin
|
||||
|
|
|
|||
|
|
@ -672,7 +672,7 @@ begin
|
|||
ShowError(Format(rsMsgLogError + rsMsgLogExtract,
|
||||
[FMultiArchiveFileSource.ArchiveFileName + PathDelim +
|
||||
SourceName + ' -> ' + TargetName +
|
||||
' - Exit status: ' + IntToStr(ExitStatus)]), [log_arc_op]);
|
||||
' - ' + rsMsgExitStatusCode + ' ' + IntToStr(ExitStatus)]), [log_arc_op]);
|
||||
end // Error
|
||||
else
|
||||
begin
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ begin
|
|||
begin
|
||||
ShowError(Format(rsMsgLogError + rsMsgLogDelete,
|
||||
[FileName +
|
||||
' - Exit status: ' + IntToStr(ExitStatus)]), [log_arc_op]);
|
||||
' - ' + rsMsgExitStatusCode + ' ' + IntToStr(ExitStatus)]), [log_arc_op]);
|
||||
end
|
||||
else
|
||||
begin
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ implementation
|
|||
|
||||
uses
|
||||
uDebug, uGlobs, DCFileAttributes, DCOSUtils, DCStrUtils, DCDateTimeUtils,
|
||||
FileUtil, uMasks,
|
||||
FileUtil, uMasks, uLng,
|
||||
uMultiArchiveListOperation,
|
||||
uMultiArchiveCopyInOperation,
|
||||
uMultiArchiveCopyOutOperation,
|
||||
|
|
@ -606,6 +606,9 @@ begin
|
|||
FOutputParser.Execute;
|
||||
FPassword:= FOutputParser.Password;
|
||||
|
||||
if FOutputParser.OpenError and (AFileList.Count < 1) then
|
||||
raise EFileSourceException.Create(rsMsgErrEOpen);
|
||||
|
||||
(* if archiver does not give a list of folders *)
|
||||
for I := 0 to FAllDirsList.Count - 1 do
|
||||
begin
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ type
|
|||
FExProcess: TExProcess;
|
||||
FMultiArcItem: TMultiArcItem;
|
||||
FParser: TMultiArchiveParser;
|
||||
FErrorLevel: LongInt;
|
||||
FOpenError: Boolean;
|
||||
FConvertEncoding: function (const Source: String): RawByteString;
|
||||
private
|
||||
FArchiveName: String;
|
||||
|
|
@ -35,6 +37,7 @@ type
|
|||
procedure Prepare;
|
||||
procedure Execute;
|
||||
|
||||
property OpenError: Boolean read FOpenError;
|
||||
property Password: String read FPassword write FPassword;
|
||||
property OnGetArchiveItem: TOnGetArchiveItem write SetOnGetArchiveItem;
|
||||
end;
|
||||
|
|
@ -68,6 +71,7 @@ var
|
|||
Index: Integer;
|
||||
begin
|
||||
Result:= FMultiArcItem.FList;
|
||||
FErrorLevel:= ExtractErrorLevel(Result);
|
||||
Index:= Pos('%O', Result);
|
||||
FConvertEncoding:= @DCOSUtils.ConsoleToUTF8;
|
||||
if (Index > 0) and (Index + 2 <= Length(Result)) then
|
||||
|
|
@ -87,6 +91,7 @@ end;
|
|||
|
||||
procedure TOutputParser.OnProcessExit;
|
||||
begin
|
||||
FOpenError:= (FExProcess.ExitStatus > FErrorLevel);
|
||||
FParser.ParseLines;
|
||||
end;
|
||||
|
||||
|
|
@ -190,6 +195,7 @@ begin
|
|||
sCommandLine:= FormatArchiverCommand(FMultiArcItem.FArchiver,
|
||||
sCommandLine, FArchiveName,
|
||||
nil, '', '','', FPassword);
|
||||
|
||||
if FMultiArcItem.FDebug then
|
||||
DCDebug(sCommandLine);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue