Skip to content

Commit b42df11

Browse files
committed
added option to makelist to output list of files with issues
1 parent 22d31a1 commit b42df11

6 files changed

Lines changed: 118 additions & 75 deletions

File tree

.timestamps

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11141,14 +11141,14 @@
1114111141
1775168885 7d90943f6f0d41d75f9ec12df08c6c7cd0becfac5056efeac8397c947c4565330e3e39d81f8ede4b466dc524508899a4ecf4131c6a34f9509bb0e2ad69722c9d utilities/makelist/LICENSE
1114211142
1775346744 c39038de71a15fb6b385e0e027f6615ad786a1371808f05917051d9d66acfbdf679514d6d5c88b18d9bf1ead4622ffdb0b9e1df3331250843be121a3b9939b3f utilities/makelist/bintree.pp
1114311143
1775471907 83bab5fe5b3027fc86b404315a63b0eb56b7ed776592138e0adf51a1937fb6201eeddea18ac31b96bbd5f37b75e90caf0114ff6ec6326aa4f29d7cd1afbf4f50 utilities/makelist/build.sh
11144-
1775434614 55350e6a13ed64b316ea39c4dd48fba21bcf9cdd366c95682c430687d2900f38003960d1078e9b0dca0378bea6b6d22320053e97dcc269f0b17e1b3dbf8edc7c utilities/makelist/makelist.lpi
11145-
1775472030 0a98b7c113c0c6600fae586b2697d05a9f54513bc9392a29f85df21d44dc01df805c38e2bc75ad0b7f7d852cf4af351e95abf6e8c7c5424cbd7f1af8215425b6 utilities/makelist/makelist.lpr
11146-
1775435158 8ea383da951858ec304fc347acee8cc68a9bb9f1dc1579c86401eb28c0c10f0b3fa2caaf257c736a5baf85f4c39db56ceab0d6a92efdfd8ff7533bd0fbc047f6 utilities/makelist/makelist.lps
11147-
1775434614 c0477913b3ac7eb8a58b56d3ff7127d290da16edd8a92abc479ab7c11b19e831144a2e17c5439f4499e6acce8bb41bab1f7e53e5fca49309630da246a23ae827 utilities/makelist/makelist.res
11144+
1775806726 d4c8f9792c99d63592df69b7a2f5edb10d314faf0339f20431c3bec225d89da195e61092c8c59d1c369edbb64e30d0471fa0dafe8a5ba0525abcf6b2eccbe8ed utilities/makelist/makelist.lpi
11145+
1775808015 d26c2588e32593ecfbffa74f5db469acfb2c44ed02fcbfc2bf1e9e32f6628ea1b4ec1902e3588125bc51128313fddbdfbe6a6d59a28e8b35595a7bc337b6d176 utilities/makelist/makelist.lpr
11146+
1775807897 5c5fb7b3c880cfa655041e1f35cdfaae62521d6e35ce23075f52ede30353a6dec3411f638da3128ff49b7585a2d72e8c3e815f02f510c3ed0f8697df35ec10fd utilities/makelist/makelist.lps
11147+
1775806726 f97756a03fba28172c087ad4900bb35d56d392ed6a05959302512e048b250aa9108e1f45b2b062d5abe5f5c43029b3d266f9b7f76e0b5e4dc33af1e811420861 utilities/makelist/makelist.res
1114811148
1775346672 3b7b7e6edaaf6c9728d260d3ca2bfd3ef4b08615e1f5caa1ca18e44439c85c5b53a445fb2decbf81874f761f4f818e2750e9e2291adc6497f052a7807328aee1 utilities/makelist/pasext.pp
1114911149
1775168827 6693f98642328f20ac92c57358eb532107f81b00e506b939ffd65dedf03d5baf2b825588128fe00bda86530b130809a7075384df429b9fd86f0ef9ea2db88cb6 utilities/makelist/patches.pp
1115011150
1774885828 4df3ff269b202a1dac7edad5200ad9ca0fcf6c4fe7614d0df925b1f3d5a1938bb575be93e2a7dade1b5e4b21dd3536181a27357e31b53da2dca25dae234413de utilities/makelist/version.def
11151-
1775435158 83a52f59b70cbebd59ce3c09ca246490f898a483764c26e641ae6ede9af331a74cd9d6f481d0467c32ec95dcafe7ea169aeebd96294f70a4653e4e8b298cce70 utilities/makelist/version.pp
11151+
1775807897 3a9ec99c9331c378ac4b3bea2448c46dd11565f129818d6d33fb7b00dae23168d597a8e51f45970d125fb69dcbe4b0816b4b93901ca291d9078f4fcbe5f46e54 utilities/makelist/version.pp
1115211152
1775434032 6df374e7a87c22059bf39cd9ed1614e1af6d785e20c2ec6b386b164b31816462027d0ebfe11ae4ecaa1f6d5bca15d3ab5ad9ff7d14df9ec47bfd13e3d4e0a6d3 utilities/makelist/version.sh
1115311153
1768044299 6d1670f425e5641c713c54e3102ee4627c6b539c84b10e93751f61161c28b672bec484d1add903fa406d5048255b3a10cd65e327346f58c83e273adc78d82bf5 utilities/one-off/breakdown-parser/LICENSE
1115411154
1775169301 f5e24688afba4ab8200d1ebd2b3fe82c836ce5e370fe692a6247ae0ad40580b974674b697ffdfe50284e8d2d479faeff56a3ee7cd0f5e16ff1e9112981ebf805 utilities/one-off/breakdown-parser/build.sh

