From caf1f0c714e70b05e67f00eb3174ea4a91ed904c Mon Sep 17 00:00:00 2001 From: Tomas Hajny Date: Mon, 9 Dec 2019 21:49:05 +0000 Subject: [PATCH] * added support for specifying package listing files using wildcards git-svn-id: trunk@43669 - --- utils/mkinsadd.pp | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/utils/mkinsadd.pp b/utils/mkinsadd.pp index 3ec1d5172d..fe1786f440 100644 --- a/utils/mkinsadd.pp +++ b/utils/mkinsadd.pp @@ -439,9 +439,13 @@ begin end; var - I, J: byte; + I, J, K: byte; DAT: TDatFile; PrevCount: SW_Integer; + SR: SearchRec; + D: DirStr; + N: NameStr; + E: ExtStr; begin J := ParamCount; @@ -459,21 +463,36 @@ begin else Error ('Failure while loading source install.dat file (' + ParamStr (1) + ')', 1); + K := 0; for I := 2 to J do begin - PrevCount := DAT.LstCollection^.Count; - if DAT.ReadLstFile (ParamStr (I)) then - WriteLn ('Package listing #', Pred (I), ' (', ParamStr (I), - ') loaded correctly: ', DAT.LstCollection^.Count - PrevCount, - ' new records') + FSplit (ParamStr (I), D, N, E); + FindFirst (ParamStr (I), AnyFile - Directory, SR); + if DosError <> 0 then + Error ('No package listing file found for "' + ParamStr (I) + '"', I) else - Error ('Failure while loading package listing (' + ParamStr (I) + ')', I); + begin + while (DosError = 0) do + begin + Inc (K); + PrevCount := DAT.LstCollection^.Count; + if DAT.ReadLstFile (D + SR.Name) then + WriteLn ('Package listing #', K, ' (', D + SR.Name, + ') loaded correctly: ', DAT.LstCollection^.Count - PrevCount, + ' new records') + else + Error ('Failure while loading package listing (' + D + SR.Name + ')', + J + K); + FindNext (SR); + end; + FindClose (SR); + end; end; WriteLn ('Total: ', DAT.LstCollection^.Count, ' new records'); if DAT.WriteNew (DefDiffFN) then WriteLn ('Output file (' + DefDiffFN + ') created successfully.') else Error ('Failure while trying to write records to the output file (' + - DefDiffFN + ')', Succ (J)); + DefDiffFN + ')', Succ (J) + K); DAT.Done; end.