utilities/makelist/makelist.lpi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<UseVersionInfo Value="True"/>
1818
<MajorVersionNr Value="1"/>
1919
<MinorVersionNr Value="1"/>
20-
<RevisionNr Value="3"/>
20+
<RevisionNr Value="4"/>
2121
<StringTable LegalCopyright="(c) 2025-2026 Jerome Shidel" ProductName="The List Release File Assembler" ProductVersion="1.0"/>
2222
</VersionInfo>
2323
<BuildModes>

utilities/makelist/makelist.lpr

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@
141141
{ ---------------------------------------------------------------------------- }
142142
// Global processing variables
143143
var
144+
Issues : String; // Filename to write file list of problem files.
144145
BaseDir : String; // LST file source base directory
145146
OutName : String; // LST Output FileName
146147
TitleWidth : integer; // Maximum LST file title width (+1)
@@ -169,6 +170,22 @@
169170

170171

171172
{ ---------------------------------------------------------------------------- }
173+
const
174+
IssueOpen : boolean = false;
175+
var
176+
LastFileName: String;
177+
IssueF : Text;
178+
179+
procedure WriteIssue;
180+
begin
181+
if Issues= '' then Exit;
182+
if not IssueOpen then begin
183+
System.Assign(IssueF, Issues);
184+
System.Rewrite(IssueF);
185+
IssueOpen:=True;
186+
end;
187+
WriteLn(IssueF, LastFileName);
188+
end;
172189

173190
// Returns the DOS file name from the Long file name or Group Title
174191
function DosFileName(FileName : String) : String;
@@ -390,6 +407,7 @@ function ReadFile(FileName : String; out Data : RawByteString) : boolean;
390407
A : TArrayOfString;
391408
I : Integer;
392409
begin
410+
LastFileName:='';
393411
if not FileExists(FileName) then begin
394412
Data:='';
395413
Exit(False);
@@ -404,6 +422,7 @@ function ReadFile(FileName : String; out Data : RawByteString) : boolean;
404422
A[I]:=TrimRight(A[I]);
405423
Data:=TrimCRLF(Implode(A, CRLF) + CRLF);
406424
Result:=True;
425+
LastFileName:=FileName;
407426
end;
408427

409428
// Saves a LST file to the output directory
@@ -520,6 +539,7 @@ procedure AddToTree(const Name, ID : String; const Data : RawByteString);
520539
N:= SectionTree.Add(ID, Data);
521540
if not Assigned(N) then begin
522541
LogMessage(vbVerbose, TAB + 'Duplicate UniqueID (' + ID + ') for file: ' + Name);
542+
WriteIssue;;
523543
Inc(TotalWarnings);
524544
XX:=0;
525545
repeat
@@ -536,12 +556,14 @@ procedure AddGlossary(const Name : String; var Data : RawByteString);
536556
ID:=Trim(PopDelim(Data, CRLF));
537557
if ID='' then begin
538558
LogMessage(vbMinimal, TAB + 'No Term specified for file: ' + Name);
559+
WriteIssue;;
539560
Inc(TotalErrors);
540561
Exit;
541562
end;
542563
Data:=TrimCRLF(Data);
543564
if Length(Data) = 0 then begin
544565
LogMessage(vbMinimal, TAB + 'No definition, excluded file: ' + Name);
566+
WriteIssue;;
545567
Inc(TotalErrors);
546568
Exit;
547569
end;
@@ -565,12 +587,14 @@ procedure AddLink(const Name : String; var Data : RawByteString);
565587
ID:=UpperCase(StringReplace(Trim(Copy(Title, 1, MaxLinkID)), SPACE, '-', [rfReplaceAll]));
566588
if ID='' then begin
567589
LogMessage(vbMinimal, TAB + 'No Term specified for file: ' + Name);
590+
WriteIssue;;
568591
Inc(TotalErrors);
569592
Exit;
570593
end;
571594
Data:=TrimCRLF(Data);
572595
if Length(Data) = 0 then begin
573596
LogMessage(vbMinimal, TAB + 'No definition, excluded file: ' + Name);
597+
WriteIssue;;
574598
Inc(TotalErrors);
575599
Exit;
576600
end;
@@ -586,12 +610,14 @@ procedure AddSMM(const Name : String; var Data : RawByteString);
586610
ID:=ExcludeLeading(ID, 'SMM-');
587611
if ID='' then begin
588612
LogMessage(vbMinimal, TAB + 'No ID specified for file: ' + Name);
613+
WriteIssue;;
589614
Inc(TotalErrors);
590615
Exit;
591616
end;
592617
Data:=TrimCRLF(Data);
593618
if Length(Data) = 0 then begin
594619
LogMessage(vbMinimal, TAB + 'No data, excluded file: ' + Name);
620+
WriteIssue;;
595621
Inc(TotalErrors);
596622
Exit;
597623
end;
@@ -681,6 +707,7 @@ procedure HighestTable(const Name : String; const Data : RawByteString);
681707
if (TableCode <> '') then begin
682708
if (not HasLeading(S, TableCode)) then begin
683709
LogMessage(vbMinimal, TAB + 'Invalid Table Prefix in file: ' + Name);
710+
WriteIssue;;
684711
Inc(TotalErrors);
685712
Continue;
686713
end;
@@ -689,17 +716,20 @@ procedure HighestTable(const Name : String; const Data : RawByteString);
689716
Val(S, V, E);
690717
if E <> 0 then begin
691718
LogMessage(vbMinimal, TAB + 'Invalid Table Number in file: ' + Name);
719+
WriteIssue;;
692720
Inc(TotalErrors);
693721
Continue;
694722
end;
695723
if V > TableHigh then TableHigh:=V;
696724
N:=TableTree.Add(T);
697725
if not Assigned(N) then begin
698726
LogMessage(vbMinimal, TAB + 'Duplicated Table ID (' + T + ') in file: ' + Name);
727+
WriteIssue;;
699728
Inc(TotalErrors);
700729
end;
701730
end;
702731
LogMessage(vbMinimal, TAB+ 'Broken Table declaration in file: ' + Name);
732+
WriteIssue;;
703733
Inc(TotalErrors);
704734
end;
705735

@@ -710,11 +740,13 @@ procedure AddStandard(const Name : String; var Data : RawByteString);
710740
FileToSection(Name, Data, ID, Category, Flags);
711741
if ID='' then begin
712742
LogMessage(vbMinimal, TAB + 'No ID found for file: ' + Name);
743+
WriteIssue;;
713744
Inc(TotalErrors);
714745
Exit;
715746
end;
716747
if Pos(HeaderBar, Data) > 0 then begin
717748
LogMessage(vbNormal, TAB+ 'Probably joined entry data in file: ' + Name);
749+
WriteIssue;;
718750
Inc(TotalProblems);
719751
end;
720752
{ TODO 5 -cDevel Add UID validation }
@@ -723,6 +755,7 @@ procedure AddStandard(const Name : String; var Data : RawByteString);
723755
HighestTable(Name, Data);
724756
if Length(Data) = 0 then begin
725757
LogMessage(vbMinimal, TAB + 'No data, excluded file: ' + Name);
758+
WriteIssue;;
726759
Inc(TotalErrors);
727760
Exit;
728761
end;
@@ -986,7 +1019,8 @@ procedure Help;
9861019
(S:''; L:'--modern'; V:''; M:'Disable legacy mode for modern parsers (default).'),
9871020
(S:''; L:'--legacy'; V:''; M:'Enable compatibility mode for legacy parsers.'),
9881021
(S:''; L:''; V:''; M:''),
989-
(S:''; L:'--cicd'; V:''; M:'More strict verification for usage with CI/CD.')
1022+
(S:''; L:'--cicd'; V:''; M:'More strict verification for usage with CI/CD.'),
1023+
(S:''; L:'--issues'; V:'(file)'; M:'Write a list of the files with issues to a file.')
9901024
);
9911025

9921026
var
@@ -1078,6 +1112,7 @@ procedure Options;
10781112
'--cicd' : CICD:=True;
10791113
'--modern' : LegacyMode:=False;
10801114
'--legacy' : LegacyMode:=True;
1115+
'--issues' : Issues:=Trim(NextOpt);
10811116
'-s', '--source' : DirSource:=IncludeTrailingPathDelimiter(Trim(NextOpt));
10821117
'-o', '--output' : DirOutput:=IncludeTrailingPathDelimiter(Trim(NextOpt));
10831118
'-m', '--maximum' : begin
@@ -1260,7 +1295,10 @@ procedure ReadFileMap;
12601295
// We do not really need to include the Lazarus Resourse in the executable
12611296
{ R *.res}
12621297

1298+
{ R *.res}
1299+
12631300
begin
1301+
Issues:='';
12641302
TotalTables:=0;
12651303
TotalEntries:=0;
12661304
TotalErrors:=0;
@@ -1271,15 +1309,19 @@ procedure ReadFileMap;
12711309
ReadFileMap;
12721310
Banner;
12731311
Build;
1312+
if IssueOpen then begin
1313+
System.Close(IssueF);
1314+
IssueOpen:=False;
1315+
end;
12741316
LogMessage(vbNormal, '');
12751317
LogMessage(vbNormal, 'Total Number of Entries: ' + IntToStr(TotalEntries));
12761318
LogMessage(vbNormal, 'Total Number of Tables: ' + IntToStr(TotalTables));
12771319
if TotalWarnings > 0 then
1278-
LogMessage(vbMinimal, 'Total Number of Warnings: ' + IntToStr(TotalWarnings));
1320+
LogMessage(vbMinimal, 'Total Number of Warnings: ' + IntToStr(TotalWarnings));
12791321
if TotalProblems > 0 then
1280-
LogMessage(vbMinimal, 'Total Number of Problems: ' + IntToStr(TotalProblems));
1322+
LogMessage(vbMinimal, 'Total Number of Problems: ' + IntToStr(TotalProblems));
12811323
if TotalErrors > 0 then
1282-
LogMessage(vbMinimal, 'Total Number of Errors: ' + IntToStr(TotalErrors));
1324+
LogMessage(vbMinimal, 'Total Number of Errors: ' + IntToStr(TotalErrors));
12831325
if CICD then begin
12841326
if (TotalProblems > 0) or (TotalErrors > 0)then begin
12851327
LogMessage(vbCritical, 'Done, CI/CD verification error.');

0 commit comments

Comments
 (0)